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
52
53
54
55
56
|
#ifndef ARENA_H
#define ARENA_H
#include "main.h"
#ifndef PUBLIC_SERVER
#include "image.h"
#endif
#ifdef __WIN32__
#define random rand
#endif
#define SCREEN_SPLIT_HORIZONTAL 1
#define SCREEN_SPLIT_VERTICAL 2
#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;
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 void initArena();
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, int screen_size_x, int screen_size_y);
#ifndef PUBLIC_SERVER
extern void drawArena(arena_t *arena);
#endif
extern void eventArena(arena_t *arena);
extern void destroyArena(arena_t *p);
#endif
|