summaryrefslogtreecommitdiff
path: root/src/include/data_game.h
blob: b89986de1969079f5c893e2c88ed6cccbdc67829 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef DATA_GAME_H
#define DATA_GAME_H

#include <SDL.h>

#define MAX_RENDERLIST_SIZE 256

typedef struct {
	sprite_t *sprite;
	int currframe;
	int animate; /* Is currently animating ? */
	int x,y;
	int absolute; /* 0 if level-based coords, 1 if camera-based */
} renderItem_t;

typedef struct {
		/* Game frame counter */
		int tick;
		/* Current camera position */
		int cameraX;

		/* terrain & stencil
			generated by paint_terrain()
			update by ???()  */
		SDL_Surface *terrain, *stencil;

		/* streamTerrain : viewable portion of terrain, in texture format
					updated by render_terrain() */
		sprite_t terrainSprite;

		/* Render list of all in-game sprites (for batch processing)
			Items are in paint order
			created by buildRenderList() */
		int renderListSize;
		renderItem_t renderList[MAX_RENDERLIST_SIZE];
} gameState_t;

#endif /*DATA_GAME_H*/