(svn r27134) -Codechange: Simplify GUI scaling by adding UnScaleGUI() and ScaleGUITrad().

This commit is contained in:
frosch
2015-02-01 20:54:24 +00:00
parent cd3f113249
commit 8767a11d60
25 changed files with 176 additions and 141 deletions

View File

@@ -64,4 +64,24 @@ static inline int UnScaleByZoomLower(int value, ZoomLevel zoom)
return value >> zoom;
}
/**
* Short-hand to apply GUI zoom level.
* @param value Pixel amount at #ZOOM_LVL_BEGIN (full zoom in).
* @return value Pixel amount at #ZOOM_LVL_GUI.
*/
static inline int UnScaleGUI(int value)
{
return UnScaleByZoom(value, ZOOM_LVL_GUI);
}
/**
* Scale traditional pixel dimensions to GUI zoom level.
* @param value Pixel amount at 1x zoom level.
* @return value Pixel amount at #ZOOM_LVL_GUI.
*/
static inline int ScaleGUITrad(int value)
{
return UnScaleGUI(value * ZOOM_LVL_BASE);
}
#endif /* ZOOM_FUNC_H */