Functions

# zoom_func.h File Reference

Functions related to zooming. More...

`#include "zoom_type.h"`

Go to the source code of this file.

## Functions
static int | ScaleByZoom (int value, ZoomLevel zoom)
| Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_NORMAL) When shifting right, value is rounded up.
static int | UnScaleByZoom (int value, ZoomLevel zoom)
| Scale by zoom level, usually shift right (when zoom > ZOOM_LVL_NORMAL) When shifting right, value is rounded up.
static int | ScaleByZoomLower (int value, ZoomLevel zoom)
| Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_NORMAL).
static int | UnScaleByZoomLower (int value, ZoomLevel zoom)
| Scale by zoom level, usually shift right (when zoom > ZOOM_LVL_NORMAL).

## Detailed Description

Functions related to zooming.

Definition in file zoom_func.h.

## Function Documentation

static int ScaleByZoom | ( | int | value,
|  | ZoomLevel | zoom |
| ) |  |  | `[inline, static]`

Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_NORMAL) When shifting right, value is rounded up.

Parameters:

  | value | value to shift
  | zoom | zoom level to shift to

Returns:
  shifted value

Definition at line 24 of file zoom_func.h.

References ZOOM_LVL_NORMAL.

Referenced by CheckClickOnVehicle(), CheckClickOnViewportSign(), Blitter_8bppSimple::Draw(), Blitter_32bppSimple::Draw(), HandleAutoscroll(), InitializeWindowViewport(), LargeWorldCallback(), ViewportSign::MarkDirty(), ExtraViewportWindow::OnScroll(), MainWindow::OnScroll(), RelocateAllWindows(), TranslateXYToTileCoord(), NWidgetViewport::UpdateViewportCoordinates(), ViewportAddString(), and ViewportDrawChk().

static int ScaleByZoomLower | ( | int | value,
|  | ZoomLevel | zoom |
| ) |  |  | `[inline, static]`

Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_NORMAL).

Parameters:

  | value | value to shift
  | zoom | zoom level to shift to

Returns:
  shifted value

Definition at line 51 of file zoom_func.h.

References ZOOM_LVL_NORMAL.

static int UnScaleByZoom | ( | int | value,
|  | ZoomLevel | zoom |
| ) |  |  | `[inline, static]`

Scale by zoom level, usually shift right (when zoom > ZOOM_LVL_NORMAL) When shifting right, value is rounded up.

Parameters:

  | value | value to shift
  | zoom | zoom level to shift to

Returns:
  shifted value

Definition at line 38 of file zoom_func.h.

References ZOOM_LVL_NORMAL.

Referenced by DrawAircraftImage(), DrawCommonTileSeqInGUI(), DrawRoadVehEngine(), DrawShipImage(), BuildSignalWindow::DrawSignalSprite(), DepotWindow::DrawVehicleInDepot(), VehicleDetailsWindow::DrawWidget(), GetAircraftSpriteSize(), GetShipSpriteSize(), GetSpriteSize(), GetVehicleWidth(), MakeZoomedInScreenshot(), MarkViewportDirty(), UpdateCursorSize(), and DepotWindow::UpdateWidgetSize().

static int UnScaleByZoomLower | ( | int | value,
|  | ZoomLevel | zoom |
| ) |  |  | `[inline, static]`

Scale by zoom level, usually shift right (when zoom > ZOOM_LVL_NORMAL).

Parameters:

  | value | value to shift
  | zoom | zoom level to shift to

Returns:
  shifted value

Definition at line 64 of file zoom_func.h.

References ZOOM_LVL_NORMAL.

Referenced by MarkViewportDirty().