12 #ifndef VIEWPORT_FUNC_H 13 #define VIEWPORT_FUNC_H 23 void SetSelectionRed(
bool);
25 void DeleteWindowViewport(
Window *w);
29 Point GetTileBelowCursor();
35 void ZoomInOrOutToCursorWindow(
bool in,
Window * w);
54 void AddSortableSpriteToDraw(
SpriteID image,
PaletteID pal,
int x,
int y,
int w,
int h,
int dz,
int z,
bool transparent =
false,
int bb_offset_x = 0,
int bb_offset_y = 0,
int bb_offset_z = 0,
const SubSprite *sub = NULL);
62 bool HandleViewportClicked(
const ViewPort *vp,
int x,
int y);
65 void SetTileSelectBigSize(
int ox,
int oy,
int sx,
int sy);
67 void ViewportDoDraw(
const ViewPort *vp,
int left,
int top,
int right,
int bottom);
72 void RebuildViewportOverlay(
Window *w);
79 extern Point _tile_fract_coords;
uint32 PaletteID
The number of the palette.
void HandleZoomMessage(Window *w, const ViewPort *vp, byte widget_zoom_in, byte widget_zoom_out)
Update the status of the zoom-buttons according to the zoom-level of the viewport.
Data about how and where to blit pixels.
void AddSortableSpriteToDraw(SpriteID image, PaletteID pal, int x, int y, int w, int h, int dz, int z, bool transparent=false, int bb_offset_x=0, int bb_offset_y=0, int bb_offset_z=0, const SubSprite *sub=NULL)
Draw a (transparent) sprite at given coordinates with a given bounding box.
bool ScrollMainWindowToTile(TileIndex tile, bool instant=false)
Scrolls the viewport of the main window to a given location.
Types related to windows.
void UpdateViewportPosition(Window *w)
Update the viewport position being displayed.
void UpdateAllVirtCoords()
Update the viewport coordinates of all signs.
Point TranslateXYToTileCoord(const ViewPort *vp, int x, int y, bool clamp_to_map=true)
Translate screen coordinate in a viewport to a tile coordinate.
void MarkTileDirtyByTileOutsideMap(int x, int y)
Mark a (virtual) tile outside the map dirty for repaint.
Types related to viewports.
bool ScrollWindowToTile(TileIndex tile, Window *w, bool instant=false)
Scrolls the viewport in a window to a given location.
Data structure for an opened window.
Types related to stations.
void OffsetGroundSprite(int x, int y)
Called when a foundation has been drawn for the current tile.
void SetTileSelectSize(int w, int h)
Highlight w by h tiles at the cursor.
void MarkAllViewportsDirty(int left, int top, int right, int bottom)
Mark all viewports that display an area as dirty (in need of repaint).
bool DoZoomInOutWindow(ZoomStateChange how, Window *w)
Zooms a viewport in a window in or out.
void InitializeWindowViewport(Window *w, int x, int y, int width, int height, uint32 follow_flags, ZoomLevel zoom)
Initialize viewport of the window for use.
Location information about a sign as seen on the viewport.
void DrawGroundSpriteAt(SpriteID image, PaletteID pal, int32 x, int32 y, int z, const SubSprite *sub=NULL, int extra_offs_x=0, int extra_offs_y=0)
Draws a ground sprite at a specific world-coordinate relative to the current tile.
void AddChildSpriteScreen(SpriteID image, PaletteID pal, int x, int y, bool transparent=false, const SubSprite *sub=NULL, bool scale=true)
Add a child sprite to a parent sprite.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
bool ScrollWindowTo(int x, int y, int z, Window *w, bool instant=false)
Scrolls the viewport in a window to a given location.
static void MaxZoomInOut(ZoomStateChange how, Window *w)
Zoom a viewport as far as possible in the given direction.
void ViewportAddString(const DrawPixelInfo *dpi, ZoomLevel small_from, const ViewportSign *sign, StringID string_normal, StringID string_small, StringID string_small_shadow, uint64 params_1, uint64 params_2=0, Colours colour=INVALID_COLOUR)
Add a string to draw in the viewport.
void MarkTileDirtyByTile(TileIndex tile, int bridge_level_offset=0)
Mark a tile given by its index dirty for repaint.
static const int TILE_HEIGHT_STEP
One Z unit tile height difference is displayed as 50m.
void EndSpriteCombine()
Terminates a block of sprites started by StartSpriteCombine.
ZoomLevel
All zoom levels we know.
void DrawGroundSprite(SpriteID image, PaletteID pal, const SubSprite *sub=NULL, int extra_offs_x=0, int extra_offs_y=0)
Draws a ground sprite for the current tile.
Data structure for viewport, display of a part of the world.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
uint32 TileIndex
The index/ID of a Tile.
bool ScrollMainWindowTo(int x, int y, int z=-1, bool instant=false)
Scrolls the main window to given coordinates.
void SetRedErrorSquare(TileIndex tile)
Set a tile to display a red error square.
void StartSpriteCombine()
Starts a block of sprites, which are "combined" into a single bounding box.
Used to only draw a part of the sprite.
Coordinates of a point in 2D.
ZoomStateChange
Directions of zooming.
ViewPort * IsPtInWindowViewport(const Window *w, int x, int y)
Is a xy position inside the viewport of the window?
Types related to the graphics and/or input devices.