Nilorea Library

- Main Page
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Macros
n_worldmap.h
Go to the documentation of this file.
1
15 #ifndef __N_WORLDMAP_HEADER
16
17 #define __N_WORLDMAP_HEADER
18
19 #ifdef __cplusplus
20 extern "C"
21 {
22 #endif
23
24
25 #include <sys/types.h>
26 #include <sys/stat.h>
27 #include <unistd.h>
28 #include "n_common.h"
29 #include "n_str.h"
30 #include "n_list.h"
31 #include <GL/gl.h>
32 #include <GL/glut.h>
33
34
35
36 typedef struct N_MAP_CELL
37 {
38 int exist ,
39 visible ,
40 texture_id ;
41 }N_MAP_CELL ;
42
43
44
45 typedef struct N_MAP_BOX
46 {
47 int x ,
48 y ,
49 z ;
50
51 N_MAP_CELL ***cell ;
52
53 GLuint draw_id ;
54
55 }N_MAP_BOX ;
56
57
58
59 typedef struct N_WORLDMAP
60 {
61 char /* path of the world */
62 *name ,
63 *datapath;
64
65 int /* loaded at config */
66 box_xsize ,
67 box_ysize ,
68 box_zsize ,
69 box_nb_cells,
70 cell_width ,
71 cell_height ,
72 cell_depth ,
73 /* computed after config load */
74 box_width ,
75 box_height ,
76 box_depth ;
77
78 LIST *box_list ;
79 LIST *draw_list ;
80
81 }N_WORLDMAP ;
82
83 N_WORLDMAP *load_worldmap_config( char *config );
84
85 N_MAP_BOX *load_box( N_WORLDMAP *world , int x , int y , int z );
86
87 N_MAP_BOX *create_new_box( N_WORLDMAP *world , int x , int y , int z );
88
89 int save_box( N_WORLDMAP *world , N_MAP_BOX *box );
90
91 int unload_box( N_WORLDMAP *world , N_MAP_BOX **box );
92
93 int draw_cell( N_WORLDMAP *world , int x , int y , int z );
94
95 int update_cell_draw_list( N_WORLDMAP *world , N_MAP_BOX *box );
96
97 int update_box_draw_list( N_WORLDMAP *world );
98
99 #ifdef __cplusplus
100 }
101 #endif
102
103 #endif /* #ifndef __N_WORLDMAP_HEADER */