summaryrefslogtreecommitdiff
path: root/src/base/arena.h
blob: 2adf0c5d7ef0ae4e8753cb7bab2ae263327b0fc8 (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
45
46
47
48
49
50
51

#ifndef ARENA_H

#define ARENA_H

#include "main.h"

#ifndef PUBLIC_SERVER
#include "image.h"
#endif

#ifdef __WIN32__
#define random rand
#endif

#include "list.h"
#include "space.h"

typedef struct arena_struct
{
#ifndef PUBLIC_SERVER
	char music[STR_SIZE];

	image_t *background;
#endif
	int w, h;
	list_t *listTimer;
	//list_t *listTux;
	space_t *spaceShot;
	space_t *spaceTux;
	space_t *spaceItem;

	int countRound;
	int max_countRound;

} arena_t;

extern void setCurrentArena(arena_t *p);
extern arena_t* getCurrentArena();
extern arena_t* newArena(int w, int h);
extern int conflictSpace(int x1,int y1,int w1,int h1,int x2,int y2,int w2,int h2);
extern int isFreeSpace(arena_t *arena, int x, int y, int w, int h);
extern void findFreeSpace(arena_t *arena, int *x, int *y, int w, int h);
extern void getCenterScreen(int *screen_x, int *screen_y, int x, int y);
#ifndef PUBLIC_SERVER
extern void drawArena(arena_t *arena);
#endif
extern void eventArena(arena_t *arena);
extern void destroyArena(arena_t *p);

#endif