author | peter1138 |
Sat, 02 Dec 2006 09:54:49 +0000 | |
changeset 5210 | 3415ef43c70a |
parent 4742 | d915db693186 |
child 5225 | af5d9de16c8d |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
455 | 3 |
#ifndef NEWGRF_H |
4 |
#define NEWGRF_H |
|
5 |
||
463
97ec66c280f2
(svn r687) Export InitNewGRFFile() and DecodeSpecialSprite() properly.
pasky
parents:
455
diff
changeset
|
6 |
#include "station.h" |
97ec66c280f2
(svn r687) Export InitNewGRFFile() and DecodeSpecialSprite() properly.
pasky
parents:
455
diff
changeset
|
7 |
|
3561
2f67415d44aa
(svn r4439) - NewGRF: Add support for Action 0x10. This also required an extra pre-stage (before initialize and activation) to scan the GRF file for GOTO labels. Big thanks for peter1138 for the guidance and answers, as well as parts of the code.
Darkvater
parents:
3501
diff
changeset
|
8 |
typedef struct GRFLabel { |
2f67415d44aa
(svn r4439) - NewGRF: Add support for Action 0x10. This also required an extra pre-stage (before initialize and activation) to scan the GRF file for GOTO labels. Big thanks for peter1138 for the guidance and answers, as well as parts of the code.
Darkvater
parents:
3501
diff
changeset
|
9 |
byte label; |
2f67415d44aa
(svn r4439) - NewGRF: Add support for Action 0x10. This also required an extra pre-stage (before initialize and activation) to scan the GRF file for GOTO labels. Big thanks for peter1138 for the guidance and answers, as well as parts of the code.
Darkvater
parents:
3501
diff
changeset
|
10 |
uint32 nfo_line; |
2f67415d44aa
(svn r4439) - NewGRF: Add support for Action 0x10. This also required an extra pre-stage (before initialize and activation) to scan the GRF file for GOTO labels. Big thanks for peter1138 for the guidance and answers, as well as parts of the code.
Darkvater
parents:
3501
diff
changeset
|
11 |
uint32 pos; |
2f67415d44aa
(svn r4439) - NewGRF: Add support for Action 0x10. This also required an extra pre-stage (before initialize and activation) to scan the GRF file for GOTO labels. Big thanks for peter1138 for the guidance and answers, as well as parts of the code.
Darkvater
parents:
3501
diff
changeset
|
12 |
struct GRFLabel *next; |
2f67415d44aa
(svn r4439) - NewGRF: Add support for Action 0x10. This also required an extra pre-stage (before initialize and activation) to scan the GRF file for GOTO labels. Big thanks for peter1138 for the guidance and answers, as well as parts of the code.
Darkvater
parents:
3501
diff
changeset
|
13 |
} GRFLabel; |
2f67415d44aa
(svn r4439) - NewGRF: Add support for Action 0x10. This also required an extra pre-stage (before initialize and activation) to scan the GRF file for GOTO labels. Big thanks for peter1138 for the guidance and answers, as well as parts of the code.
Darkvater
parents:
3501
diff
changeset
|
14 |
|
3628
69646d0924a5
(svn r4527) - Feature [NewGRF]: Add support for specifying parameters to GRF files. Usage: "mygrf = 1". You can pass up to 128 parameters, each one seperated by a comma or a space-character. Big thanks to peter1138 for the inspiration and examples.
Darkvater
parents:
3561
diff
changeset
|
15 |
typedef struct GRFFile { |
455 | 16 |
char *filename; |
17 |
uint32 grfid; |
|
18 |
uint16 flags; |
|
19 |
uint16 sprite_offset; |
|
3640
afe6a5032f6a
(svn r4549) - NewGRF: store the grf version from Action 0x08.
peter1138
parents:
3638
diff
changeset
|
20 |
byte grf_version; |
3628
69646d0924a5
(svn r4527) - Feature [NewGRF]: Add support for specifying parameters to GRF files. Usage: "mygrf = 1". You can pass up to 128 parameters, each one seperated by a comma or a space-character. Big thanks to peter1138 for the inspiration and examples.
Darkvater
parents:
3561
diff
changeset
|
21 |
struct GRFFile *next; |
455 | 22 |
|
23 |
/* A sprite group contains all sprites of a given vehicle (or multiple |
|
24 |
* vehicles) when carrying given cargo. It consists of several sprite |
|
25 |
* sets. Group ids are refered as "cargo id"s by TTDPatch |
|
26 |
* documentation, contributing to the global confusion. |
|
27 |
* |
|
28 |
* A sprite set contains all sprites of a given vehicle carrying given |
|
29 |
* cargo at a given *stage* - that is usually its load stage. Ie. you |
|
30 |
* can have a spriteset for an empty wagon, wagon full of coal, |
|
31 |
* half-filled wagon etc. Each spriteset contains eight sprites (one |
|
32 |
* per direction) or four sprites if the vehicle is symmetric. */ |
|
33 |
||
3707
7dc7e4d2487e
(svn r4650) - NewGRF: use the correct type for _cur_spriteid
peter1138
parents:
3640
diff
changeset
|
34 |
SpriteID spriteset_start; |
455 | 35 |
int spriteset_numsets; |
36 |
int spriteset_numents; |
|
37 |
int spriteset_feature; |
|
38 |
||
39 |
int spritegroups_count; |
|
3865
b80b50f14fcd
(svn r4901) - Codechange: change 'SpriteGroup *' to 'struct SpriteGroup *' within StationSpec and GRFFile struct declarations. Now only code which actually references those pointers needs to know about the SpriteGroup struct. Remove some unnecessary lingering header dependencies.
peter1138
parents:
3775
diff
changeset
|
40 |
struct SpriteGroup **spritegroups; |
455 | 41 |
|
4656
9c1d8c4d3e60
(svn r6532) - Feature: Add support for NewGRF sound effects. Currently sound priority isn't supported.
peter1138
parents:
3865
diff
changeset
|
42 |
uint sound_offset; |
9c1d8c4d3e60
(svn r6532) - Feature: Add support for NewGRF sound effects. Currently sound priority isn't supported.
peter1138
parents:
3865
diff
changeset
|
43 |
|
3768
5194cf3c57b1
(svn r4760) - Newstations: change the way custom stations are allocated when loading from GRF, as the current way was flawed (reallocing memory which is referenced elsewhere)
peter1138
parents:
3707
diff
changeset
|
44 |
StationSpec **stations; |
2345 | 45 |
|
46 |
uint32 param[0x80]; |
|
47 |
uint param_end; /// one more than the highest set parameter |
|
3561
2f67415d44aa
(svn r4439) - NewGRF: Add support for Action 0x10. This also required an extra pre-stage (before initialize and activation) to scan the GRF file for GOTO labels. Big thanks for peter1138 for the guidance and answers, as well as parts of the code.
Darkvater
parents:
3501
diff
changeset
|
48 |
|
2f67415d44aa
(svn r4439) - NewGRF: Add support for Action 0x10. This also required an extra pre-stage (before initialize and activation) to scan the GRF file for GOTO labels. Big thanks for peter1138 for the guidance and answers, as well as parts of the code.
Darkvater
parents:
3501
diff
changeset
|
49 |
GRFLabel *label; ///< Pointer to the first label. This is a linked list, not an array. |
3628
69646d0924a5
(svn r4527) - Feature [NewGRF]: Add support for specifying parameters to GRF files. Usage: "mygrf = 1". You can pass up to 128 parameters, each one seperated by a comma or a space-character. Big thanks to peter1138 for the inspiration and examples.
Darkvater
parents:
3561
diff
changeset
|
50 |
} GRFFile; |
455 | 51 |
|
1477 | 52 |
extern GRFFile *_first_grffile; |
455 | 53 |
|
3628
69646d0924a5
(svn r4527) - Feature [NewGRF]: Add support for specifying parameters to GRF files. Usage: "mygrf = 1". You can pass up to 128 parameters, each one seperated by a comma or a space-character. Big thanks to peter1138 for the inspiration and examples.
Darkvater
parents:
3561
diff
changeset
|
54 |
typedef struct GRFConfig { |
69646d0924a5
(svn r4527) - Feature [NewGRF]: Add support for specifying parameters to GRF files. Usage: "mygrf = 1". You can pass up to 128 parameters, each one seperated by a comma or a space-character. Big thanks to peter1138 for the inspiration and examples.
Darkvater
parents:
3561
diff
changeset
|
55 |
const char *filename; |
69646d0924a5
(svn r4527) - Feature [NewGRF]: Add support for specifying parameters to GRF files. Usage: "mygrf = 1". You can pass up to 128 parameters, each one seperated by a comma or a space-character. Big thanks to peter1138 for the inspiration and examples.
Darkvater
parents:
3561
diff
changeset
|
56 |
uint32 param[0x80]; |
69646d0924a5
(svn r4527) - Feature [NewGRF]: Add support for specifying parameters to GRF files. Usage: "mygrf = 1". You can pass up to 128 parameters, each one seperated by a comma or a space-character. Big thanks to peter1138 for the inspiration and examples.
Darkvater
parents:
3561
diff
changeset
|
57 |
byte num_params; |
69646d0924a5
(svn r4527) - Feature [NewGRF]: Add support for specifying parameters to GRF files. Usage: "mygrf = 1". You can pass up to 128 parameters, each one seperated by a comma or a space-character. Big thanks to peter1138 for the inspiration and examples.
Darkvater
parents:
3561
diff
changeset
|
58 |
|
69646d0924a5
(svn r4527) - Feature [NewGRF]: Add support for specifying parameters to GRF files. Usage: "mygrf = 1". You can pass up to 128 parameters, each one seperated by a comma or a space-character. Big thanks to peter1138 for the inspiration and examples.
Darkvater
parents:
3561
diff
changeset
|
59 |
struct GRFConfig *next; |
69646d0924a5
(svn r4527) - Feature [NewGRF]: Add support for specifying parameters to GRF files. Usage: "mygrf = 1". You can pass up to 128 parameters, each one seperated by a comma or a space-character. Big thanks to peter1138 for the inspiration and examples.
Darkvater
parents:
3561
diff
changeset
|
60 |
} GRFConfig; |
69646d0924a5
(svn r4527) - Feature [NewGRF]: Add support for specifying parameters to GRF files. Usage: "mygrf = 1". You can pass up to 128 parameters, each one seperated by a comma or a space-character. Big thanks to peter1138 for the inspiration and examples.
Darkvater
parents:
3561
diff
changeset
|
61 |
|
69646d0924a5
(svn r4527) - Feature [NewGRF]: Add support for specifying parameters to GRF files. Usage: "mygrf = 1". You can pass up to 128 parameters, each one seperated by a comma or a space-character. Big thanks to peter1138 for the inspiration and examples.
Darkvater
parents:
3561
diff
changeset
|
62 |
extern GRFConfig *_first_grfconfig; |
3638
3e655c6e0914
(svn r4546) - NewGRF: add support for Action 0x05, type 0x04: replacement signal graphics. Thanks to Purno for supplying data to test
peter1138
parents:
3628
diff
changeset
|
63 |
extern SpriteID _signal_base; |
5210
3415ef43c70a
(svn r7325) -Feature: Add support for action 5 type 0x0D, coast sprites.
peter1138
parents:
4742
diff
changeset
|
64 |
extern SpriteID _coast_base; |
4742
d915db693186
(svn r6654) - Codechange: If no 2cc vehicles are available, hide the secondary colour choice.
peter1138
parents:
4656
diff
changeset
|
65 |
extern bool _have_2cc; |
463
97ec66c280f2
(svn r687) Export InitNewGRFFile() and DecodeSpecialSprite() properly.
pasky
parents:
455
diff
changeset
|
66 |
|
2342
aae24c9661ba
(svn r2868) Change the way NewGRFs are loaded: The loading process i no longer bolted onto the normal graphics loading.
tron
parents:
2186
diff
changeset
|
67 |
void LoadNewGRF(uint load_index, uint file_index); |
455 | 68 |
|
69 |
#endif /* NEWGRF_H */ |