Skip to content

Commit

Permalink
Refactor: Renamed gamemap_t as GameMap
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Mar 3, 2012
1 parent 7b66ea1 commit 9baeee6
Show file tree
Hide file tree
Showing 29 changed files with 188 additions and 214 deletions.
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/bsp_main.h
Expand Up @@ -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
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/bsp_map.h
Expand Up @@ -39,6 +39,6 @@

struct superblock_s;

void BSP_InitForNodeBuild(gamemap_t* map);
void BSP_InitForNodeBuild(GameMap* map);

#endif
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/bsp_node.h
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/portable/include/dam_file.h
Expand Up @@ -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 */
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/edit_map.h
Expand Up @@ -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
10 changes: 5 additions & 5 deletions doomsday/engine/portable/include/gamemap.h
Expand Up @@ -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
40 changes: 20 additions & 20 deletions doomsday/engine/portable/include/p_bmap.h
Expand Up @@ -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);

/**
Expand All @@ -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);

/**
Expand All @@ -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);

Expand All @@ -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);

/**
Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/portable/include/p_mapdata.h
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/portable/include/r_world.h
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/s_environ.h
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions doomsday/engine/portable/src/bsp_main.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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;
Expand Down
20 changes: 10 additions & 10 deletions doomsday/engine/portable/src/bsp_map.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand All @@ -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;

Expand All @@ -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();
Expand Down

0 comments on commit 9baeee6

Please sign in to comment.