author | tron |
Wed, 24 Nov 2004 22:52:57 +0000 | |
changeset 504 | b98cf0639775 |
parent 298 | b3e83b94be19 |
child 543 | e3b43338096b |
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 SpriteHdr { |
|
21 |
byte info; |
|
22 |
byte height; |
|
23 |
uint16 width; |
|
24 |
int16 x_offs, y_offs; |
|
25 |
} SpriteHdr; |
|
26 |
assert_compile(sizeof(SpriteHdr) == 8); |
|
27 |
||
28 |
typedef struct CursorVars { |
|
29 |
Point pos, size, offs, delta; |
|
30 |
Point draw_pos, draw_size; |
|
31 |
uint32 sprite; |
|
32 |
||
33 |
int wheel; // mouse wheel movement |
|
34 |
const uint16 *animate_list, *animate_cur; |
|
35 |
uint animate_timeout; |
|
36 |
||
37 |
bool visible; |
|
38 |
bool dirty; |
|
39 |
bool fix_at; |
|
40 |
} CursorVars; |
|
41 |
||
42 |
||
43 |
void RedrawScreenRect(int left, int top, int right, int bottom); |
|
44 |
void GfxScroll(int left, int top, int width, int height, int xo, int yo); |
|
45 |
int DrawStringCentered(int x, int y, uint16 str, byte color); |
|
46 |
int DrawString(int x, int y, uint16 str, byte color); |
|
47 |
void DrawStringCenterUnderline(int x, int y, uint16 str, byte color); |
|
48 |
int DoDrawString(const byte *string, int x, int y, byte color); |
|
49 |
void DrawStringRightAligned(int x, int y, uint16 str, byte color); |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
0
diff
changeset
|
50 |
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
|
51 |
void GfxDrawLine(int left, int top, int right, int bottom, int color); |
0 | 52 |
void DrawFrameRect(int left, int top, int right, int bottom, int color, int flags); |
53 |
||
54 |
int GetStringWidth(const byte *str); |
|
55 |
void LoadStringWidthTable(); |
|
56 |
void DrawStringMultiCenter(int x, int y, uint16 str, int maxw); |
|
57 |
void DrawStringMultiLine(int x, int y, uint16 str, int maxw); |
|
58 |
void DrawDirtyBlocks(); |
|
59 |
void SetDirtyBlocks(int left, int top, int right, int bottom); |
|
60 |
void MarkWholeScreenDirty(); |
|
61 |
||
62 |
void GfxInitPalettes(); |
|
63 |
||
64 |
bool FillDrawPixelInfo(DrawPixelInfo *n, DrawPixelInfo *o, int left, int top, int width, int height); |
|
65 |
||
66 |
/* window.c */ |
|
67 |
void DrawOverlappedWindowForAll(int left, int top, int right, int bottom); |
|
68 |
||
69 |
/* spritecache.c */ |
|
70 |
byte *GetSpritePtr(uint sprite); |
|
71 |
void GfxInitSpriteMem(byte *ptr, uint32 size); |
|
72 |
void GfxLoadSprites(); |
|
73 |
||
74 |
void SetMouseCursor(uint cursor); |
|
75 |
void SetAnimatedMouseCursor(const uint16 *table); |
|
76 |
void CursorTick(); |
|
77 |
void DrawMouseCursor(); |
|
78 |
void ScreenSizeChanged(); |
|
79 |
void UndrawMouseCursor(); |
|
80 |
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
|
81 |
void ToggleFullScreen(const bool full_screen); |
0 | 82 |
|
83 |
typedef struct { |
|
84 |
int xoffs, yoffs; |
|
85 |
int xsize, ysize; |
|
86 |
} SpriteDimension; |
|
87 |
||
88 |
const SpriteDimension *GetSpriteDimension(uint sprite); |
|
89 |
||
90 |
/* gfx.c */ |
|
91 |
VARDEF int _stringwidth_base; |
|
92 |
VARDEF byte _stringwidth_table[0x2A0]; |
|
93 |
||
94 |
VARDEF DrawPixelInfo _screen; |
|
95 |
VARDEF DrawPixelInfo *_cur_dpi; |
|
96 |
VARDEF ColorList _color_list[16]; |
|
97 |
VARDEF CursorVars _cursor; |
|
98 |
||
99 |
VARDEF int _pal_first_dirty; |
|
100 |
VARDEF int _pal_last_dirty; |
|
101 |
||
102 |
/* spritecache.c */ |
|
103 |
//enum { NUM_SPRITES = 0x1320 }; |
|
104 |
//enum { NUM_SPRITES = 0x1500 }; |
|
105 |
enum { NUM_SPRITES = 0x3500 }; // 1500 + space for custom GRF sets |
|
106 |
||
107 |
/* tables.h */ |
|
108 |
extern byte _palettes[4][256 * 3]; |
|
109 |
VARDEF byte _cur_palette[768]; |
|
110 |
||
111 |
#endif |