# zoom_type.h

Go to the documentation of this file.

    00001 /* $Id: zoom_type.h 23316 2011-11-24 12:38:48Z peter1138 $ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
    00006  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    00007  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
    00008  */
    00009
    00012 #ifndef ZOOM_TYPE_H
    00013 #define ZOOM_TYPE_H
    00014
    00015 #include "core/enum_type.hpp"
    00016
    00017 static int const ZOOM_LVL_SHIFT = 2;
    00018 static int const ZOOM_LVL_BASE  = 1 << ZOOM_LVL_SHIFT;
    00019
    00021 enum ZoomLevel {
    00022   /* Our possible zoom-levels */
    00023   ZOOM_LVL_BEGIN  = 0,
    00024   ZOOM_LVL_NORMAL = 0,
    00025   ZOOM_LVL_OUT_2X,
    00026   ZOOM_LVL_OUT_4X,
    00027   ZOOM_LVL_OUT_8X,
    00028   ZOOM_LVL_OUT_16X,
    00029   ZOOM_LVL_OUT_32X,
    00030   ZOOM_LVL_END,
    00031
    00032   ZOOM_LVL_COUNT = ZOOM_LVL_END - ZOOM_LVL_BEGIN,
    00033
    00034   /* Here we define in which zoom viewports are */
    00035   ZOOM_LVL_VIEWPORT = ZOOM_LVL_OUT_4X,
    00036   ZOOM_LVL_GUI      = ZOOM_LVL_OUT_4X,
    00037   ZOOM_LVL_NEWS     = ZOOM_LVL_OUT_4X,
    00038   ZOOM_LVL_INDUSTRY = ZOOM_LVL_OUT_8X,
    00039   ZOOM_LVL_TOWN     = ZOOM_LVL_OUT_8X,
    00040   ZOOM_LVL_AIRCRAFT = ZOOM_LVL_OUT_4X,
    00041   ZOOM_LVL_SHIP     = ZOOM_LVL_OUT_4X,
    00042   ZOOM_LVL_TRAIN    = ZOOM_LVL_OUT_4X,
    00043   ZOOM_LVL_ROADVEH  = ZOOM_LVL_OUT_4X,
    00044   ZOOM_LVL_WORLD_SCREENSHOT = ZOOM_LVL_OUT_4X,
    00045
    00046   ZOOM_LVL_DETAIL   = ZOOM_LVL_OUT_8X,
    00047
    00048   ZOOM_LVL_MIN      = ZOOM_LVL_NORMAL,
    00049   ZOOM_LVL_MAX      = ZOOM_LVL_OUT_32X,
    00050 };
    00051 DECLARE_POSTFIX_INCREMENT(ZoomLevel)
    00052
    00053
    00054 typedef SimpleTinyEnumT<ZoomLevel, byte> ZoomLevelByte;
    00055
    00056 #endif /* ZOOM_TYPE_H */