author | truebrain |
Fri, 13 Jun 2008 19:57:25 +0000 | |
branch | noai |
changeset 10957 | 7a140b4cd91d |
parent 10455 | 22c441f5adf9 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
10455
22c441f5adf9
(svn r12997) [NoAI] -Sync: with trunk r12895:12996.
rubidium
parents:
9732
diff
changeset
|
3 |
/** @file sprite.h Base for drawing complex sprites. */ |
9574 | 4 |
|
406
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
5 |
#ifndef SPRITE_H |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
6 |
#define SPRITE_H |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
7 |
|
9723
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9703
diff
changeset
|
8 |
#include "gfx_type.h" |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9703
diff
changeset
|
9 |
|
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9703
diff
changeset
|
10 |
#define GENERAL_SPRITE_COLOR(color) ((color) + PALETTE_RECOLOR_START) |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9703
diff
changeset
|
11 |
#define PLAYER_SPRITE_COLOR(owner) (GENERAL_SPRITE_COLOR(_player_colors[owner])) |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9703
diff
changeset
|
12 |
|
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9703
diff
changeset
|
13 |
/** |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9703
diff
changeset
|
14 |
* Whether a sprite comes from the original graphics files or a new grf file |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9703
diff
changeset
|
15 |
* (either supplied by OpenTTD or supplied by the user). |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9703
diff
changeset
|
16 |
* |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9703
diff
changeset
|
17 |
* @param sprite The sprite to check |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9703
diff
changeset
|
18 |
* @return True if it is a new sprite, or false if it is original. |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9703
diff
changeset
|
19 |
*/ |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9703
diff
changeset
|
20 |
#define IS_CUSTOM_SPRITE(sprite) ((sprite) >= SPR_SIGNALS_BASE) |
406
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
21 |
|
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
22 |
/* The following describes bunch of sprites to be drawn together in a single 3D |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
23 |
* bounding box. Used especially for various multi-sprite buildings (like |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
24 |
* depots or stations): */ |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
25 |
|
6574
e1d1a12faaf7
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents:
5919
diff
changeset
|
26 |
struct DrawTileSeqStruct { |
408
63a8c0505aab
(svn r605) -newgrf: Framework for supporting variational spritegroups . Deterministic only at the moment, but random ones support shouldn't be that difficult now It doesn't do anything, but makes these actions actually possible (pasky).
darkvater
parents:
406
diff
changeset
|
27 |
int8 delta_x; // 0x80 is sequence terminator |
406
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
28 |
int8 delta_y; |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
29 |
int8 delta_z; |
4230
cd86b1c47f33
(svn r5787) Rename width, height and unk of struct DrawTileSeqStruct to size_{x,y,z}
tron
parents:
3865
diff
changeset
|
30 |
byte size_x; |
cd86b1c47f33
(svn r5787) Rename width, height and unk of struct DrawTileSeqStruct to size_{x,y,z}
tron
parents:
3865
diff
changeset
|
31 |
byte size_y; |
cd86b1c47f33
(svn r5787) Rename width, height and unk of struct DrawTileSeqStruct to size_{x,y,z}
tron
parents:
3865
diff
changeset
|
32 |
byte size_z; |
9732 | 33 |
PalSpriteID image; |
6574
e1d1a12faaf7
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents:
5919
diff
changeset
|
34 |
}; |
406
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
35 |
|
6574
e1d1a12faaf7
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents:
5919
diff
changeset
|
36 |
struct DrawTileSprites { |
9732 | 37 |
PalSpriteID ground; |
9694
e72987579514
(svn r10775) [NoAI] -Sync: with trunk r10535:r10774.
rubidium
parents:
9574
diff
changeset
|
38 |
const DrawTileSeqStruct *seq; |
6574
e1d1a12faaf7
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents:
5919
diff
changeset
|
39 |
}; |
406
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
40 |
|
3654
4a3f8056a61c
(svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents:
3595
diff
changeset
|
41 |
/** |
4a3f8056a61c
(svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents:
3595
diff
changeset
|
42 |
* This structure is the same for both Industries and Houses. |
4a3f8056a61c
(svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents:
3595
diff
changeset
|
43 |
* Buildings here reference a general type of construction |
4a3f8056a61c
(svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents:
3595
diff
changeset
|
44 |
*/ |
6574
e1d1a12faaf7
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents:
5919
diff
changeset
|
45 |
struct DrawBuildingsTileStruct { |
5919
2b58160d667d
(svn r8128) -Codechange: Split sprite and palette remap into separate 32 bit values.
peter1138
parents:
5726
diff
changeset
|
46 |
PalSpriteID ground; |
2b58160d667d
(svn r8128) -Codechange: Split sprite and palette remap into separate 32 bit values.
peter1138
parents:
5726
diff
changeset
|
47 |
PalSpriteID building; |
9703
d2a6acdbd665
(svn r11146) [NoAI] -Sync: with trunk r11035:11045.
rubidium
parents:
9694
diff
changeset
|
48 |
byte subtile_x; |
d2a6acdbd665
(svn r11146) [NoAI] -Sync: with trunk r11035:11045.
rubidium
parents:
9694
diff
changeset
|
49 |
byte subtile_y; |
d2a6acdbd665
(svn r11146) [NoAI] -Sync: with trunk r11035:11045.
rubidium
parents:
9694
diff
changeset
|
50 |
byte width; |
d2a6acdbd665
(svn r11146) [NoAI] -Sync: with trunk r11035:11045.
rubidium
parents:
9694
diff
changeset
|
51 |
byte height; |
3654
4a3f8056a61c
(svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents:
3595
diff
changeset
|
52 |
byte dz; |
4a3f8056a61c
(svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents:
3595
diff
changeset
|
53 |
byte draw_proc; /* this allows to specify a special drawing procedure.*/ |
6574
e1d1a12faaf7
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents:
5919
diff
changeset
|
54 |
}; |
3654
4a3f8056a61c
(svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents:
3595
diff
changeset
|
55 |
|
9574 | 56 |
/** Iterate through all DrawTileSeqStructs in DrawTileSprites. */ |
406
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
57 |
#define foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++) |
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
58 |
|
29f813f556a6
(svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents:
405
diff
changeset
|
59 |
|
2436
177cb6a8339f
(svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents:
2242
diff
changeset
|
60 |
#endif /* SPRITE_H */ |