Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
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
12extern "C" {
13#endif
14
20#include "n_common.h"
21#include "n_log.h"
22
23#ifndef NOALLEGRO
24
26#define N_TILE 2
28#define N_ABILITY 3
30#define N_MUSIC 4
32#define N_OBJECT 5
34#define WALK 1
36#define SWIM 2
38#define BLCK 3
39
41typedef struct CELL {
42 int
50
51} CELL;
52
54typedef struct MAP {
57
59 char* name;
60
62 BITMAP *mousemap,
65 /* *wiretile; */
66
67 int
88 /*OBJECT **object_lib;*/
92 /* ANIM **anim_lib; */
96 /*SOUND **sounds_lib;*/
100 /*QUEST **quests_lib;*/
103
104} MAP;
105
106/* Create an empty map */
107int 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);
108/* Set a the tilenumber of a cell */
109int set_value(MAP* map, int type, int x, int y, int value);
110/* Get a the tilenumber of a cell */
111int get_value(MAP* map, int type, int x, int y);
112/* Convert screen coordinate to map coordinate */
113int ScreenToMap(int mx, int my, int* Tilex, int* Tiley, BITMAP* mousemap);
114/* Center Map on given screen coordinate */
115int camera_to_scr(MAP** map, int x, int y);
116/* Center Map on given map coordinate, with x & y offset */
117int camera_to_map(MAP** map, int tx, int ty, int x, int y);
118/* Draw the map using its coordinate on the specified bitmap */
119int draw_map(MAP* map, BITMAP* bmp, int destx, int desty, int mode);
120/* Load the map */
121int load_map(MAP** map, char* filename);
122/* Save the map */
123int save_map(MAP* map, char* filename);
124/* Free the map */
125int free_map(MAP** map);
126
131#endif /* NOALLEGRO */
132
133#ifdef __cplusplus
134}
135#endif
136
137#endif /* #ifndef NILOREA_ISOMETRIC_ENGINE */
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.