Nilorea Library

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Macros Groups
n_iso_engine.h
Go to the documentation of this file.
1
8 #ifndef NILOREA_ISOMETRIC_ENGINE
9 #define NILOREA_ISOMETRIC_ENGINE
10
11 #ifdef __cplusplus
12 extern "C"
13 {
14 #endif
15
21 #include "n_common.h"
22 #include "n_log.h"
23
24 #ifndef NOALLEGRO
25
27 #define N_TILE 2
28
29 #define N_ABILITY 3
30
31 #define N_MUSIC 4
32
33 #define N_OBJECT 5
34
35 #define WALK 1
36
37 #define SWIM 2
38
39 #define BLCK 3
40
41
43 typedef struct CELL
44 {
45 int
46 tilenumber,
48 ability,
50 objectnumber,
52 music;
53
54 } CELL;
55
57 typedef struct MAP
58 {
60 CELL *grid;
61
63 char *name;
64
66 BITMAP *mousemap,
68 *colortile;
69 /* *wiretile; */
70
71 int
72 XSIZE,
74 YSIZE,
76 TILEW,
78 TILEH,
80 ptanchorX,
82 ptanchorY,
84 X,
86 Y,
88 bgcolor,
90 wirecolor;
92 /*OBJECT **object_lib;*/
94 char *object_group_names;
96 /* ANIM **anim_lib; */
98 char *anim_group_names;
100 /*SOUND **sounds_lib;*/
102 char *sounds_group_names;
104 /*QUEST **quests_lib;*/
106 char *quests_group_names;
107
108 } MAP;
109
110 /* Create an empty map */
111 int create_empty_map( MAP **map , char *name , int XSIZE , int YSIZE , int TILEW , int TILEH , int nbmaxobjects , int nbmaxgroup , int nbmaxanims , int nbtiles , int nbanims );
112 /* Set a the tilenumber of a cell */
113 int set_value( MAP *map , int type , int x , int y , int value );
114 /* Get a the tilenumber of a cell */
115 int get_value( MAP *map , int type , int x , int y );
116 /* Convert screen coordinate to map coordinate */
117 int ScreenToMap( int mx, int my, int *Tilex, int *Tiley, BITMAP *mousemap );
118 /* Center Map on given screen coordinate */
119 int camera_to_scr( MAP **map , int x , int y );
120 /* Center Map on given map coordinate, with x & y offset */
121 int camera_to_map( MAP **map , int tx , int ty , int x , int y );
122 /* Draw the map using its coordinate on the specified bitmap */
123 int draw_map( MAP *map , BITMAP *bmp , int destx , int desty , int mode );
124 /* Load the map */
125 int load_map( MAP **map , char *filename );
126 /* Save the map */
127 int save_map( MAP *map , char *filename );
128 /* Free the map */
129 int free_map( MAP **map );
130
133 #endif /* NOALLEGRO */
134
135 #ifdef __cplusplus
136 }
137 #endif
138
139 #endif /* #ifndef NILOREA_ISOMETRIC_ENGINE */
140