author | peter1138 |
Sun, 03 Aug 2008 17:35:08 +0000 | |
changeset 9834 | 7474149531c1 |
parent 9773 | fd7309d22bc6 |
child 9850 | 61bd42a09ddd |
permissions | -rw-r--r-- |
8123
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
1 |
/* $Id$ */ |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
2 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
3 |
/** @file gfx_func.h Functions related to the gfx engine. */ |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
4 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
5 |
/** |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
6 |
* @defgroup dirty Dirty |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
7 |
* |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
8 |
* Handles the repaint of some part of the screen. |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
9 |
* |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
10 |
* Some places in the code are called functions which makes something "dirty". |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
11 |
* This has nothing to do with making a Tile or Window darker or less visible. |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
12 |
* This term comes from memory caching and is used to define an object must |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
13 |
* be repaint. If some data of an object (like a Tile, Window, Vehicle, whatever) |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
14 |
* are changed which are so extensive the object must be repaint its marked |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
15 |
* as "dirty". The video driver repaint this object instead of the whole screen |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
16 |
* (this is btw. also possible if needed). This is used to avoid a |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
17 |
* flickering of the screen by the video driver constantly repainting it. |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
18 |
* |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
19 |
* This whole mechanism is controlled by an rectangle defined in #_invalid_rect. This |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
20 |
* rectangle defines the area on the screen which must be repaint. If a new object |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
21 |
* needs to be repainted this rectangle is extended to 'catch' the object on the |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
22 |
* screen. At some point (which is normaly uninteressted for patch writers) this |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
23 |
* rectangle is send to the video drivers method |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
24 |
* VideoDriver::MakeDirty and it is truncated back to an empty rectangle. At some |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
25 |
* later point (which is uninteressted, too) the video driver |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
26 |
* repaints all these saved rectangle instead of the whole screen and drop the |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
27 |
* rectangle informations. Then a new round begins by marking objects "dirty". |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
28 |
* |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
29 |
* @see VideoDriver::MakeDirty |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
30 |
* @see _invalid_rect |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
31 |
* @see _screen |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
32 |
*/ |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
33 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
34 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
35 |
#ifndef GFX_FUNC_H |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
36 |
#define GFX_FUNC_H |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
37 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
38 |
#include "gfx_type.h" |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
39 |
#include "strings_type.h" |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
40 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
41 |
void GameLoop(); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
42 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
43 |
void CreateConsole(); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
44 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
45 |
extern byte _dirkeys; ///< 1 = left, 2 = up, 4 = right, 8 = down |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
46 |
extern bool _fullscreen; |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
47 |
extern CursorVars _cursor; |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
48 |
extern bool _ctrl_pressed; ///< Is Ctrl pressed? |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
49 |
extern bool _shift_pressed; ///< Is Shift pressed? |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
50 |
extern byte _fast_forward; |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
51 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
52 |
extern bool _left_button_down; |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
53 |
extern bool _left_button_clicked; |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
54 |
extern bool _right_button_down; |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
55 |
extern bool _right_button_clicked; |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
56 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
57 |
extern DrawPixelInfo _screen; |
8249
90bd3316062f
(svn r11813) -Fix [FS#1602]: Switch _screen to the output buffer and disable usage of 32bpp-anim animation buffer during giant screenshots.
frosch
parents:
8171
diff
changeset
|
58 |
extern bool _screen_disable_anim; ///< Disable palette animation (important for 32bpp-anim blitter during giant screenshot) |
8123
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
59 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
60 |
extern int _pal_first_dirty; |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
61 |
extern int _pal_count_dirty; |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
62 |
extern int _num_resolutions; |
9533
e8b86b70c5f6
(svn r13537) -Fix [FS#2090](r13523): QSortT won't work this way, use Dimension instead of uint16[2] for resolutions
smatz
parents:
9117
diff
changeset
|
63 |
extern Dimension _resolutions[32]; |
e8b86b70c5f6
(svn r13537) -Fix [FS#2090](r13523): QSortT won't work this way, use Dimension instead of uint16[2] for resolutions
smatz
parents:
9117
diff
changeset
|
64 |
extern Dimension _cur_resolution; |
9551
6f60dca6c566
(svn r13571) -Codechange: define channels in struct Colour in different order on LE and BE machines
smatz
parents:
9533
diff
changeset
|
65 |
extern Colour _cur_palette[256]; ///< Current palette. Entry 0 has to be always fully transparent! |
8123
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
66 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
67 |
void HandleKeypress(uint32 key); |
8586
cb0e7e00f1d2
(svn r12167) -Feature(tte): change colour of autorail and autoroad selection when Ctrl is pressed
smatz
parents:
8433
diff
changeset
|
68 |
void HandleCtrlChanged(); |
8123
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
69 |
void HandleMouseEvents(); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
70 |
void CSleep(int milliseconds); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
71 |
void UpdateWindows(); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
72 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
73 |
void DrawMouseCursor(); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
74 |
void ScreenSizeChanged(); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
75 |
void GameSizeChanged(); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
76 |
void UndrawMouseCursor(); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
77 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
78 |
void RedrawScreenRect(int left, int top, int right, int bottom); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
79 |
void GfxScroll(int left, int top, int width, int height, int xo, int yo); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
80 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
81 |
void DrawSprite(SpriteID img, SpriteID pal, int x, int y, const SubSprite *sub = NULL); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
82 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
83 |
int DrawStringCentered(int x, int y, StringID str, uint16 color); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
84 |
int DrawStringCenteredTruncated(int xl, int xr, int y, StringID str, uint16 color); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
85 |
int DoDrawStringCentered(int x, int y, const char *str, uint16 color); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
86 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
87 |
int DrawString(int x, int y, StringID str, uint16 color); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
88 |
int DrawStringTruncated(int x, int y, StringID str, uint16 color, uint maxw); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
89 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
90 |
int DoDrawString(const char *string, int x, int y, uint16 color); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
91 |
int DoDrawStringTruncated(const char *str, int x, int y, uint16 color, uint maxw); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
92 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
93 |
void DrawStringCenterUnderline(int x, int y, StringID str, uint16 color); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
94 |
void DrawStringCenterUnderlineTruncated(int xl, int xr, int y, StringID str, uint16 color); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
95 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
96 |
int DrawStringRightAligned(int x, int y, StringID str, uint16 color); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
97 |
void DrawStringRightAlignedTruncated(int x, int y, StringID str, uint16 color, uint maxw); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
98 |
void DrawStringRightAlignedUnderline(int x, int y, StringID str, uint16 color); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
99 |
|
8737
4405e2e80db6
(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:
8586
diff
changeset
|
100 |
void DrawCharCentered(uint32 c, int x, int y, uint16 color); |
4405e2e80db6
(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:
8586
diff
changeset
|
101 |
|
9607
5a5728fb702a
(svn r13649) -Codechange: Split the GfxFillRect() special flags from 'color' into their own parameter.
frosch
parents:
9551
diff
changeset
|
102 |
void GfxFillRect(int left, int top, int right, int bottom, int color, FillRectMode mode = FILLRECT_OPAQUE); |
8123
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
103 |
void GfxDrawLine(int left, int top, int right, int bottom, int color); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
104 |
void DrawBox(int x, int y, int dx1, int dy1, int dx2, int dy2, int dx3, int dy3); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
105 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
106 |
Dimension GetStringBoundingBox(const char *str); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
107 |
uint32 FormatStringLinebreaks(char *str, int maxw); |
9682
142c31e35bfa
(svn r13787) -Codechange: resize the red error message box if needed
smatz
parents:
9607
diff
changeset
|
108 |
int GetStringHeight(StringID str, int maxw); |
8123
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
109 |
void LoadStringWidthTable(); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
110 |
void DrawStringMultiCenter(int x, int y, StringID str, int maxw); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
111 |
uint DrawStringMultiLine(int x, int y, StringID str, int maxw, int maxh = -1); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
112 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
113 |
/** |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
114 |
* Let the dirty blocks repainting by the video driver. |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
115 |
* |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
116 |
* @ingroup dirty |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
117 |
*/ |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
118 |
void DrawDirtyBlocks(); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
119 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
120 |
/** |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
121 |
* Set a new dirty block. |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
122 |
* |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
123 |
* @ingroup dirty |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
124 |
*/ |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
125 |
void SetDirtyBlocks(int left, int top, int right, int bottom); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
126 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
127 |
/** |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
128 |
* Marks the whole screen as dirty. |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
129 |
* |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
130 |
* @ingroup dirty |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
131 |
*/ |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
132 |
void MarkWholeScreenDirty(); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
133 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
134 |
void GfxInitPalettes(); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
135 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
136 |
bool FillDrawPixelInfo(DrawPixelInfo* n, int left, int top, int width, int height); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
137 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
138 |
/* window.cpp */ |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
139 |
void DrawOverlappedWindowForAll(int left, int top, int right, int bottom); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
140 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
141 |
void SetMouseCursor(SpriteID sprite, SpriteID pal); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
142 |
void SetAnimatedMouseCursor(const AnimCursor *table); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
143 |
void CursorTick(); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
144 |
bool ChangeResInGame(int w, int h); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
145 |
void SortResolutions(int count); |
8171
3fb9d1f8ac3b
(svn r11734) -Change: Allow ToggleFullScreen to return the result of the operation' attempt. Previously, only visual clues were available.
belugas
parents:
8123
diff
changeset
|
146 |
bool ToggleFullScreen(bool fs); |
8123
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
147 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
148 |
/* gfx.cpp */ |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
149 |
#define ASCII_LETTERSTART 32 |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
150 |
extern FontSize _cur_fontsize; |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
151 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
152 |
byte GetCharacterWidth(FontSize size, uint32 key); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
153 |
|
9773
fd7309d22bc6
(svn r13910) -Document: string drawing related functions and types (Alberth)
rubidium
parents:
9682
diff
changeset
|
154 |
/** |
fd7309d22bc6
(svn r13910) -Document: string drawing related functions and types (Alberth)
rubidium
parents:
9682
diff
changeset
|
155 |
* Get height of a character for a given font size. |
fd7309d22bc6
(svn r13910) -Document: string drawing related functions and types (Alberth)
rubidium
parents:
9682
diff
changeset
|
156 |
* @param size Font size to get height of |
fd7309d22bc6
(svn r13910) -Document: string drawing related functions and types (Alberth)
rubidium
parents:
9682
diff
changeset
|
157 |
* @return Height of characters in the given font (pixels) |
fd7309d22bc6
(svn r13910) -Document: string drawing related functions and types (Alberth)
rubidium
parents:
9682
diff
changeset
|
158 |
*/ |
8123
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
159 |
static inline byte GetCharacterHeight(FontSize size) |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
160 |
{ |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
161 |
switch (size) { |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
162 |
default: NOT_REACHED(); |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
163 |
case FS_NORMAL: return 10; |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
164 |
case FS_SMALL: return 6; |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
165 |
case FS_LARGE: return 18; |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
166 |
} |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
167 |
} |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
168 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
169 |
extern DrawPixelInfo *_cur_dpi; |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
170 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
171 |
/** |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
172 |
* All 16 colour gradients |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
173 |
* 8 colours per gradient from darkest (0) to lightest (7) |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
174 |
*/ |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
175 |
extern byte _colour_gradient[16][8]; |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
176 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
177 |
extern bool _use_dos_palette; |
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
178 |
|
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
diff
changeset
|
179 |
#endif /* GFX_FUNC_H */ |