(svn r12346) -Fix [FS#1748, FS#1825](r9874, r11872): Remove duplicated and inconsistent code wrt. autoreplace with rules in both vehicles' group and ALL_GROUP.
/* $Id$ *//** @file zoom_func.hpp */#ifndef ZOOM_FUNC_H#define ZOOM_FUNC_H#include"zoom_type.h"externZoomLevel_saved_scrollpos_zoom;/** * Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_NORMAL) * When shifting right, value is rounded up * @param value value to shift * @param zoom zoom level to shift to * @return shifted value */staticinlineintScaleByZoom(intvalue,ZoomLevelzoom){if(zoom==ZOOM_LVL_NORMAL)returnvalue;intizoom=zoom-ZOOM_LVL_NORMAL;return(zoom>ZOOM_LVL_NORMAL)?value<<izoom:(value+(1<<-izoom)-1)>>-izoom;}/** * Scale by zoom level, usually shift right (when zoom > ZOOM_LVL_NORMAL) * When shifting right, value is rounded up * @param value value to shift * @param zoom zoom level to shift to * @return shifted value */staticinlineintUnScaleByZoom(intvalue,ZoomLevelzoom){if(zoom==ZOOM_LVL_NORMAL)returnvalue;intizoom=zoom-ZOOM_LVL_NORMAL;return(zoom>ZOOM_LVL_NORMAL)?(value+(1<<izoom)-1)>>izoom:value<<-izoom;}/** * Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_NORMAL) * @param value value to shift * @param zoom zoom level to shift to * @return shifted value */staticinlineintScaleByZoomLower(intvalue,ZoomLevelzoom){if(zoom==ZOOM_LVL_NORMAL)returnvalue;intizoom=zoom-ZOOM_LVL_NORMAL;return(zoom>ZOOM_LVL_NORMAL)?value<<izoom:value>>-izoom;}/** * Scale by zoom level, usually shift right (when zoom > ZOOM_LVL_NORMAL) * @param value value to shift * @param zoom zoom level to shift to * @return shifted value */staticinlineintUnScaleByZoomLower(intvalue,ZoomLevelzoom){if(zoom==ZOOM_LVL_NORMAL)returnvalue;intizoom=zoom-ZOOM_LVL_NORMAL;return(zoom>ZOOM_LVL_NORMAL)?value>>izoom:value<<-izoom;}#endif /* ZOOM_FUNC_H */