Nilorea Library

- Main Page
- Modules
- Data Structures
- Files

All Data Structures Files Functions Variables Typedefs Macros Groups
Data Structures | Macros | Typedefs | Functions
ISOMETRIC: isometric engine, maps, tiles,...

## Data Structures

struct | CELL
struct | MAP

## Macros

#define | N_TILE 2
#define | N_ABILITY 3
#define | N_MUSIC 4
#define | N_OBJECT 5
#define | WALK 1
#define | SWIM 2
#define | BLCK 3

## Typedefs

typedef struct CELL | CELL
typedef struct MAP | MAP

## Functions

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. More...
int | set_value (MAP *map, int type, int x, int y, int value)
| Set the value of a cell in a map. More...
int | get_value (MAP *map, int type, int x, int y)
| Get a the tilenumber of a cell item. More...
int | ScreenToMap (int mx, int my, int *Tilex, int *Tiley, BITMAP *mousemap)
| Convert screen coordinate to map coordinate. More...
int | camera_to_scr (MAP **map, int x, int y)
| Center Map on given screen coordinate. More...
int | camera_to_map (MAP **map, int tx, int ty, int x, int y)
| Center Map on given map coordinate, with x & y offset. More...
int | draw_map (MAP *map, BITMAP *bmp, int destx, int desty, int mode)
| Draw a MAP *map on the BITMAP *bmp. More...
int | load_map (MAP **map, char *filename)
| Load the map from filename. More...
int | save_map (MAP *map, char *filename)
| Save the map to filename. More...
int | free_map (MAP **map)
| Free the map. More...

## Detailed Description

## Macro Definition Documentation

#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.

## Typedef Documentation

typedef struct CELL CELL

Cell of a MAP

typedef struct MAP MAP

MAP with objects, tiles, skins

## Function Documentation

camera_to_map | ( | MAP ** | map,
|  | int | tx,
|  | int | ty,
|  | int | x,
|  | int | y
| ) |  |

Center Map on given map coordinate, with x & y offset.

Parameters

  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

Returns
  TRUE

Definition at line 296 of file n_iso_engine.c.

camera_to_scr | ( | MAP ** | map,
|  | int | x,
|  | int | y
| ) |  |

Center Map on given screen coordinate.

Parameters

  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;

Returns
  TRUE

Definition at line 267 of file n_iso_engine.c.

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.

Parameters

  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

Returns
  TRUE on success FALSE on failure

Definition at line 27 of file n_iso_engine.c.

Here is the call graph for this function:

Here is the caller graph for this function:

draw_map | ( | MAP * | map,
|  | BITMAP * | bmp,
|  | int | destx,
|  | int | desty,
|  | int | mode
| ) |  |

Draw a MAP *map on the BITMAP *bmp.

Parameters

  map | The Map to draw
  bmp | The screen destination
  destx | X offset on bmp
  desty | Y offste on bmp
  mode | Drawing mode

Returns
  TRUE

Definition at line 318 of file n_iso_engine.c.

free_map | ( | MAP ** | map | ) |

Free the map.

Parameters

  map | The map to free. The pointer will be set to NULL

Returns
  TRUE or FALSE

Definition at line 526 of file n_iso_engine.c.

Here is the caller graph for this function:

get_value | ( | MAP * | map,
|  | int | type,
|  | int | x,
|  | int | y
| ) |  |

Get a the tilenumber of a cell item.

Parameters

  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

Returns
  The specified type value of the cell, or FALSE if unavailable

Definition at line 167 of file n_iso_engine.c.

load_map | ( | MAP ** | map,
|  | char * | filename
| ) |  |

Load the map from filename.

Parameters

  map | A MAP *pointer to point on the loaded map
  filename | The filename of the map to load

Returns
  TRUE or FALSE

Definition at line 398 of file n_iso_engine.c.

Here is the call graph for this function:

save_map | ( | MAP * | map,
|  | char * | filename
| ) |  |

Save the map to filename.

Parameters

  map | A MAP *pointer
  filename | The filename of the file where to save the map

Returns
  TRUE or FALSE

Definition at line 475 of file n_iso_engine.c.

ScreenToMap | ( | int | mx,
|  | int | my,
|  | int * | Tilex,
|  | int * | Tiley,
|  | BITMAP * | mousemap
| ) |  |

Convert screen coordinate to map coordinate.

Parameters

  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

Returns
  TRUE

Definition at line 201 of file n_iso_engine.c.

set_value | ( | MAP * | map,
|  | int | type,
|  | int | x,
|  | int | y,
|  | int | value
| ) |  |

Set the value of a cell in a map.

Parameters

  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

Returns
  TRUE or FALSE

Definition at line 120 of file n_iso_engine.c.

Here is the caller graph for this function: