author | tron |
Thu, 10 Feb 2005 12:14:38 +0000 | |
changeset 1350 | 067b22970f19 |
parent 1349 | 07514c2cc6d1 |
child 1390 | 53a5713cf3f9 |
permissions | -rw-r--r-- |
0 | 1 |
#ifndef GFX_H |
2 |
#define GFX_H |
|
3 |
||
4 |
||
5 |
typedef struct ColorList { |
|
6 |
byte unk0, unk1, unk2; |
|
7 |
byte window_color_1a, window_color_1b; |
|
8 |
byte window_color_bga, window_color_bgb; |
|
9 |
byte window_color_2; |
|
10 |
} ColorList; |
|
11 |
||
12 |
struct DrawPixelInfo { |
|
13 |
byte *dst_ptr; |
|
14 |
int left, top, width, height; |
|
15 |
int pitch; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
0
diff
changeset
|
16 |
uint16 zoom; |
0 | 17 |
}; |
18 |
||
19 |
||
20 |
typedef struct CursorVars { |
|
21 |
Point pos, size, offs, delta; |
|
22 |
Point draw_pos, draw_size; |
|
23 |
uint32 sprite; |
|
24 |
||
25 |
int wheel; // mouse wheel movement |
|
26 |
const uint16 *animate_list, *animate_cur; |
|
27 |
uint animate_timeout; |
|
28 |
||
29 |
bool visible; |
|
30 |
bool dirty; |
|
31 |
bool fix_at; |
|
32 |
} CursorVars; |
|
33 |
||
34 |
||
35 |
void RedrawScreenRect(int left, int top, int right, int bottom); |
|
36 |
void GfxScroll(int left, int top, int width, int height, int xo, int yo); |
|
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
298
diff
changeset
|
37 |
int DrawStringCentered(int x, int y, uint16 str, uint16 color); |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
298
diff
changeset
|
38 |
int DrawString(int x, int y, uint16 str, uint16 color); |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
298
diff
changeset
|
39 |
void DrawStringCenterUnderline(int x, int y, uint16 str, uint16 color); |
1323
41397685320a
(svn r1827) Next iteration of the byte -> char transition: some string drawing functions and buffers
tron
parents:
1093
diff
changeset
|
40 |
int DoDrawString(const char *string, int x, int y, uint16 color); |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
298
diff
changeset
|
41 |
void DrawStringRightAligned(int x, int y, uint16 str, uint16 color); |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
0
diff
changeset
|
42 |
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
|
43 |
void GfxDrawLine(int left, int top, int right, int bottom, int color); |
0 | 44 |
void DrawFrameRect(int left, int top, int right, int bottom, int color, int flags); |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
298
diff
changeset
|
45 |
uint16 GetDrawStringPlayerColor(byte player); |
0 | 46 |
|
1323
41397685320a
(svn r1827) Next iteration of the byte -> char transition: some string drawing functions and buffers
tron
parents:
1093
diff
changeset
|
47 |
int GetStringWidth(const char *str); |
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
657
diff
changeset
|
48 |
void LoadStringWidthTable(void); |
0 | 49 |
void DrawStringMultiCenter(int x, int y, uint16 str, int maxw); |
50 |
void DrawStringMultiLine(int x, int y, uint16 str, int maxw); |
|
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
657
diff
changeset
|
51 |
void DrawDirtyBlocks(void); |
0 | 52 |
void SetDirtyBlocks(int left, int top, int right, int bottom); |
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
657
diff
changeset
|
53 |
void MarkWholeScreenDirty(void); |
0 | 54 |
|
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
657
diff
changeset
|
55 |
void GfxInitPalettes(void); |
0 | 56 |
|
57 |
bool FillDrawPixelInfo(DrawPixelInfo *n, DrawPixelInfo *o, int left, int top, int width, int height); |
|
58 |
||
59 |
/* window.c */ |
|
60 |
void DrawOverlappedWindowForAll(int left, int top, int right, int bottom); |
|
61 |
||
62 |
void SetMouseCursor(uint cursor); |
|
63 |
void SetAnimatedMouseCursor(const uint16 *table); |
|
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
657
diff
changeset
|
64 |
void CursorTick(void); |
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
657
diff
changeset
|
65 |
void DrawMouseCursor(void); |
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
657
diff
changeset
|
66 |
void ScreenSizeChanged(void); |
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
657
diff
changeset
|
67 |
void UndrawMouseCursor(void); |
0 | 68 |
bool ChangeResInGame(int w, int h); |
298
b3e83b94be19
(svn r304) -Fix: [967096] fullscreen. New button 'Fullscreen' in 'Game Options' menu which lets you set fullscreen ingame.
darkvater
parents:
193
diff
changeset
|
69 |
void ToggleFullScreen(const bool full_screen); |
0 | 70 |
|
71 |
/* gfx.c */ |
|
72 |
VARDEF int _stringwidth_base; |
|
73 |
VARDEF byte _stringwidth_table[0x2A0]; |
|
74 |
||
75 |
VARDEF DrawPixelInfo _screen; |
|
76 |
VARDEF DrawPixelInfo *_cur_dpi; |
|
77 |
VARDEF ColorList _color_list[16]; |
|
78 |
VARDEF CursorVars _cursor; |
|
79 |
||
80 |
VARDEF int _pal_first_dirty; |
|
81 |
VARDEF int _pal_last_dirty; |
|
82 |
||
614
e016770cb781
(svn r1038) Feature: OpenTTD runs with the grf files of the DOS version
dominik
parents:
543
diff
changeset
|
83 |
VARDEF bool _use_dos_palette; |
e016770cb781
(svn r1038) Feature: OpenTTD runs with the grf files of the DOS version
dominik
parents:
543
diff
changeset
|
84 |
|
0 | 85 |
/* spritecache.c */ |
86 |
//enum { NUM_SPRITES = 0x1320 }; |
|
87 |
//enum { NUM_SPRITES = 0x1500 }; |
|
88 |
enum { NUM_SPRITES = 0x3500 }; // 1500 + space for custom GRF sets |
|
89 |
||
90 |
/* tables.h */ |
|
91 |
extern byte _palettes[4][256 * 3]; |
|
92 |
VARDEF byte _cur_palette[768]; |
|
93 |
||
657
40a9032b454b
(svn r1091) Fix: Finally station names use 100% the correct color in transparent mode
dominik
parents:
614
diff
changeset
|
94 |
|
40a9032b454b
(svn r1091) Fix: Finally station names use 100% the correct color in transparent mode
dominik
parents:
614
diff
changeset
|
95 |
typedef enum StringColorFlags { |
40a9032b454b
(svn r1091) Fix: Finally station names use 100% the correct color in transparent mode
dominik
parents:
614
diff
changeset
|
96 |
IS_PALETTE_COLOR = 0x100, // color value is already a real palette color index, not an index of a StringColor |
40a9032b454b
(svn r1091) Fix: Finally station names use 100% the correct color in transparent mode
dominik
parents:
614
diff
changeset
|
97 |
} StringColorFlags; |
40a9032b454b
(svn r1091) Fix: Finally station names use 100% the correct color in transparent mode
dominik
parents:
614
diff
changeset
|
98 |
|
0 | 99 |
#endif |