OpenTTD Source: Viewport Struct Reference

OpenTTD Source 15.0-RC2

Data Fields
Viewport Struct Reference

Data structure for viewport, display of a part of the world. More...

`#include <viewport_type.h>`

Inheritance diagram for Viewport:

## Data Fields
int | left
| Screen coordinate left edge of the viewport.
int | top
| Screen coordinate top edge of the viewport.
int | width
| Screen width of the viewport.
int | height
| Screen height of the viewport.
int | virtual_left
| Virtual left coordinate.
int | virtual_top
| Virtual top coordinate.
int | virtual_width
| width << zoom
int | virtual_height
| height << zoom
ZoomLevel | zoom
| The zoom level of the viewport.
std::shared_ptr< LinkGraphOverlay > | overlay

## Detailed Description

Data structure for viewport, display of a part of the world.

Definition at line 31 of file viewport_type.h.

## Field Documentation

## ◆ height

int Viewport::height

Screen height of the viewport.

Definition at line 35 of file viewport_type.h.

Referenced by CheckClickOnVehicle(), HandleAutoscroll(), IsPtInWindowViewport(), MakeLargeWorldScreenshot(), MakeScreenshotWithConfirm(), TranslateXYToTileCoord(), and NWidgetViewport::UpdateViewportCoordinates().

## ◆ left

int Viewport::left

Screen coordinate left edge of the viewport.

Definition at line 32 of file viewport_type.h.

Referenced by CheckClickOnVehicle(), CheckClickOnViewportSign(), HandleAutoscroll(), IsPtInWindowViewport(), LargeWorldCallback(), MarkViewportDirty(), TranslateXYToTileCoord(), and NWidgetViewport::UpdateViewportCoordinates().

## ◆ overlay

std::shared_ptr<LinkGraphOverlay> Viewport::overlay

Definition at line 43 of file viewport_type.h.

## ◆ top

int Viewport::top

Screen coordinate top edge of the viewport.

Definition at line 33 of file viewport_type.h.

Referenced by CheckClickOnVehicle(), CheckClickOnViewportSign(), HandleAutoscroll(), IsPtInWindowViewport(), LargeWorldCallback(), MarkViewportDirty(), TranslateXYToTileCoord(), and NWidgetViewport::UpdateViewportCoordinates().

## ◆ virtual_height

int Viewport::virtual_height

height << zoom

Definition at line 40 of file viewport_type.h.

Referenced by ClampViewportToMap(), DoZoomInOutWindow(), SmallMapWindow::DrawMapIndicators(), MarkViewportDirty(), IntroGameViewportCommand::PositionForViewport(), SmallMapWindow::SmallMapCenterOnCurrentPos(), and NWidgetViewport::UpdateViewportCoordinates().

## ◆ virtual_left

int Viewport::virtual_left

Virtual left coordinate.

Definition at line 37 of file viewport_type.h.

Referenced by CheckClickOnVehicle(), CheckClickOnViewportSign(), SmallMapWindow::DrawMapIndicators(), LargeWorldCallback(), MarkViewportDirty(), SmallMapWindow::SmallMapCenterOnCurrentPos(), SndPlayScreenCoordFx(), and TranslateXYToTileCoord().

## ◆ virtual_top

int Viewport::virtual_top

Virtual top coordinate.

Definition at line 38 of file viewport_type.h.

Referenced by CheckClickOnVehicle(), CheckClickOnViewportSign(), SmallMapWindow::DrawMapIndicators(), LargeWorldCallback(), MarkViewportDirty(), SmallMapWindow::SmallMapCenterOnCurrentPos(), SndPlayScreenCoordFx(), and TranslateXYToTileCoord().

## ◆ virtual_width

int Viewport::virtual_width

width << zoom

Definition at line 39 of file viewport_type.h.

Referenced by ClampViewportToMap(), DoZoomInOutWindow(), SmallMapWindow::DrawMapIndicators(), MarkViewportDirty(), IntroGameViewportCommand::PositionForViewport(), SmallMapWindow::SmallMapCenterOnCurrentPos(), SndPlayScreenCoordFx(), and NWidgetViewport::UpdateViewportCoordinates().

## ◆ width

int Viewport::width

Screen width of the viewport.

Definition at line 34 of file viewport_type.h.

Referenced by CheckClickOnVehicle(), HandleAutoscroll(), IsPtInWindowViewport(), LargeWorldCallback(), MakeLargeWorldScreenshot(), MakeScreenshotWithConfirm(), ViewportSign::MarkDirty(), TranslateXYToTileCoord(), and NWidgetViewport::UpdateViewportCoordinates().

## ◆ zoom

ZoomLevel Viewport::zoom

The zoom level of the viewport.

Definition at line 42 of file viewport_type.h.

Referenced by CheckClickOnVehicle(), CheckClickOnViewportSign(), CheckClickOnViewportSign(), ConZoomToLevel(), DoZoomInOutWindow(), HandleAutoscroll(), HandleZoomMessage(), LargeWorldCallback(), ViewportSign::MarkDirty(), MarkViewportDirty(), SndPlayScreenCoordFx(), TranslateXYToTileCoord(), and NWidgetViewport::UpdateViewportCoordinates().

The documentation for this struct was generated from the following file:

- src/viewport_type.h