diff --git a/doomsday/engine/portable/include/bsp_main.h b/doomsday/engine/portable/include/bsp_main.h index c1978df9d5..8cd725e46d 100644 --- a/doomsday/engine/portable/include/bsp_main.h +++ b/doomsday/engine/portable/include/bsp_main.h @@ -41,6 +41,6 @@ typedef double angle_g; // Degrees, 0 is E, 90 is N extern int bspFactor; void BSP_Register(void); -boolean BSP_Build(gamemap_t *map, vertex_t ***vertexes, +boolean BSP_Build(GameMap *map, vertex_t ***vertexes, uint *numVertexes); #endif diff --git a/doomsday/engine/portable/include/bsp_map.h b/doomsday/engine/portable/include/bsp_map.h index 363c2ee358..bba6aa6b45 100644 --- a/doomsday/engine/portable/include/bsp_map.h +++ b/doomsday/engine/portable/include/bsp_map.h @@ -39,6 +39,6 @@ struct superblock_s; -void BSP_InitForNodeBuild(gamemap_t* map); +void BSP_InitForNodeBuild(GameMap* map); #endif diff --git a/doomsday/engine/portable/include/bsp_node.h b/doomsday/engine/portable/include/bsp_node.h index b094fe8349..4ec10f2470 100644 --- a/doomsday/engine/portable/include/bsp_node.h +++ b/doomsday/engine/portable/include/bsp_node.h @@ -66,7 +66,7 @@ void BSP_AddHEdgeToSuperBlock(struct superblock_s *block, void ClockwiseBspTree(binarytree_t *rootNode); -void SaveMap(gamemap_t *dest, void *rootNode, vertex_t ***vertexes, +void SaveMap(GameMap *dest, void *rootNode, vertex_t ***vertexes, uint *numVertexes); typedef struct bspleafdata_s { diff --git a/doomsday/engine/portable/include/dam_file.h b/doomsday/engine/portable/include/dam_file.h index 37f6251709..d8060a6459 100644 --- a/doomsday/engine/portable/include/dam_file.h +++ b/doomsday/engine/portable/include/dam_file.h @@ -40,11 +40,11 @@ boolean DAM_MapIsValid(const char* cachedMapPath, lumpnum_t markerLumpNum); /** * Write the current state of the map into a Doomsday Archived Map. */ -boolean DAM_MapWrite(gamemap_t* map, const char* path); +boolean DAM_MapWrite(GameMap* map, const char* path); /** * Load a map from a Doomsday Archived Map. */ -boolean DAM_MapRead(gamemap_t* map, const char* path); +boolean DAM_MapRead(GameMap* map, const char* path); #endif /* LIBDENG_ARCHIVED_MAP_FILE_H */ diff --git a/doomsday/engine/portable/include/edit_map.h b/doomsday/engine/portable/include/edit_map.h index d923739ba9..0a235f3b09 100644 --- a/doomsday/engine/portable/include/edit_map.h +++ b/doomsday/engine/portable/include/edit_map.h @@ -97,6 +97,6 @@ boolean MPE_RegisterUnclosedSectorNear(sector_t* sec, double x, double y void MPE_PrintUnclosedSectorList(void); void MPE_FreeUnclosedSectorList(void); -gamemap_t* MPE_GetLastBuiltMap(void); +GameMap* MPE_GetLastBuiltMap(void); vertex_t* createVertex(void); #endif diff --git a/doomsday/engine/portable/include/gamemap.h b/doomsday/engine/portable/include/gamemap.h index 76911a6aa9..b6be26eb63 100644 --- a/doomsday/engine/portable/include/gamemap.h +++ b/doomsday/engine/portable/include/gamemap.h @@ -70,18 +70,18 @@ typedef struct gamemap_s { float globalGravity; // Gravity for the current map. int ambientLightLevel; // Ambient lightlevel for the current map. -} gamemap_t; +} GameMap; /** * This ID is the name of the lump tag that marks the beginning of map * data, e.g. "MAP03" or "E2M8". */ -const Uri* P_MapUri(gamemap_t* map); +const Uri* P_MapUri(GameMap* map); /// @return The 'unique' identifier of the map. -const char* P_GetUniqueMapId(gamemap_t* map); +const char* P_GetUniqueMapId(GameMap* map); -void P_GetMapBounds(gamemap_t* map, float* min, float* max); -int P_GetMapAmbientLightLevel(gamemap_t* map); +void P_GetMapBounds(GameMap* map, float* min, float* max); +int P_GetMapAmbientLightLevel(GameMap* map); #endif /// LIBDENG_GAMEMAP_H diff --git a/doomsday/engine/portable/include/p_bmap.h b/doomsday/engine/portable/include/p_bmap.h index ddf718f1ba..ce518e8f19 100644 --- a/doomsday/engine/portable/include/p_bmap.h +++ b/doomsday/engine/portable/include/p_bmap.h @@ -46,14 +46,14 @@ float bmapDebugSize; * @param min Minimal coordinates for the map. * @param max Maximal coordinates for the map. */ -void Map_InitMobjBlockmap(gamemap_t* map, const_pvec2_t min, const_pvec2_t max); +void Map_InitMobjBlockmap(GameMap* map, const_pvec2_t min, const_pvec2_t max); -void Map_LinkMobjInBlockmap(gamemap_t* map, mobj_t* mo); -boolean Map_UnlinkMobjInBlockmap(gamemap_t* map, mobj_t* mo); +void Map_LinkMobjInBlockmap(GameMap* map, mobj_t* mo); +boolean Map_UnlinkMobjInBlockmap(GameMap* map, mobj_t* mo); -int Map_IterateCellMobjs(gamemap_t* map, const uint coords[2], +int Map_IterateCellMobjs(GameMap* map, const uint coords[2], int (*callback) (struct mobj_s*, void*), void* paramaters); -int Map_IterateCellBlockMobjs(gamemap_t* map, const GridmapBlock* blockCoords, +int Map_IterateCellBlockMobjs(GameMap* map, const GridmapBlock* blockCoords, int (*callback) (struct mobj_s*, void*), void* paramaters); /** @@ -62,13 +62,13 @@ int Map_IterateCellBlockMobjs(gamemap_t* map, const GridmapBlock* blockCoords, * @param min Minimal coordinates for the map. * @param max Maximal coordinates for the map. */ -void Map_InitLineDefBlockmap(gamemap_t* map, const_pvec2_t min, const_pvec2_t max); +void Map_InitLineDefBlockmap(GameMap* map, const_pvec2_t min, const_pvec2_t max); -void Map_LinkLineDefInBlockmap(gamemap_t* map, linedef_t* lineDef); +void Map_LinkLineDefInBlockmap(GameMap* map, linedef_t* lineDef); -int Map_IterateCellLineDefs(gamemap_t* map, const uint coords[2], +int Map_IterateCellLineDefs(GameMap* map, const uint coords[2], int (*callback) (linedef_t*, void*), void* paramaters); -int Map_IterateCellBlockLineDefs(gamemap_t* map, const GridmapBlock* blockCoords, +int Map_IterateCellBlockLineDefs(GameMap* map, const GridmapBlock* blockCoords, int (*callback) (linedef_t*, void*), void* paramaters); /** @@ -77,14 +77,14 @@ int Map_IterateCellBlockLineDefs(gamemap_t* map, const GridmapBlock* blockCoords * @param min Minimal coordinates for the map. * @param max Maximal coordinates for the map. */ -void Map_InitSubsectorBlockmap(gamemap_t* map, const_pvec2_t min, const_pvec2_t max); +void Map_InitSubsectorBlockmap(GameMap* map, const_pvec2_t min, const_pvec2_t max); -void Map_LinkSubsectorInBlockmap(gamemap_t* map, subsector_t* subsector); +void Map_LinkSubsectorInBlockmap(GameMap* map, subsector_t* subsector); -int Map_IterateCellSubsectors(gamemap_t* map, const uint coords[2], +int Map_IterateCellSubsectors(GameMap* map, const uint coords[2], sector_t* sector, const AABoxf* box, int localValidCount, int (*callback) (subsector_t*, void*), void* paramaters); -int Map_IterateCellBlockSubsectors(gamemap_t* map, const GridmapBlock* blockCoords, +int Map_IterateCellBlockSubsectors(GameMap* map, const GridmapBlock* blockCoords, sector_t* sector, const AABoxf* box, int localValidCount, int (*callback) (subsector_t*, void*), void* paramaters); @@ -94,19 +94,19 @@ int Map_IterateCellBlockSubsectors(gamemap_t* map, const GridmapBlock* blockCoor * @param min Minimal coordinates for the map. * @param max Maximal coordinates for the map. */ -void Map_InitPolyobjBlockmap(gamemap_t* map, const_pvec2_t min, const_pvec2_t max); +void Map_InitPolyobjBlockmap(GameMap* map, const_pvec2_t min, const_pvec2_t max); -void Map_LinkPolyobjInBlockmap(gamemap_t* map, polyobj_t* po); -void Map_UnlinkPolyobjInBlockmap(gamemap_t* map, polyobj_t* po); +void Map_LinkPolyobjInBlockmap(GameMap* map, polyobj_t* po); +void Map_UnlinkPolyobjInBlockmap(GameMap* map, polyobj_t* po); -int Map_IterateCellPolyobjs(gamemap_t* map, const uint coords[2], +int Map_IterateCellPolyobjs(GameMap* map, const uint coords[2], int (*callback) (polyobj_t*, void*), void* paramaters); -int Map_IterateCellBlockPolyobjs(gamemap_t* map, const GridmapBlock* blockCoords, +int Map_IterateCellBlockPolyobjs(GameMap* map, const GridmapBlock* blockCoords, int (*callback) (polyobj_t*, void*), void* paramaters); -int Map_IterateCellPolyobjLineDefs(gamemap_t* map, const uint coords[2], +int Map_IterateCellPolyobjLineDefs(GameMap* map, const uint coords[2], int (*callback) (linedef_t*, void*), void* paramaters); -int Map_IterateCellBlockPolyobjLineDefs(gamemap_t* map, const GridmapBlock* blockCoords, +int Map_IterateCellBlockPolyobjLineDefs(GameMap* map, const GridmapBlock* blockCoords, int (*callback) (linedef_t*, void*), void* paramaters); /** diff --git a/doomsday/engine/portable/include/p_mapdata.h b/doomsday/engine/portable/include/p_mapdata.h index 4eb825ea9d..055d13d930 100644 --- a/doomsday/engine/portable/include/p_mapdata.h +++ b/doomsday/engine/portable/include/p_mapdata.h @@ -295,8 +295,8 @@ extern float mapGravity; #include "gamemap.h" -gamemap_t* P_GetCurrentMap(void); -void P_SetCurrentMap(gamemap_t* map); +GameMap* P_GetCurrentMap(void); +void P_SetCurrentMap(GameMap* map); const char* P_GenerateUniqueMapId(const char* mapId); diff --git a/doomsday/engine/portable/include/r_world.h b/doomsday/engine/portable/include/r_world.h index 61de1f3948..9684294da3 100644 --- a/doomsday/engine/portable/include/r_world.h +++ b/doomsday/engine/portable/include/r_world.h @@ -61,12 +61,12 @@ extern skyfix_t skyFix[2]; // [floor, ceiling] */ void R_SetupMap(int mode, int flags); -void R_InitLinks(gamemap_t* map); +void R_InitLinks(GameMap* map); /** * Polygonizes all subsectors in the map. */ -void R_PolygonizeMap(gamemap_t* map); +void R_PolygonizeMap(GameMap* map); void R_SetupFog(float start, float end, float density, float* rgb); void R_SetupFogDefaults(void); diff --git a/doomsday/engine/portable/include/s_environ.h b/doomsday/engine/portable/include/s_environ.h index fbc797ed7d..49359884ae 100644 --- a/doomsday/engine/portable/include/s_environ.h +++ b/doomsday/engine/portable/include/s_environ.h @@ -32,7 +32,7 @@ #include "p_mapdata.h" void S_CalcSectorReverb(sector_t* sec); -void S_DetermineSubsecsAffectingSectorReverb(gamemap_t* map); +void S_DetermineSubsecsAffectingSectorReverb(GameMap* map); /// @return Environment class name for identifier @a mclass. const char* S_MaterialEnvClassName(material_env_class_t mclass); diff --git a/doomsday/engine/portable/src/bsp_main.c b/doomsday/engine/portable/src/bsp_main.c index ccded8e71a..73777345dd 100644 --- a/doomsday/engine/portable/src/bsp_main.c +++ b/doomsday/engine/portable/src/bsp_main.c @@ -73,7 +73,7 @@ void BSP_Register(void) C_VAR_INT("bsp-factor", &bspFactor, CVF_NO_MAX, 0, 0); } -static void findMapLimits(gamemap_t* src, int* bbox) +static void findMapLimits(GameMap* src, int* bbox) { uint i; @@ -105,7 +105,7 @@ static void findMapLimits(gamemap_t* src, int* bbox) * * @return The list of created half-edges. */ -static superblock_t* createInitialHEdges(gamemap_t* map) +static superblock_t* createInitialHEdges(GameMap* map) { uint startTime = Sys_GetRealTime(); @@ -262,7 +262,7 @@ static boolean C_DECL freeBSPData(binarytree_t *tree, void *data) * @param numVertexes Number of vertexes in the array. * @return @c true, if completed successfully. */ -boolean BSP_Build(gamemap_t* map, vertex_t*** vertexes, uint* numVertexes) +boolean BSP_Build(GameMap* map, vertex_t*** vertexes, uint* numVertexes) { boolean builtOK; uint startTime; diff --git a/doomsday/engine/portable/src/bsp_map.c b/doomsday/engine/portable/src/bsp_map.c index d3f1e2176e..9a705dd3cf 100644 --- a/doomsday/engine/portable/src/bsp_map.c +++ b/doomsday/engine/portable/src/bsp_map.c @@ -52,7 +52,7 @@ // CODE -------------------------------------------------------------------- -static void hardenSidedefHEdgeList(gamemap_t* map, sidedef_t* side, HEdge* hedge, +static void hardenSidedefHEdgeList(GameMap* map, sidedef_t* side, HEdge* hedge, bsp_hedge_t* bspHEdge) { uint count; @@ -139,7 +139,7 @@ static boolean hEdgeCollector(binarytree_t* tree, void* data) return true; // Continue traversal. } -static void buildHEdgesFromBSPHEdges(gamemap_t* dest, binarytree_t* rootNode) +static void buildHEdgesFromBSPHEdges(GameMap* dest, binarytree_t* rootNode) { uint i; bsp_hedge_t** index; @@ -256,7 +256,7 @@ static void buildHEdgesFromBSPHEdges(gamemap_t* dest, binarytree_t* rootNode) M_Free(index); } -static void hardenSubsectorHEdgeList(gamemap_t* dest, subsector_t* ssec, +static void hardenSubsectorHEdgeList(GameMap* dest, subsector_t* ssec, bsp_hedge_t* list, size_t hedgeCount) { size_t i; @@ -275,7 +275,7 @@ static void hardenSubsectorHEdgeList(gamemap_t* dest, subsector_t* ssec, ssec->hedges = hedges; } -static void hardenLeaf(gamemap_t* map, subsector_t* dest, +static void hardenLeaf(GameMap* map, subsector_t* dest, const bspleafdata_t* src) { HEdge** segp; @@ -320,7 +320,7 @@ static void hardenLeaf(gamemap_t* map, subsector_t* dest, } typedef struct { - gamemap_t* dest; + GameMap* dest; uint subsectorCurIndex; uint nodeCurIndex; } hardenbspparams_t; @@ -413,7 +413,7 @@ static boolean C_DECL countSSec(binarytree_t* tree, void* data) return true; // Continue iteration. } -static void hardenBSP(gamemap_t* dest, binarytree_t* rootNode) +static void hardenBSP(GameMap* dest, binarytree_t* rootNode) { dest->numNodes = 0; BinaryTree_PostOrder(rootNode, countNode, &dest->numNodes); @@ -443,7 +443,7 @@ static void hardenBSP(gamemap_t* dest, binarytree_t* rootNode) } } -void BSP_InitForNodeBuild(gamemap_t* map) +void BSP_InitForNodeBuild(GameMap* map) { uint i; @@ -476,7 +476,7 @@ void BSP_InitForNodeBuild(gamemap_t* map) } } -static void hardenVertexes(gamemap_t* dest, vertex_t*** vertexes, +static void hardenVertexes(GameMap* dest, vertex_t*** vertexes, uint* numVertexes) { uint i; @@ -500,7 +500,7 @@ static void hardenVertexes(gamemap_t* dest, vertex_t*** vertexes, } } -static void updateVertexLinks(gamemap_t* dest) +static void updateVertexLinks(GameMap* dest) { uint i; @@ -513,7 +513,7 @@ static void updateVertexLinks(gamemap_t* dest) } } -void SaveMap(gamemap_t* dest, void* rootNode, vertex_t*** vertexes, +void SaveMap(GameMap* dest, void* rootNode, vertex_t*** vertexes, uint* numVertexes) { uint startTime = Sys_GetRealTime(); diff --git a/doomsday/engine/portable/src/dam_file.c b/doomsday/engine/portable/src/dam_file.c index 2303fb0661..905e73b46f 100644 --- a/doomsday/engine/portable/src/dam_file.c +++ b/doomsday/engine/portable/src/dam_file.c @@ -131,7 +131,7 @@ static void addMaterialToDict(materialdict_t* dict, material_t* mat) * Initializes the material archives (translation tables). * Must be called before writing the tables! */ -static void initMaterialDict(const gamemap_t* map, materialdict_t* dict) +static void initMaterialDict(const GameMap* map, materialdict_t* dict) { uint i, j; @@ -278,7 +278,7 @@ static void endSegment(void) writeLong(DAMSEG_END); } -static void writeVertex(const gamemap_t *map, uint idx) +static void writeVertex(const GameMap *map, uint idx) { vertex_t *v = &map->vertexes[idx]; @@ -300,7 +300,7 @@ static void writeVertex(const gamemap_t *map, uint idx) } } -static void readVertex(const gamemap_t *map, uint idx) +static void readVertex(const GameMap *map, uint idx) { uint i; vertex_t *v = &map->vertexes[idx]; @@ -334,7 +334,7 @@ static void readVertex(const gamemap_t *map, uint idx) } } -static void archiveVertexes(gamemap_t *map, boolean write) +static void archiveVertexes(GameMap *map, boolean write) { uint i; @@ -362,7 +362,7 @@ static void archiveVertexes(gamemap_t *map, boolean write) assertSegment(DAMSEG_END); } -static void writeLine(const gamemap_t *map, uint idx) +static void writeLine(const GameMap *map, uint idx) { int i; linedef_t *l = &map->lineDefs[idx]; @@ -386,7 +386,7 @@ static void writeLine(const gamemap_t *map, uint idx) writeByte(l->mapped[i]? 1 : 0); } -static void readLine(const gamemap_t *map, uint idx) +static void readLine(const GameMap *map, uint idx) { int i; long sideIdx; @@ -413,7 +413,7 @@ static void readLine(const gamemap_t *map, uint idx) l->mapped[i] = (readByte()? true : false); } -static void archiveLines(gamemap_t *map, boolean write) +static void archiveLines(GameMap *map, boolean write) { uint i; @@ -441,7 +441,7 @@ static void archiveLines(gamemap_t *map, boolean write) assertSegment(DAMSEG_END); } -static void writeSide(const gamemap_t *map, uint idx) +static void writeSide(const GameMap *map, uint idx) { uint i; sidedef_t *s = &map->sideDefs[idx]; @@ -470,7 +470,7 @@ static void writeSide(const gamemap_t *map, uint idx) writeLong((s->hedges[i] - map->hedges) + 1); } -static void readSide(const gamemap_t *map, uint idx) +static void readSide(const GameMap *map, uint idx) { uint i; long secIdx; @@ -508,7 +508,7 @@ static void readSide(const gamemap_t *map, uint idx) s->hedges[i] = NULL; // Terminate. } -static void archiveSides(gamemap_t *map, boolean write) +static void archiveSides(GameMap *map, boolean write) { uint i; @@ -536,7 +536,7 @@ static void archiveSides(gamemap_t *map, boolean write) assertSegment(DAMSEG_END); } -static void writeSector(const gamemap_t *map, uint idx) +static void writeSector(const GameMap *map, uint idx) { uint i; sector_t *s = &map->sectors[idx]; @@ -608,7 +608,7 @@ static void writeSector(const gamemap_t *map, uint idx) writeLong((s->reverbSubsectors[i] - map->subsectors) + 1); } -static void readSector(const gamemap_t *map, uint idx) +static void readSector(const GameMap *map, uint idx) { uint i, numPlanes; long secIdx; @@ -698,7 +698,7 @@ static void readSector(const gamemap_t *map, uint idx) s->reverbSubsectors[i] = NULL; // Terminate. } -static void archiveSectors(gamemap_t *map, boolean write) +static void archiveSectors(GameMap *map, boolean write) { uint i; @@ -726,7 +726,7 @@ static void archiveSectors(gamemap_t *map, boolean write) assertSegment(DAMSEG_END); } -static void writeSubsector(const gamemap_t *map, uint idx) +static void writeSubsector(const GameMap *map, uint idx) { uint i; subsector_t *s = &map->subsectors[idx]; @@ -751,7 +751,7 @@ static void writeSubsector(const gamemap_t *map, uint idx) writeLong((s->hedges[i] - map->hedges) + 1); } -static void readSubsector(const gamemap_t *map, uint idx) +static void readSubsector(const GameMap *map, uint idx) { uint i; long obIdx; @@ -781,7 +781,7 @@ static void readSubsector(const gamemap_t *map, uint idx) s->hedges[i] = NULL; // Terminate. } -static void archiveSubsectors(gamemap_t *map, boolean write) +static void archiveSubsectors(GameMap *map, boolean write) { uint i; @@ -809,7 +809,7 @@ static void archiveSubsectors(gamemap_t *map, boolean write) assertSegment(DAMSEG_END); } -static void writeSeg(const gamemap_t *map, uint idx) +static void writeSeg(const GameMap *map, uint idx) { HEdge *s = &map->hedges[idx]; @@ -827,7 +827,7 @@ static void writeSeg(const gamemap_t *map, uint idx) writeByte(s->flags); } -static void readSeg(const gamemap_t *map, uint idx) +static void readSeg(const GameMap *map, uint idx) { long obIdx; HEdge *s = &map->hedges[idx]; @@ -851,7 +851,7 @@ static void readSeg(const gamemap_t *map, uint idx) s->flags = readByte(); } -static void archiveSegs(gamemap_t *map, boolean write) +static void archiveSegs(GameMap *map, boolean write) { uint i; @@ -879,7 +879,7 @@ static void archiveSegs(gamemap_t *map, boolean write) assertSegment(DAMSEG_END); } -static void writeNode(const gamemap_t *map, uint idx) +static void writeNode(const GameMap *map, uint idx) { node_t *n = &map->nodes[idx]; @@ -899,7 +899,7 @@ static void writeNode(const gamemap_t *map, uint idx) writeLong((long) n->children[LEFT]); } -static void readNode(const gamemap_t *map, uint idx) +static void readNode(const GameMap *map, uint idx) { node_t *n = &map->nodes[idx]; @@ -919,7 +919,7 @@ static void readNode(const gamemap_t *map, uint idx) n->children[LEFT] = (uint) readLong(); } -static void archiveNodes(gamemap_t *map, boolean write) +static void archiveNodes(GameMap *map, boolean write) { uint i; @@ -947,7 +947,7 @@ static void archiveNodes(gamemap_t *map, boolean write) assertSegment(DAMSEG_END); } -static void archiveBlockmap(gamemap_t *map, boolean write) +static void archiveBlockmap(GameMap *map, boolean write) { if(write) beginSegment(DAMSEG_BLOCKMAP); @@ -960,7 +960,7 @@ static void archiveBlockmap(gamemap_t *map, boolean write) assertSegment(DAMSEG_END); } -static void archiveReject(gamemap_t *map, boolean write) +static void archiveReject(GameMap *map, boolean write) { if(write) beginSegment(DAMSEG_REJECT); @@ -973,7 +973,7 @@ static void archiveReject(gamemap_t *map, boolean write) assertSegment(DAMSEG_END); } -static void writePolyobj(const gamemap_t* map, uint idx) +static void writePolyobj(const GameMap* map, uint idx) { polyobj_t* p = map->polyObjs[idx]; uint i; @@ -1014,7 +1014,7 @@ static void writePolyobj(const gamemap_t* map, uint idx) } } -static void readPolyobj(const gamemap_t* map, uint idx) +static void readPolyobj(const GameMap* map, uint idx) { polyobj_t* p = map->polyObjs[idx]; long obIdx; @@ -1070,7 +1070,7 @@ static void readPolyobj(const gamemap_t* map, uint idx) p->lines[i] = NULL; // Terminate. } -static void archivePolyobjs(gamemap_t* map, boolean write) +static void archivePolyobjs(GameMap* map, boolean write) { uint i; @@ -1099,18 +1099,18 @@ static void archivePolyobjs(gamemap_t* map, boolean write) } /* -static void writeThing(const gamemap_t *map, uint idx) +static void writeThing(const GameMap *map, uint idx) { } -static void readThing(const gamemap_t *map, uint idx) +static void readThing(const GameMap *map, uint idx) { } */ -static void archiveMap(gamemap_t *map, boolean write) +static void archiveMap(GameMap *map, boolean write) { if(write) beginSegment(DAMSEG_MAP); @@ -1220,7 +1220,7 @@ static void archiveHeader(boolean write) assertSegment(DAMSEG_END); } -static boolean doArchiveMap(gamemap_t* map, const char* path, boolean write) +static boolean doArchiveMap(GameMap* map, const char* path, boolean write) { if(NULL == path || !path[0]) return false; @@ -1248,12 +1248,12 @@ static boolean doArchiveMap(gamemap_t* map, const char* path, boolean write) return true; } -boolean DAM_MapWrite(gamemap_t* map, const char* path) +boolean DAM_MapWrite(GameMap* map, const char* path) { return doArchiveMap(map, path, true); } -boolean DAM_MapRead(gamemap_t* map, const char* path) +boolean DAM_MapRead(GameMap* map, const char* path) { return doArchiveMap(map, path, false); } diff --git a/doomsday/engine/portable/src/dam_main.c b/doomsday/engine/portable/src/dam_main.c index aebe86ceef..72e9d4dac5 100644 --- a/doomsday/engine/portable/src/dam_main.c +++ b/doomsday/engine/portable/src/dam_main.c @@ -423,15 +423,15 @@ ddstring_t* DAM_ComposeCacheDir(const char* sourcePath) return path; } -static boolean loadMap(gamemap_t** map, archivedmap_t* dam) +static boolean loadMap(GameMap** map, archivedmap_t* dam) { - *map = (gamemap_t*) Z_Calloc(sizeof(**map), PU_MAPSTATIC, 0); + *map = (GameMap*) Z_Calloc(sizeof(**map), PU_MAPSTATIC, 0); if(NULL == *map) Con_Error("loadMap: Failed on allocation of %lu bytes for new Map.", (unsigned long) sizeof(**map)); return DAM_MapRead(*map, Str_Text(&dam->cachedMapPath)); } -static boolean convertMap(gamemap_t** map, archivedmap_t* dam) +static boolean convertMap(GameMap** map, archivedmap_t* dam) { boolean converted = false; @@ -517,7 +517,7 @@ boolean DAM_AttemptMapLoad(const Uri* uri) // Load it in. if(!dam->lastLoadAttemptFailed) { - gamemap_t* map = NULL; + GameMap* map = NULL; ded_mapinfo_t* mapInfo; Z_FreeTags(PU_MAP, PU_PURGELEVEL - 1); diff --git a/doomsday/engine/portable/src/dd_main.c b/doomsday/engine/portable/src/dd_main.c index 638eaf8e5c..e2f7add8f1 100644 --- a/doomsday/engine/portable/src/dd_main.c +++ b/doomsday/engine/portable/src/dd_main.c @@ -2050,7 +2050,7 @@ int DD_GetInteger(int ddvalue) return Cl_CurrentFinale(); case DD_MAP_MUSIC: { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); ded_mapinfo_t* mapInfo = Def_GetMapInfo(P_MapUri(map)); if(!mapInfo) return -1; return Def_GetMusicNum(mapInfo->music); @@ -2118,7 +2118,7 @@ void* DD_GetVariable(int ddvalue) return translationTables; case DD_MAP_NAME: { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); ded_mapinfo_t* mapInfo = Def_GetMapInfo(P_MapUri(map)); if(mapInfo && mapInfo->name[0]) { @@ -2132,7 +2132,7 @@ void* DD_GetVariable(int ddvalue) break; } case DD_MAP_AUTHOR: { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); ded_mapinfo_t* mapInfo = Def_GetMapInfo(P_MapUri(map)); if(mapInfo && mapInfo->author[0]) @@ -2140,28 +2140,28 @@ void* DD_GetVariable(int ddvalue) break; } case DD_MAP_MIN_X: { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); if(map) return &map->bBox[BOXLEFT]; else return NULL; } case DD_MAP_MIN_Y: { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); if(map) return &map->bBox[BOXBOTTOM]; else return NULL; } case DD_MAP_MAX_X: { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); if(map) return &map->bBox[BOXRIGHT]; else return NULL; } case DD_MAP_MAX_Y: { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); if(map) return &map->bBox[BOXTOP]; else diff --git a/doomsday/engine/portable/src/edit_bias.c b/doomsday/engine/portable/src/edit_bias.c index 0b1c20880d..30b46c74a8 100644 --- a/doomsday/engine/portable/src/edit_bias.c +++ b/doomsday/engine/portable/src/edit_bias.c @@ -384,7 +384,7 @@ static void SBE_Dupe(int which) static boolean SBE_Save(const char* name) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); const char* uid = P_GetUniqueMapId(map); ddstring_t fileName; source_t* s; @@ -839,7 +839,7 @@ void SBE_DrawHUD(void) Point2Raw origin; Size2Raw size; char buf[80]; - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); source_t* s; int top; diff --git a/doomsday/engine/portable/src/edit_map.c b/doomsday/engine/portable/src/edit_map.c index e65aa83167..b0dbd68ab4 100644 --- a/doomsday/engine/portable/src/edit_map.c +++ b/doomsday/engine/portable/src/edit_map.c @@ -68,7 +68,7 @@ editmap_t editMap; static boolean editMapInited = false; static editmap_t* map = &editMap; -static gamemap_t *lastBuiltMap = NULL; +static GameMap *lastBuiltMap = NULL; static uint numUnclosedSectors; static usecrecord_t *unclosedSectors; @@ -604,7 +604,7 @@ boolean MPE_Begin(const char* mapUri) return true; } -static void hardenSectorSSecList(gamemap_t* map, uint secIDX) +static void hardenSectorSSecList(GameMap* map, uint secIDX) { assert(map && secIDX < map->numSectors); { @@ -642,7 +642,7 @@ static void hardenSectorSSecList(gamemap_t* map, uint secIDX) /** * Build subsector tables for all sectors. */ -static void buildSectorSSecLists(gamemap_t *map) +static void buildSectorSSecLists(GameMap *map) { VERBOSE( Con_Message(" Build subsector tables...\n") ) { uint i; @@ -652,7 +652,7 @@ static void buildSectorSSecLists(gamemap_t *map) }} } -static void buildSectorLineLists(gamemap_t* map) +static void buildSectorLineLists(GameMap* map) { typedef struct linelink_s { linedef_t* line; @@ -816,7 +816,7 @@ void P_GetSectorBounds(sector_t *sec, float *min, float *max) max[VY] = sec->bBox[BOXTOP]; } -static void finishSectors(gamemap_t* map) +static void finishSectors(GameMap* map) { uint i; for(i = 0; i < map->numSectors; ++i) @@ -854,7 +854,7 @@ static void finishSectors(gamemap_t* map) * sector ptrs which we couldn't do earlier as the sidedefs * hadn't been loaded at the time. */ -static void finishLineDefs(gamemap_t* map) +static void finishLineDefs(GameMap* map) { uint i; linedef_t *ld; @@ -918,7 +918,7 @@ static void finishLineDefs(gamemap_t* map) } } -static void updateMapBounds(gamemap_t* map) +static void updateMapBounds(GameMap* map) { assert(map); { @@ -980,7 +980,7 @@ static void updateSSecMidPoint(subsector_t *sub) sub->worldGridOffset[VY] = fmod(sub->aaBox.maxY, 64); } -static void prepareSubsectors(gamemap_t* map) +static void prepareSubsectors(GameMap* map) { uint i; @@ -1191,7 +1191,7 @@ static void buildVertexOwnerRings(editmap_t* map) } } -static void hardenVertexOwnerRings(gamemap_t* dest, editmap_t* src) +static void hardenVertexOwnerRings(GameMap* dest, editmap_t* src) { uint i; @@ -1274,7 +1274,7 @@ do } } -static void hardenLinedefs(gamemap_t *dest, editmap_t *src) +static void hardenLinedefs(GameMap *dest, editmap_t *src) { uint i; @@ -1300,7 +1300,7 @@ static void hardenLinedefs(gamemap_t *dest, editmap_t *src) } } -static void hardenSidedefs(gamemap_t* dest, editmap_t* src) +static void hardenSidedefs(GameMap* dest, editmap_t* src) { uint i; @@ -1326,7 +1326,7 @@ static void hardenSidedefs(gamemap_t* dest, editmap_t* src) } } -static void hardenSectors(gamemap_t* dest, editmap_t* src) +static void hardenSectors(GameMap* dest, editmap_t* src) { uint i; @@ -1344,7 +1344,7 @@ static void hardenSectors(gamemap_t* dest, editmap_t* src) } } -static void hardenPlanes(gamemap_t* dest, editmap_t* src) +static void hardenPlanes(GameMap* dest, editmap_t* src) { uint i, j; @@ -1369,7 +1369,7 @@ static void hardenPlanes(gamemap_t* dest, editmap_t* src) } } -static void hardenPolyobjs(gamemap_t* dest, editmap_t* src) +static void hardenPolyobjs(GameMap* dest, editmap_t* src) { uint i; @@ -1705,7 +1705,7 @@ int testOverlaps(linedef_t* b, void* data) } typedef struct { - gamemap_t* map; + GameMap* map; uint coords[2]; // Blockmap cell coordinates. } findoverlaps_params_t; @@ -1719,7 +1719,7 @@ int findOverlapsForLinedef(linedef_t* l, void* data) /** * \note Does not detect partially overlapping lines! */ -void MPE_DetectOverlappingLines(gamemap_t* map) +void MPE_DetectOverlappingLines(GameMap* map) { uint x, y, bmapDimensions[2]; findoverlaps_params_t params; @@ -1792,7 +1792,7 @@ static void findBounds(vertex_t const** vertexes, uint numVertexes, vec2_t min, */ boolean MPE_End(void) { - gamemap_t* gamemap; + GameMap* gamemap; boolean builtOK; vec2_t min, max; uint i; @@ -1956,7 +1956,7 @@ boolean MPE_End(void) return true; } -gamemap_t* MPE_GetLastBuiltMap(void) +GameMap* MPE_GetLastBuiltMap(void) { return lastBuiltMap; } diff --git a/doomsday/engine/portable/src/gamemap.c b/doomsday/engine/portable/src/gamemap.c index 936a2179e7..f5c90c2989 100644 --- a/doomsday/engine/portable/src/gamemap.c +++ b/doomsday/engine/portable/src/gamemap.c @@ -25,19 +25,19 @@ #include "gamemap.h" -const Uri* P_MapUri(gamemap_t* map) +const Uri* P_MapUri(GameMap* map) { if(!map) return NULL; return map->uri; } -const char* P_GetUniqueMapId(gamemap_t* map) +const char* P_GetUniqueMapId(GameMap* map) { if(!map) return NULL; return map->uniqueId; } -void P_GetMapBounds(gamemap_t* map, float* min, float* max) +void P_GetMapBounds(GameMap* map, float* min, float* max) { min[VX] = map->bBox[BOXLEFT]; min[VY] = map->bBox[BOXBOTTOM]; @@ -49,7 +49,7 @@ void P_GetMapBounds(gamemap_t* map, float* min, float* max) /** * Get the ambient light level of the specified map. */ -int P_GetMapAmbientLightLevel(gamemap_t* map) +int P_GetMapAmbientLightLevel(GameMap* map) { assert(map); return map->ambientLightLevel; diff --git a/doomsday/engine/portable/src/gl_main.c b/doomsday/engine/portable/src/gl_main.c index b5e2647069..0e944adc72 100644 --- a/doomsday/engine/portable/src/gl_main.c +++ b/doomsday/engine/portable/src/gl_main.c @@ -753,7 +753,7 @@ void GL_TotalReset(void) void GL_TotalRestore(void) { ded_mapinfo_t* mapInfo = NULL; - gamemap_t* map; + GameMap* map; if(isDedicated) return; diff --git a/doomsday/engine/portable/src/p_bmap.c b/doomsday/engine/portable/src/p_bmap.c index 8768cf0fa3..3a9bd8f384 100644 --- a/doomsday/engine/portable/src/p_bmap.c +++ b/doomsday/engine/portable/src/p_bmap.c @@ -317,7 +317,7 @@ boolean Blockmap_CreateCellAndLinkObject(Blockmap* blockmap, uint coords[2], voi return Blockmap_CreateCellAndLinkObjectXY(blockmap, coords[VX], coords[VY], object); } -void Map_InitLineDefBlockmap(gamemap_t* map, const_pvec2_t min_, const_pvec2_t max_) +void Map_InitLineDefBlockmap(GameMap* map, const_pvec2_t min_, const_pvec2_t max_) { #define BLOCKMAP_MARGIN 8 // size guardband around map #define CELL_SIZE MAPBLOCKUNITS @@ -338,7 +338,7 @@ void Map_InitLineDefBlockmap(gamemap_t* map, const_pvec2_t min_, const_pvec2_t m #undef BLOCKMAP_MARGIN } -void Map_InitMobjBlockmap(gamemap_t* map, const_pvec2_t min_, const_pvec2_t max_) +void Map_InitMobjBlockmap(GameMap* map, const_pvec2_t min_, const_pvec2_t max_) { #define BLOCKMAP_MARGIN 8 // size guardband around map #define CELL_SIZE MAPBLOCKUNITS @@ -359,7 +359,7 @@ void Map_InitMobjBlockmap(gamemap_t* map, const_pvec2_t min_, const_pvec2_t max_ #undef BLOCKMAP_MARGIN } -void Map_InitPolyobjBlockmap(gamemap_t* map, const_pvec2_t min_, const_pvec2_t max_) +void Map_InitPolyobjBlockmap(GameMap* map, const_pvec2_t min_, const_pvec2_t max_) { #define BLOCKMAP_MARGIN 8 // size guardband around map #define CELL_SIZE MAPBLOCKUNITS @@ -380,7 +380,7 @@ void Map_InitPolyobjBlockmap(gamemap_t* map, const_pvec2_t min_, const_pvec2_t m #undef BLOCKMAP_MARGIN } -void Map_InitSubsectorBlockmap(gamemap_t* map, const_pvec2_t min_, const_pvec2_t max_) +void Map_InitSubsectorBlockmap(GameMap* map, const_pvec2_t min_, const_pvec2_t max_) { #define BLOCKMAP_MARGIN 8 // size guardband around map #define CELL_SIZE MAPBLOCKUNITS @@ -401,7 +401,7 @@ void Map_InitSubsectorBlockmap(gamemap_t* map, const_pvec2_t min_, const_pvec2_t #undef BLOCKMAP_MARGIN } -void Map_LinkMobjInBlockmap(gamemap_t* map, mobj_t* mo) +void Map_LinkMobjInBlockmap(GameMap* map, mobj_t* mo) { Blockmap* blockmap = map->mobjBlockmap; uint coords[2]; @@ -409,7 +409,7 @@ void Map_LinkMobjInBlockmap(gamemap_t* map, mobj_t* mo) Blockmap_CreateCellAndLinkObject(blockmap, coords, mo); } -boolean Map_UnlinkMobjInBlockmap(gamemap_t* map, mobj_t* mo) +boolean Map_UnlinkMobjInBlockmap(GameMap* map, mobj_t* mo) { Blockmap* blockmap = map->mobjBlockmap; BlockmapCell* cell; @@ -425,7 +425,7 @@ boolean Map_UnlinkMobjInBlockmap(gamemap_t* map, mobj_t* mo) return unlinked; } -void Map_LinkLineDefInBlockmap(gamemap_t* map, linedef_t* lineDef) +void Map_LinkLineDefInBlockmap(GameMap* map, linedef_t* lineDef) { vec2_t origin, cellSize, cell, from, to; GridmapBlock blockCoords; @@ -479,7 +479,7 @@ void Map_LinkLineDefInBlockmap(gamemap_t* map, linedef_t* lineDef) } } -void Map_LinkSubsectorInBlockmap(gamemap_t* map, subsector_t* ssec) +void Map_LinkSubsectorInBlockmap(GameMap* map, subsector_t* ssec) { Blockmap* blockmap = map->subsectorBlockmap; GridmapBlock blockCoords; @@ -503,7 +503,7 @@ void Map_LinkSubsectorInBlockmap(gamemap_t* map, subsector_t* ssec) } } -void Map_LinkPolyobjInBlockmap(gamemap_t* map, polyobj_t* po) +void Map_LinkPolyobjInBlockmap(GameMap* map, polyobj_t* po) { Blockmap* blockmap = map->polyobjBlockmap; GridmapBlock blockCoords; @@ -518,7 +518,7 @@ void Map_LinkPolyobjInBlockmap(gamemap_t* map, polyobj_t* po) } } -void Map_UnlinkPolyobjInBlockmap(gamemap_t* map, polyobj_t* po) +void Map_UnlinkPolyobjInBlockmap(GameMap* map, polyobj_t* po) { Blockmap* blockmap = map->polyobjBlockmap; GridmapBlock blockCoords; @@ -559,7 +559,7 @@ static int blockmapCellLinesIterator(void* ptr, void* context) return result; } -int Map_IterateCellLineDefs(gamemap_t* map, const uint coords[2], +int Map_IterateCellLineDefs(GameMap* map, const uint coords[2], int (*func) (linedef_t*, void*), void* data) { Blockmap* blockmap = map->lineDefBlockmap; @@ -575,7 +575,7 @@ int Map_IterateCellLineDefs(gamemap_t* map, const uint coords[2], return false; } -int Map_IterateCellBlockLineDefs(gamemap_t* map, const GridmapBlock* blockCoords, +int Map_IterateCellBlockLineDefs(GameMap* map, const GridmapBlock* blockCoords, int (*func) (linedef_t*, void*), void* data) { Blockmap* blockmap = map->lineDefBlockmap; @@ -618,7 +618,7 @@ static int blockmapCellPolyobjsIterator(void* ptr, void* context) return result; } -int Map_IterateCellPolyobjs(gamemap_t* map, const uint coords[2], +int Map_IterateCellPolyobjs(GameMap* map, const uint coords[2], int (*func) (polyobj_t*, void*), void* data) { Blockmap* blockmap = map->polyobjBlockmap; @@ -634,7 +634,7 @@ int Map_IterateCellPolyobjs(gamemap_t* map, const uint coords[2], return false; } -int Map_IterateCellBlockPolyobjs(gamemap_t* map, const GridmapBlock* blockCoords, +int Map_IterateCellBlockPolyobjs(GameMap* map, const GridmapBlock* blockCoords, int (*func) (polyobj_t*, void*), void* data) { Blockmap* blockmap = map->polyobjBlockmap; @@ -656,7 +656,7 @@ int PTR_PolyobjLines(polyobj_t* po, void* data) return Polyobj_LineIterator(po, args->func, args->param); } -int Map_IterateCellPolyobjLineDefsIterator(gamemap_t* map, const uint coords[2], +int Map_IterateCellPolyobjLineDefsIterator(GameMap* map, const uint coords[2], int (*func) (linedef_t*, void*), void* data) { Blockmap* blockmap = map->polyobjBlockmap; @@ -676,7 +676,7 @@ int Map_IterateCellPolyobjLineDefsIterator(gamemap_t* map, const uint coords[2], return false; } -int Map_IterateCellBlockPolyobjLineDefs(gamemap_t* map, const GridmapBlock* blockCoords, +int Map_IterateCellBlockPolyobjLineDefs(GameMap* map, const GridmapBlock* blockCoords, int (*callback) (linedef_t*, void*), void* paramaters) { Blockmap* blockmap = map->polyobjBlockmap; @@ -725,7 +725,7 @@ static int blockmapCellMobjsIterator(void* ptr, void* paramaters) return result; } -int Map_IterateCellMobjs(gamemap_t* map, const uint coords[2], +int Map_IterateCellMobjs(GameMap* map, const uint coords[2], int (*func) (mobj_t*, void*), void* data) { Blockmap* blockmap = map->mobjBlockmap; @@ -741,7 +741,7 @@ int Map_IterateCellMobjs(gamemap_t* map, const uint coords[2], return false; } -int Map_IterateCellBlockMobjs(gamemap_t* map, const GridmapBlock* blockCoords, +int Map_IterateCellBlockMobjs(GameMap* map, const GridmapBlock* blockCoords, int (*func) (mobj_t*, void*), void* data) { Blockmap* blockmap = map->mobjBlockmap; @@ -804,7 +804,7 @@ static int blockmapCellSubsectorsIterator(void* ptr, void* context) return result; } -int Map_IterateCellSubsectors(gamemap_t* map, const uint coords[2], +int Map_IterateCellSubsectors(GameMap* map, const uint coords[2], sector_t* sector, const AABoxf* box, int localValidCount, int (*func) (subsector_t*, void*), void* paramaters) { @@ -823,7 +823,7 @@ int Map_IterateCellSubsectors(gamemap_t* map, const uint coords[2], return false; } -int Map_IterateCellBlockSubsectors(gamemap_t* map, const GridmapBlock* blockCoords, +int Map_IterateCellBlockSubsectors(GameMap* map, const GridmapBlock* blockCoords, sector_t* sector, const AABoxf* box, int localValidCount, int (*func) (subsector_t*, void*), void* data) { @@ -1161,7 +1161,7 @@ static int countSubsectorLink(subsector_t* subsector, void* paramaters) static void drawLineDefCellInfoBox(const Point2Raw* origin, uint coords[2]) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); uint count = 0; char info[160]; validCount++; @@ -1172,7 +1172,7 @@ static void drawLineDefCellInfoBox(const Point2Raw* origin, uint coords[2]) static void drawMobjCellInfoBox(const Point2Raw* origin, uint coords[2]) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); uint count = 0; char info[160]; validCount++; @@ -1183,7 +1183,7 @@ static void drawMobjCellInfoBox(const Point2Raw* origin, uint coords[2]) static void drawPolyobjCellInfoBox(const Point2Raw* origin, uint coords[2]) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); uint count = 0; char info[160]; validCount++; @@ -1194,7 +1194,7 @@ static void drawPolyobjCellInfoBox(const Point2Raw* origin, uint coords[2]) static void drawSubsectorCellInfoBox(const Point2Raw* origin, uint coords[2]) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); uint count = 0; char info[160]; validCount++; @@ -1392,7 +1392,7 @@ void Rend_BlockmapDebug(void) mobj_t* followMobj = NULL; Blockmap* blockmap; Point2Raw origin; - gamemap_t* map; + GameMap* map; float scale; // Disabled? diff --git a/doomsday/engine/portable/src/p_data.c b/doomsday/engine/portable/src/p_data.c index 7ee60ec2f7..e851244c12 100644 --- a/doomsday/engine/portable/src/p_data.c +++ b/doomsday/engine/portable/src/p_data.c @@ -103,7 +103,7 @@ float mapGravity; // PRIVATE DATA DEFINITIONS ------------------------------------------------ -static gamemap_t* currentMap = NULL; +static GameMap* currentMap = NULL; // Bad texture list static uint numBadTexNames = 0; @@ -159,12 +159,12 @@ const char* P_GenerateUniqueMapId(const char* mapID) /** * @return Ptr to the current map. */ -gamemap_t *P_GetCurrentMap(void) +GameMap *P_GetCurrentMap(void) { return currentMap; } -void P_SetCurrentMap(gamemap_t* map) +void P_SetCurrentMap(GameMap* map) { if(!map) { @@ -256,38 +256,6 @@ void P_SetCurrentMap(gamemap_t* map) currentMap = map; } -const Uri* P_MapUri(gamemap_t* map) -{ - if(!map) return NULL; - return map->uri; -} - -const char* P_GetUniqueMapId(gamemap_t* map) -{ - if(!map) return NULL; - return map->uniqueId; -} - -void P_GetMapBounds(gamemap_t* map, float* min, float* max) -{ - min[VX] = map->bBox[BOXLEFT]; - min[VY] = map->bBox[BOXBOTTOM]; - - max[VX] = map->bBox[BOXRIGHT]; - max[VY] = map->bBox[BOXTOP]; -} - -/** - * Get the ambient light level of the specified map. - */ -int P_GetMapAmbientLightLevel(gamemap_t* map) -{ - if(!map) - return 0; - - return map->ambientLightLevel; -} - /// \note Part of the Doomsday public API. boolean P_MapExists(const char* uriCString) { @@ -366,7 +334,7 @@ boolean P_LoadMap(const char* uriCString) if(DAM_AttemptMapLoad(uri)) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); // Init the thinker lists (public and private). P_InitThinkerLists(0x1 | 0x2); @@ -869,7 +837,7 @@ static uint countGameMapObjs(gameobjdata_t *moData, int identifier) uint P_CountGameMapObjs(int identifier) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); return countGameMapObjs(&map->gameObjData, identifier); } @@ -1154,7 +1122,7 @@ static void setValue(void *dst, valuetype_t dstType, void *src, byte P_GetGMOByte(int identifier, uint elmIdx, int propIdentifier) { valuetype_t type; - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); void* ptr; byte returnVal = 0; @@ -1168,7 +1136,7 @@ byte P_GetGMOByte(int identifier, uint elmIdx, int propIdentifier) short P_GetGMOShort(int identifier, uint elmIdx, int propIdentifier) { valuetype_t type; - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); void* ptr; short returnVal = 0; @@ -1182,7 +1150,7 @@ short P_GetGMOShort(int identifier, uint elmIdx, int propIdentifier) int P_GetGMOInt(int identifier, uint elmIdx, int propIdentifier) { valuetype_t type; - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); void* ptr; int returnVal = 0; @@ -1196,7 +1164,7 @@ int P_GetGMOInt(int identifier, uint elmIdx, int propIdentifier) fixed_t P_GetGMOFixed(int identifier, uint elmIdx, int propIdentifier) { valuetype_t type; - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); void* ptr; fixed_t returnVal = 0; @@ -1210,7 +1178,7 @@ fixed_t P_GetGMOFixed(int identifier, uint elmIdx, int propIdentifier) angle_t P_GetGMOAngle(int identifier, uint elmIdx, int propIdentifier) { valuetype_t type; - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); void* ptr; angle_t returnVal = 0; @@ -1224,7 +1192,7 @@ angle_t P_GetGMOAngle(int identifier, uint elmIdx, int propIdentifier) float P_GetGMOFloat(int identifier, uint elmIdx, int propIdentifier) { valuetype_t type; - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); void* ptr; float returnVal = 0; diff --git a/doomsday/engine/portable/src/p_maputil.c b/doomsday/engine/portable/src/p_maputil.c index e846354481..9931b09b97 100644 --- a/doomsday/engine/portable/src/p_maputil.c +++ b/doomsday/engine/portable/src/p_maputil.c @@ -569,13 +569,13 @@ boolean P_UnlinkFromLines(mobj_t* mo) */ void P_LinkToBlockmap(mobj_t* mo) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); Map_LinkMobjInBlockmap(map, mo); } boolean P_UnlinkFromBlockmap(mobj_t* mo) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); return Map_UnlinkMobjInBlockmap(map, mo); } @@ -668,7 +668,7 @@ void P_LinkToLines(mobj_t* mo) */ void P_MobjLink(mobj_t* mo, byte flags) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); sector_t* sec; // Link into the sector. @@ -877,7 +877,7 @@ int P_SectorTouchingMobjsIterator(sector_t* sector, int P_MobjsBoxIterator(const AABoxf* box, int (*func) (mobj_t*, void*), void* paramaters) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); GridmapBlock blockCoords; Blockmap_CellBlockCoords(map->mobjBlockmap, &blockCoords, box); return Map_IterateCellBlockMobjs(map, &blockCoords, func, paramaters); @@ -890,7 +890,7 @@ int P_MobjsBoxIterator(const AABoxf* box, int (*func) (mobj_t*, void*), void* pa */ int P_PolyobjsBoxIterator(const AABoxf* box, int (*callback) (struct polyobj_s*, void*), void* paramaters) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); GridmapBlock blockCoords; Blockmap_CellBlockCoords(map->polyobjBlockmap, &blockCoords, box); return Map_IterateCellBlockPolyobjs(map, &blockCoords, callback, paramaters); @@ -898,7 +898,7 @@ int P_PolyobjsBoxIterator(const AABoxf* box, int (*callback) (struct polyobj_s*, int P_LinesBoxIterator(const AABoxf* box, int (*callback) (linedef_t*, void*), void* paramaters) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); GridmapBlock blockCoords; Blockmap_CellBlockCoords(map->lineDefBlockmap, &blockCoords, box); return Map_IterateCellBlockLineDefs(map, &blockCoords, callback, paramaters); @@ -908,7 +908,7 @@ int P_SubsectorsBoxIterator(const AABoxf* box, sector_t* sector, int (*callback) (subsector_t*, void*), void* paramaters) { static int localValidCount = 0; - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); GridmapBlock blockCoords; // This is only used here. localValidCount++; @@ -920,7 +920,7 @@ int P_SubsectorsBoxIterator(const AABoxf* box, sector_t* sector, int P_PolyobjLinesBoxIterator(const AABoxf* box, int (*callback) (linedef_t*, void*), void* paramaters) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); GridmapBlock blockCoords; Blockmap_CellBlockCoords(map->polyobjBlockmap, &blockCoords, box); return Map_IterateCellBlockPolyobjLineDefs(map, &blockCoords, callback, paramaters); @@ -1224,7 +1224,7 @@ static int iteratePolyobjLineDefs(polyobj_t* po, void* paramaters) static int collectPolyobjLineDefIntercepts(uint const block[2], void* paramaters) { - gamemap_t* map = (gamemap_t*)paramaters; + GameMap* map = (GameMap*)paramaters; iteratepolyobjlinedefs_params_t iplParams; iplParams.callback = PIT_AddLineDefIntercepts; iplParams.paramaters = NULL; @@ -1233,13 +1233,13 @@ static int collectPolyobjLineDefIntercepts(uint const block[2], void* paramaters static int collectLineDefIntercepts(uint const block[2], void* paramaters) { - gamemap_t* map = (gamemap_t*)paramaters; + GameMap* map = (GameMap*)paramaters; return Map_IterateCellLineDefs(map, block, PIT_AddLineDefIntercepts, NULL); } static int collectMobjIntercepts(uint const block[2], void* paramaters) { - gamemap_t* map = (gamemap_t*)paramaters; + GameMap* map = (GameMap*)paramaters; return Map_IterateCellMobjs(map, block, PIT_AddMobjIntercepts, NULL); } @@ -1248,7 +1248,7 @@ static int collectMobjIntercepts(uint const block[2], void* paramaters) * interceptable object linked within Blockmap cells which cover the path this * defines. */ -int Map_PathTraverse(gamemap_t* map, float const from[2], float const to[2], +int Map_PathTraverse(GameMap* map, float const from[2], float const to[2], int flags, traverser_t callback, void* paramaters) { // A new intercept trace begins... @@ -1277,7 +1277,7 @@ int Map_PathTraverse(gamemap_t* map, float const from[2], float const to[2], int P_PathTraverse2(float const from[2], float const to[2], int flags, traverser_t callback, void* paramaters) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); return Map_PathTraverse(map, from, to, flags, callback, paramaters); } diff --git a/doomsday/engine/portable/src/p_objlink.c b/doomsday/engine/portable/src/p_objlink.c index 9d09a65883..a3dc7ff557 100644 --- a/doomsday/engine/portable/src/p_objlink.c +++ b/doomsday/engine/portable/src/p_objlink.c @@ -226,7 +226,7 @@ static objlink_t* allocObjlink(void) void R_InitObjlinkBlockmapForMap(void) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); float min[2], max[2]; uint width, height; int i; diff --git a/doomsday/engine/portable/src/p_polyob.c b/doomsday/engine/portable/src/p_polyob.c index 37419bd195..3060487c10 100644 --- a/doomsday/engine/portable/src/p_polyob.c +++ b/doomsday/engine/portable/src/p_polyob.c @@ -400,13 +400,13 @@ boolean P_PolyobjRotate(polyobj_t* po, angle_t angle) void P_PolyobjUnlink(polyobj_t* po) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); Map_UnlinkPolyobjInBlockmap(map, po); } void P_PolyobjLink(polyobj_t* po) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); Map_LinkPolyobjInBlockmap(map, po); } @@ -449,7 +449,7 @@ int PTR_checkMobjBlocking(mobj_t* mo, void* data) static boolean checkMobjBlocking(linedef_t* line, polyobj_t* po) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); ptrmobjblockingparams_t params; GridmapBlock blockCoords; AABoxf aaBox; diff --git a/doomsday/engine/portable/src/r_lgrid.c b/doomsday/engine/portable/src/r_lgrid.c index 4cb2aec822..b7b157dd7e 100644 --- a/doomsday/engine/portable/src/r_lgrid.c +++ b/doomsday/engine/portable/src/r_lgrid.c @@ -178,7 +178,7 @@ void LG_InitForMap(void) sector_t **ssamples; sector_t **blkSampleSectors; - gamemap_t *map = P_GetCurrentMap(); + GameMap *map = P_GetCurrentMap(); if(!lgEnabled) { diff --git a/doomsday/engine/portable/src/r_world.c b/doomsday/engine/portable/src/r_world.c index 693f877d1f..97c4ab9132 100644 --- a/doomsday/engine/portable/src/r_world.c +++ b/doomsday/engine/portable/src/r_world.c @@ -528,7 +528,7 @@ static boolean markSurfaceForDecorationUpdate(surface_t* surface, void* paramate void R_UpdateMapSurfacesOnMaterialChange(material_t* material) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); if(NULL == material || NULL == map || ddMapSetup) return; // Light decorations will need a refresh. @@ -1078,7 +1078,7 @@ linedef_t *R_FindLineAlignNeighbor(const sector_t *sec, #undef SEP } -void R_InitLinks(gamemap_t* map) +void R_InitLinks(GameMap* map) { uint starttime = 0; @@ -1233,7 +1233,7 @@ static void tessellateSubsector(subsector_t* ssec, boolean force) #undef MIN_TRIANGLE_EPSILON } -void R_PolygonizeMap(gamemap_t* map) +void R_PolygonizeMap(GameMap* map) { uint startTime = Sys_GetRealTime(); uint i; @@ -1257,7 +1257,7 @@ void R_PolygonizeMap(gamemap_t* map) * The test is done on subsectors. */ #if 0 /* Currently unused. */ -static sector_t *getContainingSectorOf(gamemap_t* map, sector_t* sec) +static sector_t *getContainingSectorOf(GameMap* map, sector_t* sec) { uint i; float cdiff = -1, diff; @@ -1402,7 +1402,7 @@ void R_SetupMap(int mode, int flags) return; } case DDSMM_FINALIZE: { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); ded_mapinfo_t* mapInfo; float startTime; char cmd[80]; @@ -1501,7 +1501,7 @@ void R_SetupMap(int mode, int flags) } case DDSMM_AFTER_BUSY: { // Shouldn't do anything time-consuming, as we are no longer in busy mode. - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); ded_mapinfo_t* mapInfo = Def_GetMapInfo(P_MapUri(map)); if(!mapInfo || !(mapInfo->flags & MIF_FOG)) diff --git a/doomsday/engine/portable/src/rend_main.c b/doomsday/engine/portable/src/rend_main.c index bf6c3cea07..4cb6347fbd 100644 --- a/doomsday/engine/portable/src/rend_main.c +++ b/doomsday/engine/portable/src/rend_main.c @@ -3446,7 +3446,7 @@ void Rend_RenderMap(void) */ void Rend_CalcLightModRange(void) { - gamemap_t* map = P_GetCurrentMap(); + GameMap* map = P_GetCurrentMap(); int j, mapAmbient; float f; @@ -3454,6 +3454,12 @@ void Rend_CalcLightModRange(void) memset(lightModRange, 0, sizeof(float) * 255); + if(!map) + { + rAmbient = 0; + return; + } + mapAmbient = P_GetMapAmbientLightLevel(map); if(mapAmbient > ambientLight) rAmbient = mapAmbient; diff --git a/doomsday/engine/portable/src/s_environ.c b/doomsday/engine/portable/src/s_environ.c index f4bffd5c52..3a1786c07d 100644 --- a/doomsday/engine/portable/src/s_environ.c +++ b/doomsday/engine/portable/src/s_environ.c @@ -149,7 +149,7 @@ static void setSubsectorSectorOwner(ownerlist_t* ownerList, subsector_t* ssec) ownerList->head = node; } -static void findSubsectorsAffectingSector(gamemap_t* map, uint secIDX) +static void findSubsectorsAffectingSector(GameMap* map, uint secIDX) { assert(map && secIDX < map->numSectors); { @@ -230,7 +230,7 @@ Con_Message("sector %i: (%f,%f) - (%f,%f)\n", c, * two dimensions at least), they do not move and are not created/destroyed * once the map has been loaded; this step can be pre-processed. */ -void S_DetermineSubsecsAffectingSectorReverb(gamemap_t* map) +void S_DetermineSubsecsAffectingSectorReverb(GameMap* map) { uint startTime = Sys_GetRealTime(); diff --git a/doomsday/engine/portable/src/sv_main.c b/doomsday/engine/portable/src/sv_main.c index fa70935726..23154c9547 100644 --- a/doomsday/engine/portable/src/sv_main.c +++ b/doomsday/engine/portable/src/sv_main.c @@ -71,7 +71,7 @@ static MaterialArchive* materialDict; */ void Sv_GetInfo(serverinfo_t* info) { - gamemap_t* currentMap = P_GetCurrentMap(); + GameMap* currentMap = P_GetCurrentMap(); ddstring_t* mapPath; int i;