2 |
2 |
3 /** @file viewport.h */ |
3 /** @file viewport.h */ |
4 |
4 |
5 #ifndef VIEWPORT_H |
5 #ifndef VIEWPORT_H |
6 #define VIEWPORT_H |
6 #define VIEWPORT_H |
|
7 |
|
8 #include "zoom.hpp" |
7 |
9 |
8 struct ViewPort { |
10 struct ViewPort { |
9 int left,top; // screen coordinates for the viewport |
11 int left,top; // screen coordinates for the viewport |
10 int width, height; // screen width/height for the viewport |
12 int width, height; // screen width/height for the viewport |
11 |
13 |
12 int virtual_left, virtual_top; // virtual coordinates |
14 int virtual_left, virtual_top; // virtual coordinates |
13 int virtual_width, virtual_height; // these are just width << zoom, height << zoom |
15 int virtual_width, virtual_height; // these are just width << zoom, height << zoom |
14 |
16 |
15 byte zoom; |
17 ZoomLevel zoom; |
16 }; |
18 }; |
17 |
19 |
18 void SetSelectionRed(bool); |
20 void SetSelectionRed(bool); |
19 |
21 |
20 /* viewport.cpp */ |
22 /* viewport.cpp */ |
21 void InitViewports(); |
23 void InitViewports(); |
22 void DeleteWindowViewport(Window *w); |
24 void DeleteWindowViewport(Window *w); |
23 void AssignWindowViewport(Window *w, int x, int y, |
25 void AssignWindowViewport(Window *w, int x, int y, |
24 int width, int height, uint32 follow_flags, byte zoom); |
26 int width, int height, uint32 follow_flags, ZoomLevel zoom); |
25 ViewPort *IsPtInWindowViewport(const Window *w, int x, int y); |
27 ViewPort *IsPtInWindowViewport(const Window *w, int x, int y); |
26 Point GetTileBelowCursor(); |
28 Point GetTileBelowCursor(); |
27 void UpdateViewportPosition(Window *w); |
29 void UpdateViewportPosition(Window *w); |
28 |
30 |
29 enum { |
31 enum { |
58 void PlaceObject(); |
60 void PlaceObject(); |
59 void SetRedErrorSquare(TileIndex tile); |
61 void SetRedErrorSquare(TileIndex tile); |
60 void SetTileSelectSize(int w, int h); |
62 void SetTileSelectSize(int w, int h); |
61 void SetTileSelectBigSize(int ox, int oy, int sx, int sy); |
63 void SetTileSelectBigSize(int ox, int oy, int sx, int sy); |
62 |
64 |
63 void VpStartPlaceSizing(TileIndex tile, int user); |
65 void VpStartPlaceSizing(TileIndex tile, byte method, byte process); |
64 void VpSetPresizeRange(uint from, uint to); |
66 void VpSetPresizeRange(uint from, uint to); |
65 void VpSetPlaceSizingLimit(int limit); |
67 void VpSetPlaceSizingLimit(int limit); |
66 |
68 |
67 Vehicle *CheckMouseOverVehicle(); |
69 Vehicle *CheckMouseOverVehicle(); |
68 |
70 |