10#ifndef VIEWPORT_FUNC_H
11#define VIEWPORT_FUNC_H
23void SetSelectionRed(
bool);
28Point GetTileBelowCursor();
34void ZoomInOrOutToCursorWindow(
bool in,
Window * w);
35void ConstrainAllViewportsZoom();
37void FixTitleGameZoom(
int zoom_adjust = 0);
67bool HandleViewportClicked(
const Viewport &vp,
int x,
int y);
70void SetTileSelectBigSize(
int ox,
int oy,
int sx,
int sy);
72void ViewportDoDraw(
const Viewport &vp,
int left,
int top,
int right,
int bottom);
77void RebuildViewportOverlay(
Window *w);
83void ClearAllCachedNames();
85extern Point _tile_fract_coords;
111void MarkCatchmentTilesDirty();
114void SetViewportCatchmentSpecializedStation(
const T *st,
bool sel);
117inline void SetViewportCatchmentSpecializedStation(
const Station *st,
bool sel)
123inline void SetViewportCatchmentSpecializedStation(
const Waypoint *st,
bool sel)
#define T
Climate temperate.
Types related to the graphics and/or input devices.
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
uint32_t PaletteID
The number of the palette.
Colours
One of 16 base colours used for companies and windows/widgets.
bool MarkAllViewportsDirty(int left, int top, int right, int bottom)
Mark all viewports that display an area as dirty (in need of repaint).
void MarkTileDirtyByTile(TileIndex tile, int bridge_level_offset, int tile_height_override)
Mark a tile given by its index dirty for repaint.
#define Point
Macro that prevents name conflicts between included headers.
Base for drawing complex sprites.
Types related to stations.
A coordinate with three dimensions.
Data about how and where to blit pixels.
Used to only draw a part of the sprite.
Location information about a sign as seen on the viewport.
Data structure for viewport, display of a part of the world.
Representation of a waypoint.
Data structure for an opened window.
Map writing/reading functions for tiles.
static uint TileHeight(Tile tile)
Returns the height of a tile.
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > > TileIndex
The index/ID of a Tile.
Types related to vehicles.
std::string * ViewportAddString(const DrawPixelInfo *dpi, const ViewportSign *sign, ViewportStringFlags flags, Colours colour)
Add a string to draw in the current viewport.
bool ScrollMainWindowToTile(TileIndex tile, bool instant=false)
Scrolls the viewport of the main window to a given location.
void SetTileSelectSize(int w, int h)
Highlight w by h tiles at the cursor.
void OffsetGroundSprite(int x, int y)
Called when a foundation has been drawn for the current tile.
void SetViewportStationRect(const Station *st, bool sel)
Select or deselect station for rectangle area highlight.
void StartSpriteCombine()
Starts a block of sprites, which are "combined" into a single bounding box.
void DrawGroundSprite(SpriteID image, PaletteID pal, const SubSprite *sub=nullptr, int extra_offs_x=0, int extra_offs_y=0)
Draws a ground sprite for the current tile.
void AddChildSpriteScreen(SpriteID image, PaletteID pal, int x, int y, bool transparent=false, const SubSprite *sub=nullptr, bool scale=true, bool relative=true)
Add a child sprite to a parent sprite.
void SetViewportCatchmentWaypoint(const Waypoint *wp, bool sel)
Select or deselect waypoint for coverage area highlight.
void SetRedErrorSquare(TileIndex tile)
Set a tile to display a red error square.
bool ScrollMainWindowTo(int x, int y, int z=-1, bool instant=false)
Scrolls the main window to given coordinates.
Point TranslateXYToTileCoord(const Viewport &vp, int x, int y, bool clamp_to_map=true)
Translate screen coordinate in a viewport to underlying tile coordinate.
Viewport * IsPtInWindowViewport(const Window *w, int x, int y)
Is a xy position inside the viewport of the window?
bool ScrollWindowTo(int x, int y, int z, Window *w, bool instant=false)
Scrolls the viewport in a window to a given location.
void EndSpriteCombine()
Terminates a block of sprites started by StartSpriteCombine.
void UpdateAllVirtCoords()
Update the viewport coordinates of all signs.
void SetViewportCatchmentStation(const Station *st, bool sel)
Select or deselect station for coverage area highlight.
void SetViewportCatchmentTown(const Town *t, bool sel)
Select or deselect town for coverage area highlight.
void InitializeWindowViewport(Window *w, int x, int y, int width, int height, std::variant< TileIndex, VehicleID > focus, ZoomLevel zoom)
Initialize viewport of the window for use.
void SetViewportWaypointRect(const Waypoint *wp, bool sel)
Select or deselect waypoint for rectangle area highlight.
void DrawGroundSpriteAt(SpriteID image, PaletteID pal, int32_t x, int32_t y, int z, const SubSprite *sub=nullptr, int extra_offs_x=0, int extra_offs_y=0)
Draws a ground sprite at a specific world-coordinate relative to the current tile.
bool DoZoomInOutWindow(ZoomStateChange how, Window *w)
Zooms a viewport in a window in or out.
void AddSortableSpriteToDraw(SpriteID image, PaletteID pal, int x, int y, int z, const SpriteBounds &bounds, bool transparent=false, const SubSprite *sub=nullptr)
Draw a (transparent) sprite at given coordinates with a given bounding box.
void HandleZoomMessage(Window *w, const Viewport &vp, WidgetID widget_zoom_in, WidgetID widget_zoom_out)
Update the status of the zoom-buttons according to the zoom-level of the viewport.
bool ScrollWindowToTile(TileIndex tile, Window *w, bool instant=false)
Scrolls the viewport in a window to a given location.
static const int TILE_HEIGHT_STEP
One Z unit tile height difference is displayed as 50m.
void UpdateViewportPosition(Window *w, uint32_t delta_ms)
Update the viewport position being displayed.
void MaxZoomInOut(ZoomStateChange how, Window *w)
Zoom a viewport as far as possible in the given direction.
Types related to viewports.
ZoomStateChange
Directions of zooming.
Types related to windows.
ZoomLevel
All zoom levels we know.