newgrf.h
author tron
Fri, 14 Oct 2005 07:59:16 +0000
changeset 2512 a66b16c61a69
parent 2444 5998cd7b06e7
child 2548 49c8a096033f
permissions -rw-r--r--
(svn r3038) Reorder the loading of standard graphics files to reflect a bit where in the sprite array the sprites end up and assert, that the indices are equal to the corresponding sprite base enums, to guard against typos.
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 1477
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 1477
diff changeset
     2
455
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
     3
#ifndef NEWGRF_H
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
     4
#define NEWGRF_H
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
     5
463
97ec66c280f2 (svn r687) Export InitNewGRFFile() and DecodeSpecialSprite() properly.
pasky
parents: 455
diff changeset
     6
#include "sprite.h"
97ec66c280f2 (svn r687) Export InitNewGRFFile() and DecodeSpecialSprite() properly.
pasky
parents: 455
diff changeset
     7
#include "station.h"
97ec66c280f2 (svn r687) Export InitNewGRFFile() and DecodeSpecialSprite() properly.
pasky
parents: 455
diff changeset
     8
1477
9389baf2bf3c (svn r1981) Typedef some structs and enums
tron
parents: 463
diff changeset
     9
typedef struct GRFFile GRFFile;
455
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    10
struct GRFFile {
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    11
	char *filename;
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    12
	uint32 grfid;
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    13
	uint16 flags;
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    14
	uint16 sprite_offset;
1477
9389baf2bf3c (svn r1981) Typedef some structs and enums
tron
parents: 463
diff changeset
    15
	GRFFile *next;
455
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    16
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    17
	/* A sprite group contains all sprites of a given vehicle (or multiple
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    18
	 * vehicles) when carrying given cargo. It consists of several sprite
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    19
	 * sets.  Group ids are refered as "cargo id"s by TTDPatch
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    20
	 * documentation, contributing to the global confusion.
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    21
	 *
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    22
	 * A sprite set contains all sprites of a given vehicle carrying given
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    23
	 * cargo at a given *stage* - that is usually its load stage. Ie. you
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    24
	 * can have a spriteset for an empty wagon, wagon full of coal,
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    25
	 * half-filled wagon etc.  Each spriteset contains eight sprites (one
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    26
	 * per direction) or four sprites if the vehicle is symmetric. */
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    27
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    28
	int spriteset_start;
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    29
	int spriteset_numsets;
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    30
	int spriteset_numents;
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    31
	int spriteset_feature;
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    32
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    33
	int spritegroups_count;
2444
5998cd7b06e7 (svn r2970) - Newgrf: Allocate spritegroups dynamically; this allows a cargo ID to reference the previous definition of the same cargo ID, instead of causing loops.
peter1138
parents: 2345
diff changeset
    34
	SpriteGroup **spritegroups;
455
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    35
1477
9389baf2bf3c (svn r1981) Typedef some structs and enums
tron
parents: 463
diff changeset
    36
	StationSpec stations[256];
2345
f7251bd99942 (svn r2871) -Feature/Fix: Per GRF parameter lists
tron
parents: 2342
diff changeset
    37
f7251bd99942 (svn r2871) -Feature/Fix: Per GRF parameter lists
tron
parents: 2342
diff changeset
    38
	uint32 param[0x80];
f7251bd99942 (svn r2871) -Feature/Fix: Per GRF parameter lists
tron
parents: 2342
diff changeset
    39
	uint param_end; /// one more than the highest set parameter
455
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    40
};
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    41
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    42
extern int _grffile_count;
1477
9389baf2bf3c (svn r1981) Typedef some structs and enums
tron
parents: 463
diff changeset
    43
extern GRFFile *_first_grffile;
455
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    44
463
97ec66c280f2 (svn r687) Export InitNewGRFFile() and DecodeSpecialSprite() properly.
pasky
parents: 455
diff changeset
    45
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
    46
void LoadNewGRF(uint load_index, uint file_index);
455
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    47
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    48
#endif /* NEWGRF_H */
b151d55203bf (svn r665) code fixes for newgrf.c/newgrf.h
dominik
parents: 453
diff changeset
    49