OpenTTD Source
20241108-master-g80f628063a
|
Functions related to zooming. More...
#include "zoom_type.h"
Go to the source code of this file.
Functions | |
int | ScaleByZoom (int value, ZoomLevel zoom) |
Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_MIN) When shifting right, value is rounded up. More... | |
int | UnScaleByZoom (int value, ZoomLevel zoom) |
Scale by zoom level, usually shift right (when zoom > ZOOM_LVL_MIN) When shifting right, value is rounded up. More... | |
int | AdjustByZoom (int value, int zoom) |
Adjust by zoom level; zoom < 0 shifts right, zoom >= 0 shifts left. More... | |
int | ScaleByZoomLower (int value, ZoomLevel zoom) |
Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_MIN) More... | |
int | UnScaleByZoomLower (int value, ZoomLevel zoom) |
Scale by zoom level, usually shift right (when zoom > ZOOM_LVL_MIN) More... | |
int | UnScaleGUI (int value) |
Short-hand to apply GUI zoom level. More... | |
ZoomLevel | ScaleZoomGUI (ZoomLevel value) |
Scale zoom level relative to GUI zoom. More... | |
ZoomLevel | UnScaleZoomGUI (ZoomLevel value) |
UnScale zoom level relative to GUI zoom. More... | |
int | ScaleSpriteTrad (int value) |
Scale traditional pixel dimensions to GUI zoom level, for drawing sprites. More... | |
int | ScaleGUITrad (int value) |
Scale traditional pixel dimensions to GUI zoom level. More... | |
Functions related to zooming.
Definition in file zoom_func.h.
|
inline |
Adjust by zoom level; zoom < 0 shifts right, zoom >= 0 shifts left.
value | value to shift |
zoom | zoom level to shift to |
Definition at line 45 of file zoom_func.h.
References ScaleByZoom(), and UnScaleByZoom().
|
inline |
Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_MIN) When shifting right, value is rounded up.
value | value to shift |
zoom | zoom level to shift to |
Definition at line 22 of file zoom_func.h.
Referenced by AdjustByZoom(), Blitter_32bppSimple::Draw(), Blitter_8bppSimple::Draw(), ViewportSign::MarkDirty(), NWidgetViewport::UpdateViewportCoordinates(), and ViewportAddString().
|
inline |
Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_MIN)
value | value to shift |
zoom | zoom level to shift to |
Definition at line 56 of file zoom_func.h.
|
inline |
Scale traditional pixel dimensions to GUI zoom level.
value | Pixel amount at #ZOOM_BASE (traditional "normal" interface size). |
Definition at line 117 of file zoom_func.h.
References _gui_scale.
Referenced by SpriteFontCache::ClearFontCache(), ClickSliderWidget(), LinkGraphOverlay::DrawContent(), LinkGraphOverlay::DrawLinks(), DrawSliderWidget(), LinkGraphOverlay::DrawStationDots(), WindowDesc::GetDefaultHeight(), WindowDesc::GetDefaultWidth(), VehicleDetailsWindow::GetRoadVehDetailsHeight(), GetVehicleListHeight(), NetworkInitChatMessage(), NetworkReInitChatBoxSize(), IndustryCargoesWindow::OnInit(), and SpriteFontCache::SpriteFontCache().
|
inline |
Scale traditional pixel dimensions to GUI zoom level, for drawing sprites.
value | Pixel amount at #ZOOM_BASE (traditional "normal" interface size). |
Definition at line 107 of file zoom_func.h.
References UnScaleGUI().
Referenced by DepotWindow::DrawVehicleInDepot(), GetTrainDetailsWndVScroll(), DepotWindow::OnPaint(), EndGameWindow::OnPaint(), and HighScoreWindow::OnPaint().
Scale zoom level relative to GUI zoom.
value | zoom level to scale |
Definition at line 87 of file zoom_func.h.
Referenced by WaypointWindow::WaypointWindow().
|
inline |
Scale by zoom level, usually shift right (when zoom > ZOOM_LVL_MIN) When shifting right, value is rounded up.
value | value to shift |
zoom | zoom level to shift to |
Definition at line 34 of file zoom_func.h.
Referenced by AdjustByZoom(), MarkViewportDirty(), ScaleFontTrad(), and UnScaleGUI().
|
inline |
Scale by zoom level, usually shift right (when zoom > ZOOM_LVL_MIN)
value | value to shift |
zoom | zoom level to shift to |
Definition at line 67 of file zoom_func.h.
Referenced by MarkViewportDirty().
|
inline |
Short-hand to apply GUI zoom level.
value | Pixel amount at ZOOM_LVL_MIN (full zoom in). |
Definition at line 77 of file zoom_func.h.
References UnScaleByZoom().
Referenced by DrawAircraftImage(), DrawShipImage(), GetSingleVehicleWidth(), and ScaleSpriteTrad().
UnScale zoom level relative to GUI zoom.
value | zoom level to scale |
Definition at line 97 of file zoom_func.h.