blob: 8dbe81ccf6c0810aad8e4883c9fa4f2880af8a34 (
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
40
41
42
43
44
|
#ifndef DATA_UI_H
#define DATA_UI_H
#include <SDL.h>
#include "data_ress.h"
#include "data_game.h"
#define MAX_RENDERLIST_SIZE 256
struct _renderItem_t {
sprite_t *sprite;
int currframe;
int animate; /* Is currently animating ? */
int x,y;
int absolute; /* 0 if level-based coords, 1 if camera-based */
SDL_Rect lastDstRect; /* Last drawn position on screen */
int onhovercursorid;
void (*onmousebuttonevent_proc)(struct _renderItem_t *self, Uint8 button, Uint8 state, gameState_t *gState);
};
typedef struct _renderItem_t renderItem_t;
enum gameRLIdx {RLI_terrain=0, RLI_lem0, RLI_cursor=MAX_RENDERLIST_SIZE-1};
typedef struct {
/* Render list of all in-game sprites (for batch processing)
Items are in paint order
created by buildRenderList() */
renderItem_t renderList[MAX_RENDERLIST_SIZE];
renderItem_t *cursor;
/* Current camera position */
int cameraX;
/* Viewable portion of terrain, see renderTerrainToTextures() */
sprite_t terrainSprite;
/* Computed or accumalted values from gameState_t infos */
int remainingTime, numLemmOut;
} gameUI_t;
#endif /*DATA_UI_H*/
|