Skip to content

Commit

Permalink
Refactor: Renamed sidedef_t as SideDef
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Mar 10, 2012
1 parent 755e941 commit 32b59c4
Show file tree
Hide file tree
Showing 41 changed files with 124 additions and 124 deletions.
2 changes: 1 addition & 1 deletion doomsday/engine/api/doomsday.h
Expand Up @@ -68,7 +68,7 @@ extern "C" {
typedef struct bspnode_s { int type; } BspNode;
typedef struct vertex_s {int type; } vertex_t;
typedef struct linedef_s { int type; } LineDef;
typedef struct sidedef_s { int type; } sidedef_t;
typedef struct sidedef_s { int type; } SideDef;
typedef struct hedge_s { int type; } HEdge;
typedef struct bspleaf_s { int type; } BspLeaf;
typedef struct sector_s { int type; } sector_t;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/edit_map.h
Expand Up @@ -39,7 +39,7 @@ typedef struct editmap_s {
uint numLineDefs;
LineDef** lineDefs;
uint numSideDefs;
sidedef_t** sideDefs;
SideDef** sideDefs;
uint numSectors;
sector_t** sectors;
uint numPolyObjs;
Expand Down
8 changes: 4 additions & 4 deletions doomsday/engine/portable/include/gamemap.h
Expand Up @@ -97,7 +97,7 @@ typedef struct gamemap_s {
LineDef* lineDefs;

uint numSideDefs;
sidedef_t* sideDefs;
SideDef* sideDefs;

uint numPolyObjs;
polyobj_t** polyObjs;
Expand Down Expand Up @@ -222,7 +222,7 @@ LineDef* GameMap_LineDef(GameMap* map, uint idx);
* @param idx Unique index of the sidedef.
* @return Pointer to SideDef with this index else @c NULL if @a idx is not valid.
*/
sidedef_t* GameMap_SideDef(GameMap* map, uint idx);
SideDef* GameMap_SideDef(GameMap* map, uint idx);

/**
* Lookup a Sector by its unique index.
Expand Down Expand Up @@ -285,7 +285,7 @@ int GameMap_LineDefIndex(GameMap* map, LineDef* line);
* @param side SideDef to lookup.
* @return Unique index for the SideDef else @c -1 if not present.
*/
int GameMap_SideDefIndex(GameMap* map, sidedef_t* side);
int GameMap_SideDefIndex(GameMap* map, SideDef* side);

/**
* Lookup the unique index for @a sector.
Expand Down Expand Up @@ -682,7 +682,7 @@ int GameMap_PolyobjIterator(GameMap* map, int (*callback) (polyobj_t*, void*), v

int GameMap_VertexIterator(GameMap* map, int (*callback) (vertex_t*, void*), void* parameters);

int GameMap_SideDefIterator(GameMap* map, int (*callback) (sidedef_t*, void*), void* parameters);
int GameMap_SideDefIterator(GameMap* map, int (*callback) (SideDef*, void*), void* parameters);

int GameMap_SectorIterator(GameMap* map, int (*callback) (sector_t*, void*), void* parameters);

Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/mapdata.hs
Expand Up @@ -403,7 +403,7 @@ typedef struct msidedef_s {
} msidedef_t;
end

struct sidedef
struct SideDef
- surface_t[3] sections
UINT uint hedgeCount
PTR hedge_s** hedges // [hedgeCount] size, segs arranged left>right
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/p_mapdata.h
Expand Up @@ -179,7 +179,7 @@ extern sector_t* sectors;
extern BspLeaf* bspLeafs;
extern BspNode* bspNodes;
extern LineDef* lineDefs;
extern sidedef_t* sideDefs;
extern SideDef* sideDefs;
extern polyobj_t** polyObjs; ///< List of all polyobjs on the current map.

#include "gamemap.h"
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/p_maptypes.h
Expand Up @@ -393,7 +393,7 @@ typedef struct sidedef_s {
shadowcorner_t bottomCorners[2];
shadowcorner_t sideCorners[2];
edgespan_t spans[2]; // [left, right]
} sidedef_t;
} SideDef;

// Helper macros for accessing linedef data elements.
#define L_v(n) v[(n)? 1:0]
Expand Down
10 changes: 5 additions & 5 deletions doomsday/engine/portable/include/p_sidedef.h
@@ -1,4 +1,4 @@
/**\file p_sidedef.h
/**\file sidedef.h
*\section License
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
Expand Down Expand Up @@ -38,7 +38,7 @@
*
* @param sideDef SideDef instance.
*/
void SideDef_UpdateOrigin(sidedef_t* side);
void SideDef_UpdateOrigin(SideDef* side);

/**
* Update the SideDef's map space surface tangents according to the points
Expand All @@ -47,16 +47,16 @@ void SideDef_UpdateOrigin(sidedef_t* side);
*
* @param sideDef SideDef instance.
*/
void SideDef_UpdateSurfaceTangents(sidedef_t* sideDef);
void SideDef_UpdateSurfaceTangents(SideDef* sideDef);

/**
* Get the value of a sidedef property, selected by DMU_* name.
*/
int SideDef_GetProperty(const sidedef_t* sideDef, setargs_t* args);
int SideDef_GetProperty(const SideDef* sideDef, setargs_t* args);

/**
* Update the sidedef, property is selected by DMU_* name.
*/
int SideDef_SetProperty(sidedef_t* sideDef, const setargs_t* args);
int SideDef_SetProperty(SideDef* sideDef, const setargs_t* args);

#endif /* LIBDENG_MAP_SIDEDEF_H */
4 changes: 2 additions & 2 deletions doomsday/engine/portable/src/bsp_main.c
Expand Up @@ -160,7 +160,7 @@ static superblock_t* createInitialHEdges(GameMap* map)

if(line->sideDefs[FRONT])
{
sidedef_t *side = line->sideDefs[FRONT];
SideDef* side = line->sideDefs[FRONT];

if(!side->sector)
Con_Message("Warning: Bad sidedef on linedef #%d\n", line->buildData.index);
Expand All @@ -174,7 +174,7 @@ static superblock_t* createInitialHEdges(GameMap* map)

if(line->sideDefs[BACK])
{
sidedef_t *side = line->sideDefs[BACK];
SideDef* side = line->sideDefs[BACK];

if(!side->sector)
Con_Message("Warning: Bad sidedef on linedef #%d\n", line->buildData.index);
Expand Down
6 changes: 3 additions & 3 deletions doomsday/engine/portable/src/bsp_map.c
Expand Up @@ -52,7 +52,7 @@

// CODE --------------------------------------------------------------------

static void hardenSidedefHEdgeList(GameMap* map, sidedef_t* side, HEdge* hedge,
static void hardenSidedefHEdgeList(GameMap* map, SideDef* side, HEdge* hedge,
bsp_hedge_t* bspHEdge)
{
uint count;
Expand Down Expand Up @@ -233,7 +233,7 @@ static void buildHEdgesFromBSPHEdges(GameMap* dest, binarytree_t* rootNode)
// Front first
if(hedge->lineDef && HEDGE_SIDEDEF(hedge))
{
sidedef_t* side = HEDGE_SIDEDEF(hedge);
SideDef* side = HEDGE_SIDEDEF(hedge);
surface_t* surface = &side->SW_topsurface;

surface->normal[VY] = (hedge->HE_v1pos[VX] - hedge->HE_v2pos[VX]) / hedge->length;
Expand Down Expand Up @@ -305,7 +305,7 @@ static void hardenLeaf(GameMap* map, BspLeaf* dest,
HEdge* hedge = *segp;
if(!found && hedge->lineDef && HEDGE_SIDEDEF(hedge))
{
sidedef_t* side = HEDGE_SIDEDEF(hedge);
SideDef* side = HEDGE_SIDEDEF(hedge);
dest->sector = side->sector;
found = true;
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/src/cl_world.c
Expand Up @@ -734,7 +734,7 @@ void Cl_ReadSideDelta2(int deltaType, boolean skip)
byte lineFlags = 0, sideFlags = 0;
float toprgb[3] = {0,0,0}, midrgba[4] = {0,0,0,0};
float bottomrgb[3] = {0,0,0};
sidedef_t *sid;
SideDef* sid;

// First read all the data.
num = Reader_ReadUInt16(msgReader);
Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/portable/src/dam_file.c
Expand Up @@ -326,7 +326,7 @@ static void archiveLines(GameMap *map, boolean write)
static void writeSide(const GameMap *map, uint idx)
{
uint i;
sidedef_t *s = &map->sideDefs[idx];
SideDef *s = &map->sideDefs[idx];

for(i = 0; i < 3; ++i)
{
Expand Down Expand Up @@ -357,7 +357,7 @@ static void readSide(const GameMap *map, uint idx)
uint i;
long secIdx;
float offset[2], rgba[4];
sidedef_t *s = &map->sideDefs[idx];
SideDef *s = &map->sideDefs[idx];

for(i = 0; i < 3; ++i)
{
Expand Down
22 changes: 11 additions & 11 deletions doomsday/engine/portable/src/edit_map.c
Expand Up @@ -109,9 +109,9 @@ static LineDef* createLine(void)
return line;
}

static sidedef_t* createSide(void)
static SideDef* createSide(void)
{
sidedef_t* side;
SideDef* side;

side = M_Calloc(sizeof(*side));
side->header.type = DMU_SIDEDEF;
Expand Down Expand Up @@ -198,7 +198,7 @@ static void destroyEditableSideDefs(editmap_t *map)
uint i;
for(i = 0; i < map->numSideDefs; ++i)
{
sidedef_t *side = map->sideDefs[i];
SideDef *side = map->sideDefs[i];
M_Free(side);
}

Expand Down Expand Up @@ -420,7 +420,7 @@ static void pruneUnusedSidedefs(editmap_t* map)

for(i = 0, newNum = 0; i < map->numSideDefs; ++i)
{
sidedef_t* s = map->sideDefs[i];
SideDef* s = map->sideDefs[i];

if(s->buildData.refCount == 0)
{
Expand Down Expand Up @@ -454,7 +454,7 @@ static void pruneUnusedSectors(editmap_t* map)

for(i = 0; i < map->numSideDefs; ++i)
{
sidedef_t* s = map->sideDefs[i];
SideDef* s = map->sideDefs[i];

if(s->sector)
s->sector->buildData.refCount++;
Expand Down Expand Up @@ -1305,12 +1305,12 @@ static void hardenSidedefs(GameMap* dest, editmap_t* src)
uint i;

dest->numSideDefs = src->numSideDefs;
dest->sideDefs = Z_Malloc(dest->numSideDefs * sizeof(sidedef_t), PU_MAPSTATIC, 0);
dest->sideDefs = Z_Malloc(dest->numSideDefs * sizeof(SideDef), PU_MAPSTATIC, 0);

for(i = 0; i < dest->numSideDefs; ++i)
{
sidedef_t* destS = &dest->sideDefs[i];
sidedef_t* srcS = src->sideDefs[i];
SideDef* destS = &dest->sideDefs[i];
SideDef* srcS = src->sideDefs[i];

memcpy(destS, srcS, sizeof(*destS));
destS->sector = &dest->sectors[srcS->sector->buildData.index - 1];
Expand Down Expand Up @@ -1475,7 +1475,7 @@ static void testForWindowEffect(editmap_t* map, LineDef* l)
LineDef* n = map->lineDefs[i];
double dist;
boolean isFront;
sidedef_t* hitSide;
SideDef* hitSide;
double dX2, dY2;

if(n == l || LINE_SELFREF(n) /*|| n->buildData.overlap ||
Expand Down Expand Up @@ -2049,7 +2049,7 @@ uint MPE_SidedefCreate(uint sector, short flags,
float bottomRed, float bottomGreen,
float bottomBlue)
{
sidedef_t* s;
SideDef* s;

if(!editMapInited)
return 0;
Expand Down Expand Up @@ -2092,7 +2092,7 @@ uint MPE_LinedefCreate(uint v1, uint v2, uint frontSide, uint backSide,
int flags)
{
LineDef* l;
sidedef_t* front = NULL, *back = NULL;
SideDef* front = NULL, *back = NULL;
vertex_t* vtx1, *vtx2;
float length, dx, dy;

Expand Down
10 changes: 5 additions & 5 deletions doomsday/engine/portable/src/gamemap.c
Expand Up @@ -158,14 +158,14 @@ LineDef* GameMap_LineDef(GameMap* map, uint idx)
return &map->lineDefs[idx];
}

int GameMap_SideDefIndex(GameMap* map, sidedef_t* side)
int GameMap_SideDefIndex(GameMap* map, SideDef* side)
{
assert(map);
if(!side || !(side >= map->sideDefs && side <= &map->sideDefs[map->numSideDefs])) return -1;
return side - map->sideDefs;
}

sidedef_t* GameMap_SideDef(GameMap* map, uint idx)
SideDef* GameMap_SideDef(GameMap* map, uint idx)
{
assert(map);
if(idx >= map->numSideDefs) return NULL;
Expand Down Expand Up @@ -326,15 +326,15 @@ static void initPolyobj(polyobj_t* po)
for(lineIter = po->lines; *lineIter; lineIter++)
{
LineDef* line = *lineIter;
sidedef_t* front = line->L_frontside;
SideDef* front = line->L_frontside;

front->SW_topinflags |= SUIF_NO_RADIO;
front->SW_middleinflags |= SUIF_NO_RADIO;
front->SW_bottominflags |= SUIF_NO_RADIO;

if(line->L_backside)
{
sidedef_t* back = line->L_backside;
SideDef* back = line->L_backside;

back->SW_topinflags |= SUIF_NO_RADIO;
back->SW_middleinflags |= SUIF_NO_RADIO;
Expand Down Expand Up @@ -1081,7 +1081,7 @@ int GameMap_VertexIterator(GameMap* map, int (*callback) (vertex_t*, void*), voi
return false; // Continue iteration.
}

int GameMap_SideDefIterator(GameMap* map, int (*callback) (sidedef_t*, void*), void* parameters)
int GameMap_SideDefIterator(GameMap* map, int (*callback) (SideDef*, void*), void* parameters)
{
uint i;
assert(map);
Expand Down
8 changes: 4 additions & 4 deletions doomsday/engine/portable/src/linedef.c
Expand Up @@ -168,7 +168,7 @@ int LineDef_MiddleMaterialCoords(const LineDef* lineDef, int side,
{
float* top[2], *bottom[2], openingTop[2], openingBottom[2]; // {left, right}
float tcYOff;
sidedef_t* sideDef;
SideDef* sideDef;
int i, texHeight;
assert(lineDef && bottomLeft && bottomRight && topLeft && topRight);

Expand Down Expand Up @@ -234,7 +234,7 @@ int LineDef_MiddleMaterialCoords(const LineDef* lineDef, int side,
}

/**
* @fixme No need to do this each frame. Set a flag in sidedef_t->flags to
* @fixme No need to do this each frame. Set a flag in SideDef->flags to
* denote this. Is sensitive to plane heights, surface properties
* (e.g. alpha) and surface texture properties.
*/
Expand All @@ -244,7 +244,7 @@ boolean LineDef_MiddleMaterialCoversOpening(const LineDef *line, int side,
assert(line);
if(line->L_backside)
{
sidedef_t* sideDef = line->L_side(side);
SideDef* sideDef = line->L_side(side);
sector_t* frontSec = line->L_sector(side);
sector_t* backSec = line->L_sector(side^1);

Expand Down Expand Up @@ -374,7 +374,7 @@ int LineDef_SetProperty(LineDef* lin, const setargs_t* args)
DMU_SetValue(DMT_LINEDEF_VALIDCOUNT, &lin->validCount, args, 0);
break;
case DMU_FLAGS: {
sidedef_t* s;
SideDef* s;

DMU_SetValue(DMT_LINEDEF_FLAGS, &lin->flags, args, 0);

Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/src/p_data.c
Expand Up @@ -56,7 +56,7 @@ sector_t* sectors = NULL;
BspLeaf* bspLeafs = NULL;
BspNode* bspNodes = NULL;
LineDef* lineDefs = NULL;
sidedef_t* sideDefs = NULL;
SideDef* sideDefs = NULL;
polyobj_t** polyObjs = NULL; // List of all poly-objects in the map.

GameMap* theMap = NULL;
Expand Down

0 comments on commit 32b59c4

Please sign in to comment.