author | rubidium |
Wed, 07 May 2008 21:45:27 +0000 | |
changeset 10457 | ea18877d8eba |
parent 10435 | 0e2b98df9707 |
child 10983 | e734f891d1f6 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
8619
c2434269c3eb
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
8617
diff
changeset
|
3 |
/** @file gfx_func.h Functions related to the gfx engine. */ |
6505
abcb0580d976
(svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6472
diff
changeset
|
4 |
|
8041
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
5 |
/** |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
6 |
* @defgroup dirty Dirty |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
7 |
* |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
8 |
* Handles the repaint of some part of the screen. |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
9 |
* |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
10 |
* Some places in the code are called functions which makes something "dirty". |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
11 |
* This has nothing to do with making a Tile or Window darker or less visible. |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
12 |
* This term comes from memory caching and is used to define an object must |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
13 |
* be repaint. If some data of an object (like a Tile, Window, Vehicle, whatever) |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
14 |
* are changed which are so extensive the object must be repaint its marked |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
15 |
* as "dirty". The video driver repaint this object instead of the whole screen |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
16 |
* (this is btw. also possible if needed). This is used to avoid a |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
17 |
* flickering of the screen by the video driver constantly repainting it. |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
18 |
* |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
19 |
* This whole mechanism is controlled by an rectangle defined in #_invalid_rect. This |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
20 |
* rectangle defines the area on the screen which must be repaint. If a new object |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
21 |
* needs to be repainted this rectangle is extended to 'catch' the object on the |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
22 |
* screen. At some point (which is normaly uninteressted for patch writers) this |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
23 |
* rectangle is send to the video drivers method |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
24 |
* VideoDriver::MakeDirty and it is truncated back to an empty rectangle. At some |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
25 |
* later point (which is uninteressted, too) the video driver |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
26 |
* repaints all these saved rectangle instead of the whole screen and drop the |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
27 |
* rectangle informations. Then a new round begins by marking objects "dirty". |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
28 |
* |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
29 |
* @see VideoDriver::MakeDirty |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
30 |
* @see _invalid_rect |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
31 |
* @see _screen |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
32 |
*/ |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
33 |
|
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
34 |
|
8619
c2434269c3eb
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
8617
diff
changeset
|
35 |
#ifndef GFX_FUNC_H |
c2434269c3eb
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
8617
diff
changeset
|
36 |
#define GFX_FUNC_H |
5887
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
37 |
|
8619
c2434269c3eb
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
8617
diff
changeset
|
38 |
#include "gfx_type.h" |
c2434269c3eb
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
8617
diff
changeset
|
39 |
#include "strings_type.h" |
5887
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
40 |
|
6573 | 41 |
void GameLoop(); |
5887
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
42 |
|
6573 | 43 |
void CreateConsole(); |
5887
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
44 |
|
6505
abcb0580d976
(svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6472
diff
changeset
|
45 |
extern byte _dirkeys; ///< 1 = left, 2 = up, 4 = right, 8 = down |
5887
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
46 |
extern bool _fullscreen; |
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
47 |
extern CursorVars _cursor; |
6505
abcb0580d976
(svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6472
diff
changeset
|
48 |
extern bool _ctrl_pressed; ///< Is Ctrl pressed? |
abcb0580d976
(svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6472
diff
changeset
|
49 |
extern bool _shift_pressed; ///< Is Shift pressed? |
5887
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
50 |
extern byte _fast_forward; |
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
51 |
|
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
52 |
extern bool _left_button_down; |
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
53 |
extern bool _left_button_clicked; |
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
54 |
extern bool _right_button_down; |
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
55 |
extern bool _right_button_clicked; |
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
56 |
|
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
57 |
extern DrawPixelInfo _screen; |
8745
0c897b4e651e
(svn r11813) -Fix [FS#1602]: Switch _screen to the output buffer and disable usage of 32bpp-anim animation buffer during giant screenshots.
frosch
parents:
8667
diff
changeset
|
58 |
extern bool _screen_disable_anim; ///< Disable palette animation (important for 32bpp-anim blitter during giant screenshot) |
5887
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
59 |
|
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
60 |
extern int _pal_first_dirty; |
7456
0c0636370335
(svn r10216) -Fix: palette animation always redid all palette entries, where in fact only a few indexes were needed
truelight
parents:
7433
diff
changeset
|
61 |
extern int _pal_count_dirty; |
5887
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
62 |
extern int _num_resolutions; |
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
63 |
extern uint16 _resolutions[32][2]; |
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
64 |
extern uint16 _cur_resolution[2]; |
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
65 |
extern Colour _cur_palette[256]; |
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
66 |
|
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
67 |
void HandleKeypress(uint32 key); |
9082
8217cb013e23
(svn r12167) -Feature(tte): change colour of autorail and autoroad selection when Ctrl is pressed
smatz
parents:
8929
diff
changeset
|
68 |
void HandleCtrlChanged(); |
6573 | 69 |
void HandleMouseEvents(); |
5887
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
70 |
void CSleep(int milliseconds); |
6573 | 71 |
void UpdateWindows(); |
5887
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
72 |
|
6573 | 73 |
void DrawMouseCursor(); |
74 |
void ScreenSizeChanged(); |
|
75 |
void GameSizeChanged(); |
|
76 |
void UndrawMouseCursor(); |
|
5887
063ca43b682c
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5838
diff
changeset
|
77 |
|
0 | 78 |
void RedrawScreenRect(int left, int top, int right, int bottom); |
79 |
void GfxScroll(int left, int top, int width, int height, int xo, int yo); |
|
2097
82b1e11883fd
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
80 |
|
8177
f0bcc8e149f3
(svn r11212) -Codechange: add support for drawing parts of sprites. Patch by frosch.
rubidium
parents:
8139
diff
changeset
|
81 |
void DrawSprite(SpriteID img, SpriteID pal, int x, int y, const SubSprite *sub = NULL); |
2406
be5cfb8cd20d
(svn r2932) Give the strings consisting of an up/a down arrow symbolic names
tron
parents:
2187
diff
changeset
|
82 |
|
2097
82b1e11883fd
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
83 |
int DrawStringCentered(int x, int y, StringID str, uint16 color); |
2113
f228b399da01
(svn r2623) - CodeChange: rework DrawStringCenteredTruncated() a bit. Instead of giving center + width you give the coordinates of the bounding box (left, right) it has to fit in (ludde)
Darkvater
parents:
2097
diff
changeset
|
84 |
int DrawStringCenteredTruncated(int xl, int xr, int y, StringID str, uint16 color); |
2134 | 85 |
int DoDrawStringCentered(int x, int y, const char *str, uint16 color); |
2097
82b1e11883fd
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
86 |
|
82b1e11883fd
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
87 |
int DrawString(int x, int y, StringID str, uint16 color); |
82b1e11883fd
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
88 |
int DrawStringTruncated(int x, int y, StringID str, uint16 color, uint maxw); |
82b1e11883fd
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
89 |
|
1323
41397685320a
(svn r1827) Next iteration of the byte -> char transition: some string drawing functions and buffers
tron
parents:
1093
diff
changeset
|
90 |
int DoDrawString(const char *string, int x, int y, uint16 color); |
2097
82b1e11883fd
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
91 |
int DoDrawStringTruncated(const char *str, int x, int y, uint16 color, uint maxw); |
82b1e11883fd
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
92 |
|
82b1e11883fd
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
93 |
void DrawStringCenterUnderline(int x, int y, StringID str, uint16 color); |
2113
f228b399da01
(svn r2623) - CodeChange: rework DrawStringCenteredTruncated() a bit. Instead of giving center + width you give the coordinates of the bounding box (left, right) it has to fit in (ludde)
Darkvater
parents:
2097
diff
changeset
|
94 |
void DrawStringCenterUnderlineTruncated(int xl, int xr, int y, StringID str, uint16 color); |
2097
82b1e11883fd
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
95 |
|
4314
c7ded7546e7f
(svn r5967) -Change: use right alignment for the year in the player's balance window instead of centering (about) 'string width' / 2 from the right edge
rubidium
parents:
3798
diff
changeset
|
96 |
int DrawStringRightAligned(int x, int y, StringID str, uint16 color); |
2097
82b1e11883fd
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
97 |
void DrawStringRightAlignedTruncated(int x, int y, StringID str, uint16 color, uint maxw); |
4314
c7ded7546e7f
(svn r5967) -Change: use right alignment for the year in the player's balance window instead of centering (about) 'string width' / 2 from the right edge
rubidium
parents:
3798
diff
changeset
|
98 |
void DrawStringRightAlignedUnderline(int x, int y, StringID str, uint16 color); |
2097
82b1e11883fd
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
99 |
|
9233
4daa9bb8dbf7
(svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium
parents:
9082
diff
changeset
|
100 |
void DrawCharCentered(uint32 c, int x, int y, uint16 color); |
4daa9bb8dbf7
(svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium
parents:
9082
diff
changeset
|
101 |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
0
diff
changeset
|
102 |
void GfxFillRect(int left, int top, int right, int bottom, int color); |
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
0
diff
changeset
|
103 |
void GfxDrawLine(int left, int top, int right, int bottom, int color); |
8139
16ad832aa538
(svn r11174) -Codechange: add possibility to show the bounding boxes of sprites using CTRL-B so one can get a better understanding of the used bounding boxes to fix the glitches that still exist. Patch by frosch.
rubidium
parents:
8041
diff
changeset
|
104 |
void DrawBox(int x, int y, int dx1, int dy1, int dx2, int dy2, int dx3, int dy3); |
0 | 105 |
|
8617
931e0970d509
(svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents:
8609
diff
changeset
|
106 |
Dimension GetStringBoundingBox(const char *str); |
4954
d773d01b35f5
(svn r6953) -Codechange: Change FormatStringLinebreaks in such a way that if no whitespace was seen
Darkvater
parents:
4928
diff
changeset
|
107 |
uint32 FormatStringLinebreaks(char *str, int maxw); |
6573 | 108 |
void LoadStringWidthTable(); |
2634
16334e1a4862
(svn r3176) Use proper types, not some variants of int
tron
parents:
2548
diff
changeset
|
109 |
void DrawStringMultiCenter(int x, int y, StringID str, int maxw); |
6703
9ddfcb1849e4
(svn r9449) -Fix: Truncate the newgrf information text in the newgrf gui if it's too long.
maedhros
parents:
6615
diff
changeset
|
110 |
uint DrawStringMultiLine(int x, int y, StringID str, int maxw, int maxh = -1); |
8041
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
111 |
|
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
112 |
/** |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
113 |
* Let the dirty blocks repainting by the video driver. |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
114 |
* |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
115 |
* @ingroup dirty |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
116 |
*/ |
6573 | 117 |
void DrawDirtyBlocks(); |
8041
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
118 |
|
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
119 |
/** |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
120 |
* Set a new dirty block. |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
121 |
* |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
122 |
* @ingroup dirty |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
123 |
*/ |
0 | 124 |
void SetDirtyBlocks(int left, int top, int right, int bottom); |
8041
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
125 |
|
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
126 |
/** |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
127 |
* Marks the whole screen as dirty. |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
128 |
* |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
129 |
* @ingroup dirty |
63e760418a15
(svn r11065) -Documentation [FS#1186]: of the dirty marking/repainting subsystem. Patch by Progman.
rubidium
parents:
8037
diff
changeset
|
130 |
*/ |
6573 | 131 |
void MarkWholeScreenDirty(); |
0 | 132 |
|
6573 | 133 |
void GfxInitPalettes(); |
0 | 134 |
|
4429
1bb01569940c
(svn r6184) Remove the unused (because it was NULL in all callers) second parameter of FillDrawPixelInfo() and simplify some expressions
tron
parents:
4428
diff
changeset
|
135 |
bool FillDrawPixelInfo(DrawPixelInfo* n, int left, int top, int width, int height); |
0 | 136 |
|
6505
abcb0580d976
(svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6472
diff
changeset
|
137 |
/* window.cpp */ |
0 | 138 |
void DrawOverlappedWindowForAll(int left, int top, int right, int bottom); |
139 |
||
5919
2b58160d667d
(svn r8128) -Codechange: Split sprite and palette remap into separate 32 bit values.
peter1138
parents:
5887
diff
changeset
|
140 |
void SetMouseCursor(SpriteID sprite, SpriteID pal); |
6464
1c3515433409
(svn r8880) -Codechange: make anim cursors an array of structs.
rubidium
parents:
6192
diff
changeset
|
141 |
void SetAnimatedMouseCursor(const AnimCursor *table); |
6573 | 142 |
void CursorTick(); |
0 | 143 |
bool ChangeResInGame(int w, int h); |
1806
75dc9c737892
(svn r2310) - Fix: Game would crash if you full-screened with the 'fullscreen' button than chose a resolution from the dropdown box that was no longer valid. Big thanks to DaleStan for track down the crashing bug.
Darkvater
parents:
1391
diff
changeset
|
144 |
void SortResolutions(int count); |
8667
c916a5375166
(svn r11734) -Change: Allow ToggleFullScreen to return the result of the operation' attempt. Previously, only visual clues were available.
belugas
parents:
8619
diff
changeset
|
145 |
bool ToggleFullScreen(bool fs); |
0 | 146 |
|
6505
abcb0580d976
(svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents:
6472
diff
changeset
|
147 |
/* gfx.cpp */ |
1390
53a5713cf3f9
(svn r1894) - Codechange: cleaned up the console a bit, wholly unified handling of text with that of editboxes
Darkvater
parents:
1350
diff
changeset
|
148 |
#define ASCII_LETTERSTART 32 |
3798
37a2090eac94
(svn r4802) - Codechange: replace _stringwidth_base and associated magic numbers with a FontSize enum, using the numbers (which are SpriteIDs) in only the places needed.
peter1138
parents:
3312
diff
changeset
|
149 |
extern FontSize _cur_fontsize; |
37a2090eac94
(svn r4802) - Codechange: replace _stringwidth_base and associated magic numbers with a FontSize enum, using the numbers (which are SpriteIDs) in only the places needed.
peter1138
parents:
3312
diff
changeset
|
150 |
|
5108
dc67d70b5a45
(svn r7182) -Feature: Merge utf8 branch. This brings us support for Unicode/UTF-8 and the option for fonts rendered by FreeType. Language changes to come.
peter1138
parents:
4954
diff
changeset
|
151 |
byte GetCharacterWidth(FontSize size, uint32 key); |
3798
37a2090eac94
(svn r4802) - Codechange: replace _stringwidth_base and associated magic numbers with a FontSize enum, using the numbers (which are SpriteIDs) in only the places needed.
peter1138
parents:
3312
diff
changeset
|
152 |
|
37a2090eac94
(svn r4802) - Codechange: replace _stringwidth_base and associated magic numbers with a FontSize enum, using the numbers (which are SpriteIDs) in only the places needed.
peter1138
parents:
3312
diff
changeset
|
153 |
static inline byte GetCharacterHeight(FontSize size) |
37a2090eac94
(svn r4802) - Codechange: replace _stringwidth_base and associated magic numbers with a FontSize enum, using the numbers (which are SpriteIDs) in only the places needed.
peter1138
parents:
3312
diff
changeset
|
154 |
{ |
37a2090eac94
(svn r4802) - Codechange: replace _stringwidth_base and associated magic numbers with a FontSize enum, using the numbers (which are SpriteIDs) in only the places needed.
peter1138
parents:
3312
diff
changeset
|
155 |
switch (size) { |
37a2090eac94
(svn r4802) - Codechange: replace _stringwidth_base and associated magic numbers with a FontSize enum, using the numbers (which are SpriteIDs) in only the places needed.
peter1138
parents:
3312
diff
changeset
|
156 |
default: NOT_REACHED(); |
37a2090eac94
(svn r4802) - Codechange: replace _stringwidth_base and associated magic numbers with a FontSize enum, using the numbers (which are SpriteIDs) in only the places needed.
peter1138
parents:
3312
diff
changeset
|
157 |
case FS_NORMAL: return 10; |
37a2090eac94
(svn r4802) - Codechange: replace _stringwidth_base and associated magic numbers with a FontSize enum, using the numbers (which are SpriteIDs) in only the places needed.
peter1138
parents:
3312
diff
changeset
|
158 |
case FS_SMALL: return 6; |
37a2090eac94
(svn r4802) - Codechange: replace _stringwidth_base and associated magic numbers with a FontSize enum, using the numbers (which are SpriteIDs) in only the places needed.
peter1138
parents:
3312
diff
changeset
|
159 |
case FS_LARGE: return 18; |
37a2090eac94
(svn r4802) - Codechange: replace _stringwidth_base and associated magic numbers with a FontSize enum, using the numbers (which are SpriteIDs) in only the places needed.
peter1138
parents:
3312
diff
changeset
|
160 |
} |
1391
1325047def14
(svn r1895) - Fix: add assert for charwidth getter just in case
Darkvater
parents:
1390
diff
changeset
|
161 |
} |
0 | 162 |
|
8619
c2434269c3eb
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
8617
diff
changeset
|
163 |
extern DrawPixelInfo *_cur_dpi; |
8320
6ffad7a5d242
(svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.
belugas
parents:
8177
diff
changeset
|
164 |
|
4444
9c9c7f962482
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
165 |
/** |
9c9c7f962482
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
166 |
* All 16 colour gradients |
9c9c7f962482
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
167 |
* 8 colours per gradient from darkest (0) to lightest (7) |
9c9c7f962482
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
168 |
*/ |
8619
c2434269c3eb
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
8617
diff
changeset
|
169 |
extern byte _colour_gradient[16][8]; |
614
e016770cb781
(svn r1038) Feature: OpenTTD runs with the grf files of the DOS version
dominik
parents:
543
diff
changeset
|
170 |
|
8619
c2434269c3eb
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
8617
diff
changeset
|
171 |
extern bool _use_dos_palette; |
657
40a9032b454b
(svn r1091) Fix: Finally station names use 100% the correct color in transparent mode
dominik
parents:
614
diff
changeset
|
172 |
|
8619
c2434269c3eb
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
8617
diff
changeset
|
173 |
#endif /* GFX_FUNC_H */ |