Revision 1041
load world from input file, changed create poly to take an array of doubles
world.h | ||
---|---|---|
12 | 12 |
#define __WORLD_H__ |
13 | 13 |
|
14 | 14 |
#include <stdarg.h> |
15 |
#include <string.h> |
|
16 |
#include <stdio.h> |
|
17 |
#include <stdlib.h> |
|
15 | 18 |
|
16 | 19 |
#define ID_OFFSET -1 |
17 | 20 |
#define ID_RECTANGLE 3 |
... | ... | |
27 | 30 |
#define CREATE(id, ...) (create_func[id](__VA_ARGS__)) |
28 | 31 |
#define PBBOX(b) {printf("(%g,%g) --> (%g, %g)\n",(b).p1.x,(b).p1.y,(b).p2.x,\ |
29 | 32 |
(b).p2.y);} |
33 |
|
|
34 |
#define MAX_OBJS 100 |
|
35 |
#define BUF_SIZE 512 |
|
36 |
|
|
30 | 37 |
typedef struct { |
31 | 38 |
double x; |
32 | 39 |
double y; |
... | ... | |
82 | 89 |
void print_world(void); |
83 | 90 |
void print_object(object_t *obj); |
84 | 91 |
|
92 |
|
|
93 |
/* WORLD 0 0 512 512 |
|
94 |
* POLYGON 3 CONNECTED 1 2 3 4 5 6 |
|
95 |
*/ |
|
96 |
int load_world (const char* filename); |
|
97 |
int load_object (const char* line); |
|
98 |
int starts_with (const char* line, const char* word); |
|
99 |
|
|
85 | 100 |
#endif |
86 | 101 |
|
Also available in: Unified diff