author | truebrain |
Mon, 03 Mar 2008 16:15:24 +0000 | |
branch | noai |
changeset 9810 | a84fc1be9e3b |
parent 9724 | b39bc69bb2f2 |
child 10249 | 58810805030e |
permissions | -rw-r--r-- |
9723 | 1 |
/* $Id$ */ |
2 |
||
3 |
/** @file viewport_func.h Functions related to (drawing on) viewports. */ |
|
4 |
||
5 |
#ifndef VIEWPORT_FUNC_H |
|
6 |
#define VIEWPORT_FUNC_H |
|
7 |
||
8 |
#include "gfx_type.h" |
|
9 |
#include "viewport_type.h" |
|
10 |
#include "vehicle_type.h" |
|
9724
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
11 |
#include "strings_type.h" |
9723 | 12 |
|
13 |
void SetSelectionRed(bool); |
|
14 |
||
15 |
void InitViewports(); |
|
16 |
void DeleteWindowViewport(Window *w); |
|
17 |
void AssignWindowViewport(Window *w, int x, int y, int width, int height, uint32 follow_flags, ZoomLevel zoom); |
|
18 |
ViewPort *IsPtInWindowViewport(const Window *w, int x, int y); |
|
19 |
Point GetTileBelowCursor(); |
|
20 |
void UpdateViewportPosition(Window *w); |
|
21 |
||
22 |
bool DoZoomInOutWindow(int how, Window *w); |
|
23 |
void ZoomInOrOutToCursorWindow(bool in, Window * w); |
|
24 |
Point GetTileZoomCenterWindow(bool in, Window * w); |
|
25 |
void HandleZoomMessage(Window *w, const ViewPort *vp, byte widget_zoom_in, byte widget_zoom_out); |
|
26 |
||
27 |
static inline void MaxZoomInOut(int how, Window *w) |
|
28 |
{ |
|
29 |
while (DoZoomInOutWindow(how, w)) {}; |
|
30 |
} |
|
31 |
||
32 |
void OffsetGroundSprite(int x, int y); |
|
33 |
||
34 |
void DrawGroundSprite(SpriteID image, SpriteID pal, const SubSprite *sub = NULL); |
|
35 |
void DrawGroundSpriteAt(SpriteID image, SpriteID pal, int32 x, int32 y, byte z, const SubSprite *sub = NULL); |
|
36 |
void AddSortableSpriteToDraw(SpriteID image, SpriteID 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); |
|
37 |
void *AddStringToDraw(int x, int y, StringID string, uint64 params_1, uint64 params_2); |
|
38 |
void AddChildSpriteScreen(SpriteID image, SpriteID pal, int x, int y, bool transparent = false, const SubSprite *sub = NULL); |
|
39 |
||
40 |
||
41 |
void StartSpriteCombine(); |
|
42 |
void EndSpriteCombine(); |
|
43 |
||
44 |
void HandleViewportClicked(const ViewPort *vp, int x, int y); |
|
45 |
void PlaceObject(); |
|
46 |
void SetRedErrorSquare(TileIndex tile); |
|
47 |
void SetTileSelectSize(int w, int h); |
|
48 |
void SetTileSelectBigSize(int ox, int oy, int sx, int sy); |
|
49 |
||
50 |
Vehicle *CheckMouseOverVehicle(); |
|
51 |
||
52 |
void VpSelectTilesWithMethod(int x, int y, ViewportPlaceMethod method); |
|
53 |
void VpStartPlaceSizing(TileIndex tile, ViewportPlaceMethod method, byte process); |
|
9724
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
54 |
void VpSetPresizeRange(TileIndex from, TileIndex to); |
9723 | 55 |
void VpSetPlaceSizingLimit(int limit); |
56 |
||
57 |
typedef void PlaceProc(TileIndex tile); |
|
58 |
void PlaceProc_DemolishArea(TileIndex tile); |
|
59 |
void PlaceProc_LevelLand(TileIndex tile); |
|
60 |
void PlaceProc_BuyLand(TileIndex tile); |
|
61 |
bool GUIPlaceProcDragXY(const WindowEvent *e); |
|
62 |
||
63 |
/* common button handler */ |
|
64 |
bool HandlePlacePushButton(Window *w, int widget, CursorID cursor, ViewportHighlightMode mode, PlaceProc *placeproc); |
|
65 |
||
66 |
void ViewportDoDraw(const ViewPort *vp, int left, int top, int right, int bottom); |
|
67 |
||
68 |
void SetObjectToPlaceWnd(CursorID icon, SpriteID pal, ViewportHighlightMode mode, Window *w); |
|
69 |
void SetObjectToPlace(CursorID icon, SpriteID pal, ViewportHighlightMode mode, WindowClass window_class, WindowNumber window_num); |
|
70 |
||
71 |
void ResetObjectToPlace(); |
|
72 |
||
73 |
bool ScrollWindowTo(int x, int y, Window *w, bool instant = false); |
|
74 |
||
75 |
bool ScrollMainWindowToTile(TileIndex tile, bool instant = false); |
|
76 |
bool ScrollMainWindowTo(int x, int y, bool instant = false); |
|
77 |
||
78 |
extern PlaceProc *_place_proc; |
|
79 |
extern Point _tile_fract_coords; |
|
80 |
extern TileHighlightData _thd; |
|
81 |
||
82 |
#endif /* VIEWPORT_FUNC_H */ |