![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
Data Structures | |
| struct | CELL |
| Cell of a MAP. More... | |
| struct | MAP |
| MAP with objects, tiles, skins. More... | |
Macros | |
| #define | BLCK 3 |
| FLAG of a stopping tile. | |
| #define | N_ABILITY 3 |
| FLAG of ability type. | |
| #define | N_MUSIC 4 |
| FLAG of music type. | |
| #define | N_OBJECT 5 |
| FLAG of object type. | |
| #define | N_TILE 2 |
| FLAG of tile type. | |
| #define | SWIM 2 |
| FLAG of a swimmable tile. | |
| #define | WALK 1 |
| FLAG of a walkable tile. | |
Functions | |
| 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 | 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. | |
| int | draw_map (MAP *map, BITMAP *bmp, int destx, int desty, int mode) |
| Draw a MAP *map on the BITMAP *bmp. | |
| int | free_map (MAP **map) |
| Free the map. | |
| 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 | save_map (MAP *map, char *filename) |
| Save the map to filename. | |
| int | ScreenToMap (int mx, int my, int *Tilex, int *Tiley, BITMAP *mousemap) |
| Convert screen coordinate to map coordinate. | |
| int | set_value (MAP *map, int type, int x, int y, int value) |
| Set the value of a cell in a map. | |
| struct CELL |
Cell of a MAP.
Definition at line 42 of file n_iso_engine.h.
Collaboration diagram for CELL:| struct MAP |
MAP with objects, tiles, skins.
Definition at line 55 of file n_iso_engine.h.
Collaboration diagram for MAP:| Data Fields | ||
|---|---|---|
| char * | anim_group_names |
animation board as for previous:char *object_group_names |
| int | bgcolor | color of the bg |
| BITMAP * | colortile | default full colored background tile |
| CELL * | grid | Grid of each cell of the map. |
| BITMAP * | mousemap | Map for mouse collision between mouse pointer and map. |
| char * | name | Name of the map ( used for linking between two map ) |
| char * | object_group_names |
active objects name of the main group of the (kind of) library of objects, filled by zero else, size iz limited to 512 characaters |
| int | ptanchorX | X starting cell for drawing. |
| int | ptanchorY | Y starting cell for drawing. |
| char * | quests_group_names |
quest library as for previous:char *object_group_names |
| char * | sounds_group_names |
sounds library as for previous:char *object_group_names |
| int | TILEH | size Y of tiles of the map (in pixel) |
| int | TILEW | size X of tiles of the map (in pixel) |
| int | wirecolor | color of wire |
| int | X | X move in pixel for drawing. |
| int | XSIZE | size X of the grid (nbXcell) |
| int | Y | Y move in pixel for drawing. |
| int | YSIZE | size Y of the grid (nbYcell) |
| #define BLCK 3 |
FLAG of a stopping tile.
Definition at line 39 of file n_iso_engine.h.
| #define N_ABILITY 3 |
FLAG of ability type.
Definition at line 29 of file n_iso_engine.h.
| #define N_MUSIC 4 |
FLAG of music type.
Definition at line 31 of file n_iso_engine.h.
| #define N_OBJECT 5 |
FLAG of object type.
Definition at line 33 of file n_iso_engine.h.
| #define N_TILE 2 |
FLAG of tile type.
Definition at line 27 of file n_iso_engine.h.
| #define SWIM 2 |
FLAG of a swimmable tile.
Definition at line 37 of file n_iso_engine.h.
| #define WALK 1 |
FLAG of a walkable tile.
Definition at line 35 of file n_iso_engine.h.
| int camera_to_map | ( | MAP ** | map, |
| int | tx, | ||
| int | ty, | ||
| int | x, | ||
| int | y | ||
| ) |
Center Map on given map coordinate, with x & y offset.
| map | A MAP *map to center on tx+x , ty+y |
| tx | TILEX offset in tile |
| ty | TILEY offset in tile |
| x | X offset in pixel |
| y | Y Offset in pixel |
Definition at line 272 of file n_iso_engine.c.
| int camera_to_scr | ( | MAP ** | map, |
| int | x, | ||
| int | y | ||
| ) |
Center Map on given screen coordinate.
| map | A MAP *map to center on x,y |
| x | the X coordinate (in pixel) to center on; |
| y | the Y coordintae (in pixel) to center on; |
Definition at line 246 of file n_iso_engine.c.
| 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.
| map | the map pointer to point on the allocated one |
| name | Name of the map (used for linking between two map ) |
| XSIZE | the X size of the map (in tile) |
| YSIZE | the Y size of the map (in tile) |
| TILEW | the Width of a tile |
| TILEH | the Heigh of a tile |
| nbmaxobjects | the maximum number of objects in the map |
| nbmaxgroup | the maximum number of active objects in the map |
| nbmaxanims | the maximum number of aniations in the map |
| nbtiles | the maximum number of tiles in the map |
| nbanims | the maximum number of animations in the map |
Definition at line 28 of file n_iso_engine.c.
References Malloc, N_ABILITY, N_MUSIC, N_OBJECT, N_TILE, and set_value().
Referenced by load_map().
Here is the call graph for this function:
Here is the caller graph for this function:| int draw_map | ( | MAP * | map, |
| BITMAP * | bmp, | ||
| int | destx, | ||
| int | desty, | ||
| int | mode | ||
| ) |
Draw a MAP *map on the BITMAP *bmp.
| map | The Map to draw |
| bmp | The screen destination |
| destx | X offset on bmp |
| desty | Y offste on bmp |
| mode | Drawing mode |
Definition at line 290 of file n_iso_engine.c.
References MAP::colortile, MAP::grid, mode, MAP::ptanchorX, MAP::ptanchorY, MAP::TILEH, CELL::tilenumber, MAP::TILEW, MAP::wirecolor, MAP::X, MAP::XSIZE, MAP::Y, and MAP::YSIZE.
| int free_map | ( | MAP ** | map | ) |
Free the map.
| map | The map to free. The pointer will be set to NULL |
Definition at line 476 of file n_iso_engine.c.
References Free.
Referenced by load_map().
Here is the caller graph for this function:| int get_value | ( | MAP * | map, |
| int | type, | ||
| int | x, | ||
| int | y | ||
| ) |
Get a the tilenumber of a cell item.
| map | A MAP *map to 'touch' |
| type | It is the type of value to change , it can be N_TILE,N_ABILITY,N_MUSIC,N_OBJECT |
| x | X coordinate of the cell |
| y | Y coordinate of the cell |
Definition at line 157 of file n_iso_engine.c.
References CELL::ability, MAP::grid, CELL::music, N_ABILITY, N_MUSIC, N_OBJECT, N_TILE, CELL::objectnumber, CELL::tilenumber, MAP::XSIZE, and MAP::YSIZE.
| int load_map | ( | MAP ** | map, |
| char * | filename | ||
| ) |
Load the map from filename.
| map | A MAP *pointer to point on the loaded map |
| filename | The filename of the map to load |
Definition at line 359 of file n_iso_engine.c.
References MAP::bgcolor, create_empty_map(), free_map(), Malloc, MAP::ptanchorX, MAP::ptanchorY, MAP::TILEH, MAP::TILEW, MAP::wirecolor, MAP::X, MAP::XSIZE, MAP::Y, and MAP::YSIZE.
Here is the call graph for this function:| int save_map | ( | MAP * | map, |
| char * | filename | ||
| ) |
Save the map to filename.
| map | A MAP *pointer |
| filename | The filename of the file where to save the map |
Definition at line 430 of file n_iso_engine.c.
References CELL::ability, MAP::bgcolor, MAP::grid, CELL::music, MAP::name, CELL::objectnumber, MAP::ptanchorX, MAP::ptanchorY, MAP::TILEH, CELL::tilenumber, MAP::TILEW, MAP::wirecolor, MAP::X, MAP::XSIZE, MAP::Y, and MAP::YSIZE.
| int ScreenToMap | ( | int | mx, |
| int | my, | ||
| int * | Tilex, | ||
| int * | Tiley, | ||
| BITMAP * | mousemap | ||
| ) |
Convert screen coordinate to map coordinate.
| mx | The 'x' coordinate in pixel |
| my | The 'y' coordinate in pixel |
| Tilex | Output for the generated Tilex |
| Tiley | Output for the generated Tiley |
| mousemap | A mousemap with colors for one tile |
Definition at line 186 of file n_iso_engine.c.
| int set_value | ( | MAP * | map, |
| int | type, | ||
| int | x, | ||
| int | y, | ||
| int | value | ||
| ) |
Set the value of a cell in a map.
| map | A MAP *map to 'touch' |
| type | It is the type of value to change , it can be N_TILE,N_ABILITY,N_MUSIC,N_OBJECT |
| x | X coordinate of the cell |
| y | Y coordinate of the cell |
| value | Value to give to the cell |
Definition at line 118 of file n_iso_engine.c.
References CELL::ability, MAP::grid, CELL::music, N_ABILITY, N_MUSIC, N_OBJECT, N_TILE, CELL::objectnumber, CELL::tilenumber, MAP::XSIZE, and MAP::YSIZE.
Referenced by create_empty_map().
Here is the caller graph for this function: