src/sprite.h
author rubidium
Tue, 02 Jan 2007 19:19:48 +0000
changeset 5475 2e6990a8c7c4
parent 4230 sprite.h@f4e93251e2f6
child 5668 36b39f4a9032
permissions -rw-r--r--
(svn r7759) -Merge: makefile rewrite. This merge features:
- A proper ./configure, so everything needs to be configured only once, not for every make.
- Usage of makedepend when available. This greatly reduces the time needed for generating the dependencies.
- A generator for all project files. There is a single file with sources, which is used to generate Makefiles and the project files for MSVC.
- Proper support for OSX universal binaries.
- Object files for non-MSVC compiles are also placed in separate directories, making is faster to switch between debug and release compiles and it does not touch the directory with the source files.
- Functionality to make a bundle of all needed files for for example a nightly or distribution of a binary with all needed GRFs and language files.

Note: as this merge moves almost all files, it is recommended to make a backup of your working copy before updating your working copy.
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 1883
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 1883
diff changeset
     2
406
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
     3
#ifndef SPRITE_H
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
     4
#define SPRITE_H
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
     5
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
     6
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
     7
/* The following describes bunch of sprites to be drawn together in a single 3D
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
     8
 * bounding box. Used especially for various multi-sprite buildings (like
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
     9
 * depots or stations): */
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
    10
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
    11
typedef struct DrawTileSeqStruct {
408
48da21eb9ff2 (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
    12
	int8 delta_x; // 0x80 is sequence terminator
406
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
    13
	int8 delta_y;
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
    14
	int8 delta_z;
4230
f4e93251e2f6 (svn r5787) Rename width, height and unk of struct DrawTileSeqStruct to size_{x,y,z}
tron
parents: 3865
diff changeset
    15
	byte size_x;
f4e93251e2f6 (svn r5787) Rename width, height and unk of struct DrawTileSeqStruct to size_{x,y,z}
tron
parents: 3865
diff changeset
    16
	byte size_y;
f4e93251e2f6 (svn r5787) Rename width, height and unk of struct DrawTileSeqStruct to size_{x,y,z}
tron
parents: 3865
diff changeset
    17
	byte size_z;
406
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
    18
	uint32 image;
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
    19
} DrawTileSeqStruct;
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
    20
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
    21
typedef struct DrawTileSprites {
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
    22
	SpriteID ground_sprite;
2548
49c8a096033f (svn r3077) static, const, bracing, indentation, 0 -> '\0'/NULL, typos in comments, excess empty lines, minor other changes
tron
parents: 2491
diff changeset
    23
	const DrawTileSeqStruct* seq;
406
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
    24
} DrawTileSprites;
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
    25
3654
c09872510a61 (svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents: 3595
diff changeset
    26
/**
c09872510a61 (svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents: 3595
diff changeset
    27
 * This structure is the same for both Industries and Houses.
c09872510a61 (svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents: 3595
diff changeset
    28
 * Buildings here reference a general type of construction
c09872510a61 (svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents: 3595
diff changeset
    29
 */
c09872510a61 (svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents: 3595
diff changeset
    30
typedef struct DrawBuildingsTileStruct {
c09872510a61 (svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents: 3595
diff changeset
    31
	SpriteID ground;
c09872510a61 (svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents: 3595
diff changeset
    32
	SpriteID building;
c09872510a61 (svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents: 3595
diff changeset
    33
	byte subtile_x:4;
c09872510a61 (svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents: 3595
diff changeset
    34
	byte subtile_y:4;
c09872510a61 (svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents: 3595
diff changeset
    35
	byte width:4;
c09872510a61 (svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents: 3595
diff changeset
    36
	byte height:4;
c09872510a61 (svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents: 3595
diff changeset
    37
	byte dz;
c09872510a61 (svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents: 3595
diff changeset
    38
	byte draw_proc;  /* this allows to specify a special drawing procedure.*/
c09872510a61 (svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents: 3595
diff changeset
    39
} DrawBuildingsTileStruct;
c09872510a61 (svn r4568) CodeChange : Bring definitions and uses of DrawTypesStructures toguether.
belugas
parents: 3595
diff changeset
    40
408
48da21eb9ff2 (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
    41
// Iterate through all DrawTileSeqStructs in DrawTileSprites.
406
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
    42
#define foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++)
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
    43
34cba651d9f8 (svn r603) -newgrf: Stupid TortoiseSVN converted the file to DOS newlines. Bah
darkvater
parents: 405
diff changeset
    44
2436
7d5df545bd5d (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
Darkvater
parents: 2242
diff changeset
    45
#endif /* SPRITE_H */