Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Mar 15, 2013
1 parent bd29df6 commit ac4e195
Show file tree
Hide file tree
Showing 40 changed files with 659 additions and 657 deletions.
18 changes: 9 additions & 9 deletions doomsday/api/api_map.h
Expand Up @@ -80,9 +80,9 @@
#define DMT_SECTOR_RGB DDVT_FLOAT
#define DMT_SECTOR_MOBJLIST DDVT_PTR // List of mobjs in the sector.
#define DMT_SECTOR_LINEDEFCOUNT DDVT_UINT
#define DMT_SECTOR_LINEDEFS DDVT_PTR // [lineDefCount+1] size.
#define DMT_SECTOR_LINEDEFS DDVT_PTR
#define DMT_SECTOR_BSPLEAFCOUNT DDVT_UINT
#define DMT_SECTOR_BSPLEAFS DDVT_PTR // [bspLeafCount+1] size.
#define DMT_SECTOR_BSPLEAFS DDVT_PTR
#define DMT_SECTOR_BASE DDVT_PTR
#define DMT_SECTOR_PLANECOUNT DDVT_UINT
#define DMT_SECTOR_REVERB DDVT_FLOAT
Expand Down Expand Up @@ -196,13 +196,13 @@ DENG_API_TYPEDEF(Map)

// Lines

int (*LD_BoxOnSide)(LineDef* line, const AABoxd* box);
int (*LD_BoxOnSide_FixedPrecision)(LineDef* line, const AABoxd* box);
coord_t (*LD_PointDistance)(LineDef* lineDef, coord_t const point[2], coord_t* offset);
coord_t (*LD_PointXYDistance)(LineDef* lineDef, coord_t x, coord_t y, coord_t* offset);
coord_t (*LD_PointOnSide)(LineDef const *lineDef, coord_t const point[2]);
coord_t (*LD_PointXYOnSide)(LineDef const *lineDef, coord_t x, coord_t y);
int (*LD_MobjsIterator)(LineDef* line, int (*callback) (struct mobj_s*, void *), void* parameters);
int (*LD_BoxOnSide)(LineDef *line, AABoxd const *box);
int (*LD_BoxOnSide_FixedPrecision)(LineDef *line, AABoxd const *box);
coord_t (*LD_PointDistance)(LineDef* line, coord_t const point[2], coord_t *offset);
coord_t (*LD_PointXYDistance)(LineDef* line, coord_t x, coord_t y, coord_t *offset);
coord_t (*LD_PointOnSide)(LineDef const *line, coord_t const point[2]);
coord_t (*LD_PointXYOnSide)(LineDef const *line, coord_t x, coord_t y);
int (*LD_MobjsIterator)(LineDef *line, int (*callback) (struct mobj_s *, void *), void *parameters);

// Sectors

Expand Down
8 changes: 4 additions & 4 deletions doomsday/api/dd_share.h
Expand Up @@ -629,15 +629,15 @@ typedef enum intercepttype_e {
} intercepttype_t;

typedef struct intercept_s {
float distance; // Along trace vector as a fraction.
float distance; ///< Along trace vector as a fraction.
intercepttype_t type;
union {
struct mobj_s* mobj;
LineDef* lineDef;
struct mobj_s *mobj;
LineDef *line;
} d;
} intercept_t;

typedef int (*traverser_t) (const intercept_t* intercept, void* paramaters);
typedef int (*traverser_t) (intercept_t const *intercept, void *parameters);

/**
* A simple POD data structure for representing line trace openings.
Expand Down
24 changes: 10 additions & 14 deletions doomsday/client/include/edit_map.h
@@ -1,4 +1,4 @@
/** @file
/** @file edit_map.h: Runtime map editing.
*
* @authors Copyright © 2007-2013 Daniel Swanson <danij@dengine.net>
*
Expand All @@ -16,12 +16,8 @@
* http://www.gnu.org/licenses</small>
*/

/**
* edit_map.h: Runtime map building.
*/

#ifndef __DOOMSDAY_MAP_EDITOR_H__
#define __DOOMSDAY_MAP_EDITOR_H__
#ifndef LIBDENG_MAP_EDITOR_H
#define LIBDENG_MAP_EDITOR_H

#ifndef __cplusplus
# error "edit_map.h requires C++"
Expand All @@ -39,8 +35,8 @@ class EditMap
typedef std::vector<Vertex *> Vertices;
Vertices vertexes; // really needs to be std::vector? (not a MapElementList?)

typedef std::vector<LineDef *> LineDefs;
LineDefs lineDefs;
typedef std::vector<LineDef *> Lines;
Lines lines;

typedef std::vector<SideDef *> SideDefs;
SideDefs sideDefs;
Expand All @@ -49,7 +45,7 @@ class EditMap
Sectors sectors;

uint numPolyObjs;
Polyobj** polyObjs;
Polyobj **polyObjs;

// Game-specific map entity property values.
EntityDatabase* entityDatabase;
Expand All @@ -73,9 +69,9 @@ class EditMap
#define PRUNE_SECTORS 0x8
#define PRUNE_ALL (PRUNE_LINEDEFS|PRUNE_VERTEXES|PRUNE_SIDEDEFS|PRUNE_SECTORS)

void MPE_PruneRedundantMapData(EditMap* map, int flags);
void MPE_PruneRedundantMapData(EditMap *map, int flags);

GameMap* MPE_GetLastBuiltMap(void);
boolean MPE_GetLastBuiltMapResult(void);
GameMap *MPE_GetLastBuiltMap();
boolean MPE_GetLastBuiltMapResult();

#endif
#endif // LIBDENG_MAP_EDITOR_H
20 changes: 10 additions & 10 deletions doomsday/client/include/map/bsp/hedgeinfo.h
Expand Up @@ -54,31 +54,31 @@ struct HEdgeInfo
coord_t pPerp;
slopetype_t pSlopeType;

HEdge* nextOnSide;
HEdge* prevOnSide;
HEdge *nextOnSide;
HEdge *prevOnSide;

// The superblock that contains this half-edge, or NULL if the half-edge
// is no longer in any superblock (e.g. now in a leaf).
class SuperBlock* bmapBlock;
class SuperBlock *bmapBlock;

/// Linedef this half-edge initially comes from else @c NULL if a "mini-edge".
LineDef* lineDef;
/// Line this half-edge initially comes from else @c NULL if a "mini-edge".
LineDef *line;

// Linedef that this half-edge initially comes from.
// Line that this half-edge initially comes from.
// For "real" half-edges, this is just the same as the 'linedef' field
// above. For "miniedges", this is the linedef of the partition line.
LineDef* sourceLineDef;
// above. For "miniedges", this is the line of the partition.
LineDef *sourceLine;

HEdgeInfo()
: pLength(0), pAngle(0), pPara(0), pPerp(0), pSlopeType(ST_VERTICAL),
nextOnSide(0), prevOnSide(0), bmapBlock(0), sourceLineDef(0)
nextOnSide(0), prevOnSide(0), bmapBlock(0), sourceLine(0)
{
V2d_Set(start, 0, 0);
V2d_Set(end, 0, 0);
V2d_Set(direction, 0, 0);
}

HEdgeInfo& initFromHEdge(HEdge const& hedge)
HEdgeInfo &initFromHEdge(HEdge const &hedge)
{
V2d_Copy(start, hedge.v[0]->origin());
V2d_Copy(end, hedge.v[1]->origin());
Expand Down
18 changes: 9 additions & 9 deletions doomsday/client/include/map/bsp/linedefinfo.h
Expand Up @@ -51,8 +51,8 @@ struct LineDefInfo
};
Q_DECLARE_FLAGS(Flags, Flag)

/// The map's definition of this line segment.
LineDef *lineDef;
/// The map line.
LineDef *line;

Flags flags;

Expand All @@ -62,23 +62,23 @@ struct LineDefInfo
/// If the line is used for a window effect, this is the sector on the back side.
Sector *windowEffect;

explicit LineDefInfo(LineDef *_lineDef, coord_t distEpsilon = 0.0001)
: lineDef(_lineDef), flags(0), validCount(0), windowEffect(0)
explicit LineDefInfo(LineDef *line_, coord_t distEpsilon = 0.0001)
: line(line_), flags(0), validCount(0), windowEffect(0)
{
DENG2_ASSERT(_lineDef);
Vertex const &from = lineDef->from();
Vertex const &to = lineDef->to();
DENG2_ASSERT(line_);
Vertex const &from = line->from();
Vertex const &to = line->to();

// Check for zero-length line.
if((fabs(from.origin()[VX] - to.origin()[VX]) < distEpsilon) &&
(fabs(from.origin()[VY] - to.origin()[VY]) < distEpsilon))
flags |= ZeroLength;

if(lineDef->hasBackSideDef() && lineDef->hasFrontSideDef())
if(line->hasBackSideDef() && line->hasFrontSideDef())
{
flags |= Twosided;

if(lineDef->isSelfReferencing())
if(line->isSelfReferencing())
flags |= SelfRef;
}
}
Expand Down
20 changes: 10 additions & 10 deletions doomsday/client/include/map/bsp/partitioncost.h
Expand Up @@ -55,28 +55,28 @@ struct PartitionCost
realLeft(0), miniRight(0), miniLeft(0)
{}

inline PartitionCost& addHEdgeRight(const HEdge* hedge)
inline PartitionCost &addHEdgeRight(HEdge const *hedge)
{
DENG2_ASSERT(hedge);
if(hedge->lineDef) realRight += 1;
else miniRight += 1;
if(hedge->line) realRight += 1;
else miniRight += 1;
return *this;
}

inline PartitionCost& addHEdgeLeft(const HEdge* hedge)
inline PartitionCost &addHEdgeLeft(HEdge const *hedge)
{
DENG2_ASSERT(hedge);
if(hedge->lineDef) realLeft += 1;
else miniLeft += 1;
if(hedge->line) realLeft += 1;
else miniLeft += 1;
return *this;
}

inline PartitionCost& addHEdgeSide(const HEdge* hedge, Side side)
inline PartitionCost &addHEdgeSide(HEdge const *hedge, Side side)
{
return side == Right? addHEdgeRight(hedge) : addHEdgeLeft(hedge);
}

PartitionCost& operator += (const PartitionCost& other)
PartitionCost &operator += (PartitionCost const &other)
{
total += other.total;
splits += other.splits;
Expand All @@ -89,7 +89,7 @@ struct PartitionCost
return *this;
}

PartitionCost& operator = (const PartitionCost& other)
PartitionCost &operator = (PartitionCost const &other)
{
total = other.total;
splits = other.splits;
Expand All @@ -102,7 +102,7 @@ struct PartitionCost
return *this;
}

bool operator < (const PartitionCost& rhs) const
bool operator < (PartitionCost const &rhs) const
{
return total < rhs.total;
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/include/map/bsp/superblockmap.h
Expand Up @@ -246,7 +246,7 @@ class SuperBlock
{
HEdge* hedge = *it;
LOG_DEBUG("Build: %s %p sector: %d [%1.1f, %1.1f] -> [%1.1f, %1.1f]")
<< (hedge->lineDef? "NORM" : "MINI")
<< (hedge->line? "NORM" : "MINI")
<< hedge << hedge->sector->origIndex()
<< hedge->v[0]->origin()[VX] << hedge->v[0]->origin()[VY]
<< hedge->v[1]->origin()[VX] << hedge->v[1]->origin()[VY];
Expand Down

0 comments on commit ac4e195

Please sign in to comment.