author | rubidium |
Thu, 01 Feb 2007 15:49:12 +0000 | |
changeset 5893 | 7e431a4abebb |
parent 5668 | 36b39f4a9032 |
child 5941 | adaea39e84ab |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
0 | 3 |
#ifndef GFX_H |
4 |
#define GFX_H |
|
5 |
||
5636
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
6 |
/* !!! Note that the first part of this file if enclosed in extern "C" due to cocoa/obj-C !!! */ |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
7 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
8 |
#ifdef __cplusplus |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
9 |
extern "C" { |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
10 |
#endif /* __cplusplus */ |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
11 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
12 |
enum WindowKeyCodes { |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
13 |
WKC_SHIFT = 0x8000, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
14 |
WKC_CTRL = 0x4000, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
15 |
WKC_ALT = 0x2000, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
16 |
WKC_META = 0x1000, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
17 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
18 |
// Special ones |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
19 |
WKC_NONE = 0, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
20 |
WKC_ESC = 1, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
21 |
WKC_BACKSPACE = 2, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
22 |
WKC_INSERT = 3, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
23 |
WKC_DELETE = 4, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
24 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
25 |
WKC_PAGEUP = 5, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
26 |
WKC_PAGEDOWN = 6, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
27 |
WKC_END = 7, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
28 |
WKC_HOME = 8, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
29 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
30 |
// Arrow keys |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
31 |
WKC_LEFT = 9, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
32 |
WKC_UP = 10, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
33 |
WKC_RIGHT = 11, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
34 |
WKC_DOWN = 12, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
35 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
36 |
// Return & tab |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
37 |
WKC_RETURN = 13, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
38 |
WKC_TAB = 14, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
39 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
40 |
// Numerical keyboard |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
41 |
WKC_NUM_0 = 16, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
42 |
WKC_NUM_1 = 17, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
43 |
WKC_NUM_2 = 18, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
44 |
WKC_NUM_3 = 19, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
45 |
WKC_NUM_4 = 20, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
46 |
WKC_NUM_5 = 21, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
47 |
WKC_NUM_6 = 22, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
48 |
WKC_NUM_7 = 23, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
49 |
WKC_NUM_8 = 24, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
50 |
WKC_NUM_9 = 25, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
51 |
WKC_NUM_DIV = 26, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
52 |
WKC_NUM_MUL = 27, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
53 |
WKC_NUM_MINUS = 28, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
54 |
WKC_NUM_PLUS = 29, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
55 |
WKC_NUM_ENTER = 30, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
56 |
WKC_NUM_DECIMAL = 31, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
57 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
58 |
// Space |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
59 |
WKC_SPACE = 32, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
60 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
61 |
// Function keys |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
62 |
WKC_F1 = 33, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
63 |
WKC_F2 = 34, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
64 |
WKC_F3 = 35, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
65 |
WKC_F4 = 36, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
66 |
WKC_F5 = 37, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
67 |
WKC_F6 = 38, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
68 |
WKC_F7 = 39, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
69 |
WKC_F8 = 40, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
70 |
WKC_F9 = 41, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
71 |
WKC_F10 = 42, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
72 |
WKC_F11 = 43, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
73 |
WKC_F12 = 44, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
74 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
75 |
// backquote is the key left of "1" |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
76 |
// we only store this key here, no matter what character is really mapped to it |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
77 |
// on a particular keyboard. (US keyboard: ` and ~ ; German keyboard: ^ and °) |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
78 |
WKC_BACKQUOTE = 45, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
79 |
WKC_PAUSE = 46, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
80 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
81 |
// 0-9 are mapped to 48-57 |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
82 |
// A-Z are mapped to 65-90 |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
83 |
// a-z are mapped to 97-122 |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
84 |
}; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
85 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
86 |
enum GameModes { |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
87 |
GM_MENU, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
88 |
GM_NORMAL, |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
89 |
GM_EDITOR |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
90 |
}; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
91 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
92 |
void GameLoop(void); |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
93 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
94 |
void CreateConsole(void); |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
95 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
96 |
typedef int32 CursorID; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
97 |
typedef byte Pixel; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
98 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
99 |
typedef struct Point { |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
100 |
int x,y; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
101 |
} Point; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
102 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
103 |
typedef struct Rect { |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
104 |
int left,top,right,bottom; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
105 |
} Rect; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
106 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
107 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
108 |
typedef struct CursorVars { |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
109 |
Point pos, size, offs, delta; ///< position, size, offset from top-left, and movement |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
110 |
Point draw_pos, draw_size; ///< position and size bounding-box for drawing |
5668
36b39f4a9032
(svn r8128) -Codechange: Split sprite and palette remap into separate 32 bit values.
peter1138
parents:
5636
diff
changeset
|
111 |
SpriteID sprite; ///< current image of cursor |
36b39f4a9032
(svn r8128) -Codechange: Split sprite and palette remap into separate 32 bit values.
peter1138
parents:
5636
diff
changeset
|
112 |
SpriteID pal; |
5636
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
113 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
114 |
int wheel; ///< mouse wheel movement |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
115 |
const CursorID *animate_list, *animate_cur; ///< in case of animated cursor, list of frames |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
116 |
uint animate_timeout; ///< current frame in list of animated cursor |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
117 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
118 |
bool visible; ///< cursor is visible |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
119 |
bool dirty; ///< the rect occupied by the mouse is dirty (redraw) |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
120 |
bool fix_at; ///< mouse is moving, but cursor is not (used for scrolling) |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
121 |
bool in_window; ///< mouse inside this window, determines drawing logic |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
122 |
} CursorVars; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
123 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
124 |
typedef struct DrawPixelInfo { |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
125 |
Pixel *dst_ptr; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
126 |
int left, top, width, height; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
127 |
int pitch; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
128 |
uint16 zoom; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
129 |
} DrawPixelInfo; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
130 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
131 |
typedef struct Colour { |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
132 |
byte r; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
133 |
byte g; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
134 |
byte b; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
135 |
} Colour; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
136 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
137 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
138 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
139 |
extern byte _dirkeys; // 1 = left, 2 = up, 4 = right, 8 = down |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
140 |
extern bool _fullscreen; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
141 |
extern CursorVars _cursor; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
142 |
extern bool _ctrl_pressed; // Is Ctrl pressed? |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
143 |
extern bool _shift_pressed; // Is Shift pressed? |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
144 |
extern byte _fast_forward; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
145 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
146 |
extern bool _left_button_down; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
147 |
extern bool _left_button_clicked; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
148 |
extern bool _right_button_down; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
149 |
extern bool _right_button_clicked; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
150 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
151 |
extern DrawPixelInfo _screen; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
152 |
extern bool _exit_game; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
153 |
extern bool _networking; ///< are we in networking mode? |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
154 |
extern byte _game_mode; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
155 |
extern byte _pause; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
156 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
157 |
extern int _pal_first_dirty; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
158 |
extern int _pal_last_dirty; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
159 |
extern int _num_resolutions; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
160 |
extern uint16 _resolutions[32][2]; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
161 |
extern uint16 _cur_resolution[2]; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
162 |
extern Colour _cur_palette[256]; |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
163 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
164 |
void HandleKeypress(uint32 key); |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
165 |
void HandleMouseEvents(void); |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
166 |
void CSleep(int milliseconds); |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
167 |
void UpdateWindows(void); |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
168 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
169 |
uint32 InteractiveRandom(void); /* Used for random sequences that are not the same on the other end of the multiplayer link */ |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
170 |
uint InteractiveRandomRange(uint max); |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
171 |
void DrawTextMessage(void); |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
172 |
void DrawMouseCursor(void); |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
173 |
void ScreenSizeChanged(void); |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
174 |
void HandleExitGameRequest(void); |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
175 |
void GameSizeChanged(void); |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
176 |
void UndrawMouseCursor(void); |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
177 |
|
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
178 |
#ifdef __cplusplus |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
179 |
}; //extern "C" |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
180 |
/* Following part is only for C++ */ |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
181 |
|
5587
167d9a91ef02
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5475
diff
changeset
|
182 |
#include "helpers.hpp" |
0 | 183 |
|
3798
b1f5290b36b1
(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
|
184 |
typedef enum FontSizes { |
b1f5290b36b1
(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
|
185 |
FS_NORMAL, |
b1f5290b36b1
(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
|
186 |
FS_SMALL, |
b1f5290b36b1
(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
|
187 |
FS_LARGE, |
b1f5290b36b1
(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
|
188 |
FS_END, |
b1f5290b36b1
(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
|
189 |
} FontSize; |
b1f5290b36b1
(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
|
190 |
|
5587
167d9a91ef02
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5475
diff
changeset
|
191 |
DECLARE_POSTFIX_INCREMENT(FontSize); |
3798
b1f5290b36b1
(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
|
192 |
|
0 | 193 |
void RedrawScreenRect(int left, int top, int right, int bottom); |
194 |
void GfxScroll(int left, int top, int width, int height, int xo, int yo); |
|
2097
e95d19e1941f
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
195 |
|
2406
8c873205483a
(svn r2932) Give the strings consisting of an up/a down arrow symbolic names
tron
parents:
2187
diff
changeset
|
196 |
|
8c873205483a
(svn r2932) Give the strings consisting of an up/a down arrow symbolic names
tron
parents:
2187
diff
changeset
|
197 |
// XXX doesn't really belong here, but the only |
8c873205483a
(svn r2932) Give the strings consisting of an up/a down arrow symbolic names
tron
parents:
2187
diff
changeset
|
198 |
// consumers always use it in conjunction with DoDrawString() |
5108
aeaef6fe53b7
(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
|
199 |
#define UPARROW "\xEE\x8A\x80" |
aeaef6fe53b7
(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
|
200 |
#define DOWNARROW "\xEE\x8A\xAA" |
2406
8c873205483a
(svn r2932) Give the strings consisting of an up/a down arrow symbolic names
tron
parents:
2187
diff
changeset
|
201 |
|
8c873205483a
(svn r2932) Give the strings consisting of an up/a down arrow symbolic names
tron
parents:
2187
diff
changeset
|
202 |
|
2097
e95d19e1941f
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
203 |
int DrawStringCentered(int x, int y, StringID str, uint16 color); |
2113
be2f07df0dfa
(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
|
204 |
int DrawStringCenteredTruncated(int xl, int xr, int y, StringID str, uint16 color); |
2134 | 205 |
int DoDrawStringCentered(int x, int y, const char *str, uint16 color); |
2097
e95d19e1941f
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
206 |
|
e95d19e1941f
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
207 |
int DrawString(int x, int y, StringID str, uint16 color); |
e95d19e1941f
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
208 |
int DrawStringTruncated(int x, int y, StringID str, uint16 color, uint maxw); |
e95d19e1941f
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
209 |
|
1323
bac2e38e8b60
(svn r1827) Next iteration of the byte -> char transition: some string drawing functions and buffers
tron
parents:
1093
diff
changeset
|
210 |
int DoDrawString(const char *string, int x, int y, uint16 color); |
2097
e95d19e1941f
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
211 |
int DoDrawStringTruncated(const char *str, int x, int y, uint16 color, uint maxw); |
e95d19e1941f
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
212 |
|
e95d19e1941f
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
213 |
void DrawStringCenterUnderline(int x, int y, StringID str, uint16 color); |
2113
be2f07df0dfa
(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
|
214 |
void DrawStringCenterUnderlineTruncated(int xl, int xr, int y, StringID str, uint16 color); |
2097
e95d19e1941f
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
215 |
|
4314
5c816195d9d4
(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
|
216 |
int DrawStringRightAligned(int x, int y, StringID str, uint16 color); |
2097
e95d19e1941f
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
217 |
void DrawStringRightAlignedTruncated(int x, int y, StringID str, uint16 color, uint maxw); |
4314
5c816195d9d4
(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
|
218 |
void DrawStringRightAlignedUnderline(int x, int y, StringID str, uint16 color); |
2097
e95d19e1941f
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Darkvater
parents:
2062
diff
changeset
|
219 |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
0
diff
changeset
|
220 |
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
|
221 |
void GfxDrawLine(int left, int top, int right, int bottom, int color); |
0 | 222 |
|
4609
954fe701062f
(svn r6462) -Codechange: Have GetStringWidth() return width as well as the height bounding
Darkvater
parents:
4444
diff
changeset
|
223 |
BoundingRect GetStringBoundingBox(const char *str); |
4954
c1f059faa899
(svn r6953) -Codechange: Change FormatStringLinebreaks in such a way that if no whitespace was seen
Darkvater
parents:
4928
diff
changeset
|
224 |
uint32 FormatStringLinebreaks(char *str, int maxw); |
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
657
diff
changeset
|
225 |
void LoadStringWidthTable(void); |
2634
0df9396b0067
(svn r3176) Use proper types, not some variants of int
tron
parents:
2548
diff
changeset
|
226 |
void DrawStringMultiCenter(int x, int y, StringID str, int maxw); |
4928
ff53f78c5a87
(svn r6908) - Codechange: Modify DrawStringMultiLine() to return the number of pixel lines used, and use it for drawing NewGRF additional text (mart3p)
peter1138
parents:
4609
diff
changeset
|
227 |
uint DrawStringMultiLine(int x, int y, StringID str, int maxw); |
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
657
diff
changeset
|
228 |
void DrawDirtyBlocks(void); |
0 | 229 |
void SetDirtyBlocks(int left, int top, int right, int bottom); |
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
657
diff
changeset
|
230 |
void MarkWholeScreenDirty(void); |
0 | 231 |
|
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
657
diff
changeset
|
232 |
void GfxInitPalettes(void); |
0 | 233 |
|
4429
b4eb6d97996f
(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
|
234 |
bool FillDrawPixelInfo(DrawPixelInfo* n, int left, int top, int width, int height); |
0 | 235 |
|
236 |
/* window.c */ |
|
237 |
void DrawOverlappedWindowForAll(int left, int top, int right, int bottom); |
|
238 |
||
5587
167d9a91ef02
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5475
diff
changeset
|
239 |
void SetMouseCursor(CursorID cursor); |
5668
36b39f4a9032
(svn r8128) -Codechange: Split sprite and palette remap into separate 32 bit values.
peter1138
parents:
5636
diff
changeset
|
240 |
void SetMouseCursor(SpriteID sprite, SpriteID pal); |
1914
2b4b3c3a95b4
(svn r2420) - Codechange: magic number elminitation of cursorsprites.
Darkvater
parents:
1829
diff
changeset
|
241 |
void SetAnimatedMouseCursor(const CursorID *table); |
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
657
diff
changeset
|
242 |
void CursorTick(void); |
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
657
diff
changeset
|
243 |
void DrawMouseCursor(void); |
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
657
diff
changeset
|
244 |
void ScreenSizeChanged(void); |
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
657
diff
changeset
|
245 |
void UndrawMouseCursor(void); |
0 | 246 |
bool ChangeResInGame(int w, int h); |
1806
5a55d508c23e
(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
|
247 |
void SortResolutions(int count); |
5587
167d9a91ef02
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5475
diff
changeset
|
248 |
extern "C" void ToggleFullScreen(bool fs); |
0 | 249 |
|
250 |
/* gfx.c */ |
|
1390
e7cdf3ce0fb6
(svn r1894) - Codechange: cleaned up the console a bit, wholly unified handling of text with that of editboxes
Darkvater
parents:
1350
diff
changeset
|
251 |
#define ASCII_LETTERSTART 32 |
3798
b1f5290b36b1
(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
|
252 |
extern FontSize _cur_fontsize; |
b1f5290b36b1
(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
|
253 |
|
5108
aeaef6fe53b7
(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
|
254 |
byte GetCharacterWidth(FontSize size, uint32 key); |
3798
b1f5290b36b1
(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
|
255 |
|
b1f5290b36b1
(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
|
256 |
static inline byte GetCharacterHeight(FontSize size) |
b1f5290b36b1
(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
|
257 |
{ |
b1f5290b36b1
(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
|
258 |
switch (size) { |
b1f5290b36b1
(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
|
259 |
default: NOT_REACHED(); |
b1f5290b36b1
(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
|
260 |
case FS_NORMAL: return 10; |
b1f5290b36b1
(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
|
261 |
case FS_SMALL: return 6; |
b1f5290b36b1
(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
|
262 |
case FS_LARGE: return 18; |
b1f5290b36b1
(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
|
263 |
} |
1391
929b46b9e3cc
(svn r1895) - Fix: add assert for charwidth getter just in case
Darkvater
parents:
1390
diff
changeset
|
264 |
} |
0 | 265 |
|
266 |
VARDEF DrawPixelInfo *_cur_dpi; |
|
267 |
||
4444
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
268 |
enum { |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
269 |
COLOUR_DARK_BLUE, |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
270 |
COLOUR_PALE_GREEN, |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
271 |
COLOUR_PINK, |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
272 |
COLOUR_YELLOW, |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
273 |
COLOUR_RED, |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
274 |
COLOUR_LIGHT_BLUE, |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
275 |
COLOUR_GREEN, |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
276 |
COLOUR_DARK_GREEN, |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
277 |
COLOUR_BLUE, |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
278 |
COLOUR_CREAM, |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
279 |
COLOUR_MAUVE, |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
280 |
COLOUR_PURPLE, |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
281 |
COLOUR_ORANGE, |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
282 |
COLOUR_BROWN, |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
283 |
COLOUR_GREY, |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
284 |
COLOUR_WHITE |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
285 |
}; |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
286 |
|
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
287 |
/** |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
288 |
* All 16 colour gradients |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
289 |
* 8 colours per gradient from darkest (0) to lightest (7) |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
290 |
*/ |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
291 |
VARDEF byte _colour_gradient[16][8]; |
8d40844e6755
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
tron
parents:
4437
diff
changeset
|
292 |
|
614
b96f987dbf80
(svn r1038) Feature: OpenTTD runs with the grf files of the DOS version
dominik
parents:
543
diff
changeset
|
293 |
VARDEF bool _use_dos_palette; |
b96f987dbf80
(svn r1038) Feature: OpenTTD runs with the grf files of the DOS version
dominik
parents:
543
diff
changeset
|
294 |
|
657
d4d36b4853ec
(svn r1091) Fix: Finally station names use 100% the correct color in transparent mode
dominik
parents:
614
diff
changeset
|
295 |
typedef enum StringColorFlags { |
d4d36b4853ec
(svn r1091) Fix: Finally station names use 100% the correct color in transparent mode
dominik
parents:
614
diff
changeset
|
296 |
IS_PALETTE_COLOR = 0x100, // color value is already a real palette color index, not an index of a StringColor |
d4d36b4853ec
(svn r1091) Fix: Finally station names use 100% the correct color in transparent mode
dominik
parents:
614
diff
changeset
|
297 |
} StringColorFlags; |
d4d36b4853ec
(svn r1091) Fix: Finally station names use 100% the correct color in transparent mode
dominik
parents:
614
diff
changeset
|
298 |
|
5636
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
299 |
|
2649
1392cd1a60cc
(svn r3191) Move declaration and definition of _dbg_screen_rect to a place where it somewhat makes sense and wrap them in #ifdef _DEBUG
tron
parents:
2634
diff
changeset
|
300 |
#ifdef _DEBUG |
1392cd1a60cc
(svn r3191) Move declaration and definition of _dbg_screen_rect to a place where it somewhat makes sense and wrap them in #ifdef _DEBUG
tron
parents:
2634
diff
changeset
|
301 |
extern bool _dbg_screen_rect; |
1392cd1a60cc
(svn r3191) Move declaration and definition of _dbg_screen_rect to a place where it somewhat makes sense and wrap them in #ifdef _DEBUG
tron
parents:
2634
diff
changeset
|
302 |
#endif |
1392cd1a60cc
(svn r3191) Move declaration and definition of _dbg_screen_rect to a place where it somewhat makes sense and wrap them in #ifdef _DEBUG
tron
parents:
2634
diff
changeset
|
303 |
|
5636
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
304 |
#endif /* __cplusplus */ |
3c19b56dc982
(svn r8095) -Codechange: stuff that is not related to HAL moved from hal.h to gfx.h
KUDr
parents:
5587
diff
changeset
|
305 |
|
2436
7d5df545bd5d
(svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents:
2407
diff
changeset
|
306 |
#endif /* GFX_H */ |