Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
n_iso_engine.h
Go to the documentation of this file.
1
9#ifndef NILOREA_ISOMETRIC_ENGINE
10#define NILOREA_ISOMETRIC_ENGINE
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
21#include "n_common.h"
22#include "n_log.h"
23
24#ifndef NOALLEGRO
25
27#define N_TILE 2
29#define N_ABILITY 3
31#define N_MUSIC 4
33#define N_OBJECT 5
35#define WALK 1
37#define SWIM 2
39#define BLCK 3
40
42typedef struct CELL {
43 int
51
52} CELL;
53
55typedef struct MAP {
58
60 char* name;
61
63 BITMAP *mousemap,
66 /* *wiretile; */
67
68 int
89 /*OBJECT **object_lib;*/
93 /* ANIM **anim_lib; */
97 /*SOUND **sounds_lib;*/
101 /*QUEST **quests_lib;*/
104
105} MAP;
106
107/* Create an empty map */
108int 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);
109/* Set a the tilenumber of a cell */
110int set_value(MAP* map, int type, int x, int y, int value);
111/* Get a the tilenumber of a cell */
112int get_value(MAP* map, int type, int x, int y);
113/* Convert screen coordinate to map coordinate */
114int ScreenToMap(int mx, int my, int* Tilex, int* Tiley, BITMAP* mousemap);
115/* Center Map on given screen coordinate */
116int camera_to_scr(MAP** map, int x, int y);
117/* Center Map on given map coordinate, with x & y offset */
118int camera_to_map(MAP** map, int tx, int ty, int x, int y);
119/* Draw the map using its coordinate on the specified bitmap */
120int draw_map(MAP* map, BITMAP* bmp, int destx, int desty, int mode);
121/* Load the map */
122int load_map(MAP** map, char* filename);
123/* Save the map */
124int save_map(MAP* map, char* filename);
125/* Free the map */
126int free_map(MAP** map);
127
132#endif /* NOALLEGRO */
133
134#ifdef __cplusplus
135}
136#endif
137
138#endif /* #ifndef NILOREA_ISOMETRIC_ENGINE */
int mode
Network for managing conenctions.
Definition ex_network.c:22
char * quests_group_names
quest library
int X
X move in pixel for drawing.
char * sounds_group_names
sounds library
int TILEW
size X of tiles of the map (in pixel)
int ability
ability of the tile (walking, swimming, blocking, killing ?)
int tilenumber
ident of the tile in the MAP->tile library
char * name
Name of the map ( used for linking between two map )
int ptanchorY
Y starting cell for drawing.
int wirecolor
color of wire
int ptanchorX
X starting cell for drawing.
BITMAP * colortile
default full colored background tile
int TILEH
size Y of tiles of the map (in pixel)
char * object_group_names
active objects
CELL * grid
Grid of each cell of the map.
int YSIZE
size Y of the grid (nbYcell)
int XSIZE
size X of the grid (nbXcell)
char * anim_group_names
animation board
int music
ident of the music on the tile
int bgcolor
color of the bg
int objectnumber
ident of the object in the MAP->object library
int Y
Y move in pixel for drawing.
BITMAP * mousemap
Map for mouse collision between mouse pointer and map.
int save_map(MAP *map, char *filename)
Save the map to filename.
int get_value(MAP *map, int type, int x, int y)
Get a the tilenumber of a cell item.
int load_map(MAP **map, char *filename)
Load the map from filename.
int camera_to_map(MAP **map, int tx, int ty, int x, int y)
Center Map on given map coordinate, with x & y offset.
int camera_to_scr(MAP **map, int x, int y)
Center Map on given screen coordinate.
int set_value(MAP *map, int type, int x, int y, int value)
Set the value of a cell in a map.
int draw_map(MAP *map, BITMAP *bmp, int destx, int desty, int mode)
Draw a MAP *map on the BITMAP *bmp.
int ScreenToMap(int mx, int my, int *Tilex, int *Tiley, BITMAP *mousemap)
Convert screen coordinate to map coordinate.
int free_map(MAP **map)
Free the map.
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)
Create an empty map.
Cell of a MAP.
MAP with objects, tiles, skins.
Common headers and low-level functions & define.
Generic log system.