75 if ((tileIndex >= map->nTiles) || (tileIndex < 0)) {
76 G3d_error(
"G3d_getTilePtr: tileIndex out of range");
83 G3d_error(
"G3d_getTilePtr: error in G3d_cache_elt_ptr");
89 if (map->currentIndex == tileIndex)
92 map->currentIndex = tileIndex;
93 if (!
G3d_readTile(map, map->currentIndex, map->data, map->typeIntern)) {
94 G3d_error(
"G3d_getTilePtr: error in G3d_readTile");
118 G3d_error(
"G3d_tileLoad: error in G3d_getTilePtr");
133 G3d_error(
"G3d_removeTile: error in G3d_cache_remove_elt");
177 if (map->typeIntern == DCELL_TYPE)
210 if (map->typeIntern == FCELL_TYPE)
246 if (type == FCELL_TYPE) {
int G3d__removeTile(G3D_Map *map, int tileIndex)
int G3d_tileLoad(G3D_Map *map, int tileIndex)
Same functionality as G3d_getTilePtr() but does not return the pointer.
void G3d_getValueRegion(G3D_Map *map, int x, int y, int z, void *value, int type)
Returns in *value the cell-value of the cell with region-coordinate (x, y, z). The value returned is ...
void G3d_error(const char *msg,...)
void * G3d_getTilePtr(G3D_Map *map, int tileIndex)
This function returns a pointer to a tile which contains the data for the tile with index tileIndex...
double G3d_getDoubleRegion()
Is equivalent to G3d_getValueRegion (map, x, y, z, &value, DCELL_TYPE); return value.
void * G3d_cache_elt_ptr(G3D_cache *c, int name)
int G3d_readTile(G3D_Map *map, int tileIndex, void *tile, int type)
Reads tile with index tileIndex into the tile buffer. The cells are stored with type type which must ...
int G3d_cache_remove_elt(G3D_cache *c, int name)
void G3d_coord2tileIndex(G3D_Map *map, int x, int y, int z, int *tileIndex, int *offset)
Converts cell-coordinates (x, y, z) into tileIndex and the offset of the cell within the tile...
void G3d_fatalError(const char *,...)
This function prints the error message msg, and terminates the program with an error status...
float G3d_getFloatRegion(G3D_Map *map, int x, int y, int z)
Is equivalent to G3d_getValueRegion (map, x, y, z, &value, FCELL_TYPE); return value.