(svn r9846) -Codechange: introduced ZOOM_LVL_MIN and ZOOM_LVL_MAX for the obvious reasons

-Codechange: introduced ZOOM_LVL_DETAIL to show/remove details
-Codechange: changed << and >> operator with ZoomLevel to a simple wrapper (that in theory also allows zoom-in besides the current zoom-out)
-Fix r9845: missed some int -> ZoomLevel
This commit is contained in:
truelight
2007-05-15 16:08:46 +00:00
parent 5b1b54e614
commit b605f68631
13 changed files with 79 additions and 60 deletions

View File

@@ -22,8 +22,25 @@ enum ZoomLevel {
ZOOM_LVL_TRAIN = ZOOM_LVL_NORMAL,
ZOOM_LVL_ROADVEH = ZOOM_LVL_NORMAL,
ZOOM_LVL_WORLD_SCREENSHOT = ZOOM_LVL_NORMAL,
ZOOM_LVL_DETAIL = ZOOM_LVL_OUT_2X, //! All zoomlevels below or equal to this, will result in details on the screen, like road-work, ...
ZOOM_LVL_MIN = ZOOM_LVL_NORMAL,
ZOOM_LVL_MAX = ZOOM_LVL_OUT_4X,
};
extern ZoomLevel _saved_scrollpos_zoom;
static inline int ScaleByZoom(int value, ZoomLevel zoom)
{
int izoom = (int)zoom - (int)ZOOM_LVL_NORMAL;
return (zoom > ZOOM_LVL_NORMAL) ? value >> izoom : value << izoom;
}
static inline int UnScaleByZoom(int value, ZoomLevel zoom)
{
int izoom = (int)zoom - (int)ZOOM_LVL_NORMAL;
return (zoom > ZOOM_LVL_NORMAL) ? value << izoom : value >> izoom;
}
#endif /* ZOOM_HPP */