Skip to content

Commit

Permalink
Refactor: Renamed sector_t as Sector
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Mar 10, 2012
1 parent d645ce7 commit a57a336
Show file tree
Hide file tree
Showing 128 changed files with 582 additions and 583 deletions.
2 changes: 1 addition & 1 deletion doomsday/engine/api/dd_share.h
Expand Up @@ -781,7 +781,7 @@ enum { /* Do NOT change the numerical values of the constants. */

/**
* All map think-able objects must use this as a base. Also used for sound
* origin purposes for all of: mobj_t, polyobj_t, sector_t/plane_t
* origin purposes for all of: mobj_t, polyobj_t, Sector/plane_t
* @ingroup mobj
*/
typedef struct ddmobj_base_s {
Expand Down
10 changes: 5 additions & 5 deletions doomsday/engine/api/doomsday.h
Expand Up @@ -58,7 +58,7 @@ extern "C" {
/**
* Public definitions of the internal map data pointers. These can be
* accessed externally, but only as identifiers to data instances.
* For example, a game could use sector_t to identify to sector to
* For example, a game could use Sector to identify to sector to
* change with the Map Update API.
*
* Define @c __INTERNAL_MAP_DATA_ACCESS__ if access to the internal map data
Expand All @@ -71,7 +71,7 @@ extern "C" {
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;
typedef struct sector_s { int type; } Sector;
typedef struct plane_s { int type; } plane_t;
typedef struct material_s { int type; } material_t;
#endif
Expand Down Expand Up @@ -439,7 +439,7 @@ boolean ClMobj_LocalActionsEnabled(struct mobj_s* mo);
int P_AllLinesBoxIterator(const AABoxf* box,
int (*func) (struct linedef_s*, void*),
void* data);
int P_BspLeafsBoxIterator(const AABoxf* box, sector_t* sector,
int P_BspLeafsBoxIterator(const AABoxf* box, Sector* sector,
int (*func) (BspLeaf*, void*),
void* data);
int P_PolyobjsBoxIterator(const AABoxf* box,
Expand All @@ -450,7 +450,7 @@ boolean ClMobj_LocalActionsEnabled(struct mobj_s* mo);
int P_LineMobjsIterator(struct linedef_s* line,
int (*func) (struct mobj_s*, void *), void* data);
int P_SectorTouchingMobjsIterator
(sector_t* sector, int (*func) (struct mobj_s*, void*),
(Sector* sector, int (*func) (struct mobj_s*, void*),
void* data);

int P_PathTraverse(float const from[2], float const to[2], int flags, traverser_t callback); /*paramaters=NULL*/
Expand Down Expand Up @@ -512,7 +512,7 @@ void P_SpawnDamageParticleGen(struct mobj_s* mo, struct mobj_s* infli
int (*func) (struct linedef_s*,
void*), void*);
int P_MobjSectorsIterator(struct mobj_s* mo,
int (*func) (sector_t*, void*),
int (*func) (Sector*, void*),
void* data);
///@}

Expand Down
8 changes: 4 additions & 4 deletions doomsday/engine/portable/include/bsp_edge.h
Expand Up @@ -99,16 +99,16 @@ typedef struct bsp_hedge_s {
// above. For "miniedges", this is the linedef of the partition line.
LineDef* sourceLineDef;

sector_t* sector; // Adjacent sector, or NULL if invalid sidedef or minihedge.
Sector* sector; // Adjacent sector, or NULL if invalid sidedef or minihedge.
byte side; // 0 for right, 1 for left.
} bsp_hedge_t;

void BSP_InitHEdgeAllocator(void);
void BSP_ShutdownHEdgeAllocator(void);

bsp_hedge_t* BSP_HEdge_Create(LineDef* line, LineDef* sourceLine,
vertex_t* start, vertex_t* end,
sector_t* sec, boolean back);
vertex_t* start, vertex_t* end,
Sector* sec, boolean back);
void BSP_HEdge_Destroy(bsp_hedge_t* hEdge);

bsp_hedge_t* BSP_HEdge_Split(bsp_hedge_t* oldHEdge, double x, double y);
Expand All @@ -117,5 +117,5 @@ bsp_hedge_t* BSP_HEdge_Split(bsp_hedge_t* oldHEdge, double x, double y);
void BSP_CreateVertexEdgeTip(vertex_t* vert, double dx, double dy,
bsp_hedge_t* back, bsp_hedge_t* front);
void BSP_DestroyVertexEdgeTip(struct edgetip_s* tip);
sector_t* BSP_VertexCheckOpen(vertex_t* vert, double dx, double dy);
Sector* BSP_VertexCheckOpen(vertex_t* vert, double dx, double dy);
#endif
4 changes: 2 additions & 2 deletions doomsday/engine/portable/include/bsp_intersection.h
Expand Up @@ -59,8 +59,8 @@ typedef struct intersection_s {

// Sector on each side of the vertex (along the partition),
// or NULL when that direction isn't OPEN.
sector_t* before;
sector_t* after;
Sector* before;
Sector* after;
} intersection_t;

void BSP_InitIntersectionAllocator(void);
Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/portable/include/edit_map.h
Expand Up @@ -41,7 +41,7 @@ typedef struct editmap_s {
uint numSideDefs;
SideDef** sideDefs;
uint numSectors;
sector_t** sectors;
Sector** sectors;
uint numPolyObjs;
polyobj_t** polyObjs;

Expand Down Expand Up @@ -93,7 +93,7 @@ boolean MPE_GameObjProperty(const char *objName, uint idx,

void MPE_PruneRedundantMapData(editmap_t* map, int flags);

boolean MPE_RegisterUnclosedSectorNear(sector_t* sec, double x, double y);
boolean MPE_RegisterUnclosedSectorNear(Sector* sec, double x, double y);
void MPE_PrintUnclosedSectorList(void);
void MPE_FreeUnclosedSectorList(void);

Expand Down
14 changes: 7 additions & 7 deletions doomsday/engine/portable/include/gamemap.h
Expand Up @@ -85,7 +85,7 @@ typedef struct gamemap_s {
HEdge* hedges;

uint numSectors;
sector_t* sectors;
Sector* sectors;

uint numBspLeafs;
BspLeaf* bspLeafs;
Expand Down Expand Up @@ -231,7 +231,7 @@ SideDef* GameMap_SideDef(GameMap* map, uint idx);
* @param idx Unique index of the sector.
* @return Pointer to Sector with this index else @c NULL if @a idx is not valid.
*/
sector_t* GameMap_Sector(GameMap* map, uint idx);
Sector* GameMap_Sector(GameMap* map, uint idx);

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

/**
* Lookup the unique index for @a bspLeaf.
Expand Down Expand Up @@ -643,13 +643,13 @@ void GameMap_InitBspLeafBlockmap(GameMap* map, const_pvec2_t min, const_pvec2_t
void GameMap_LinkBspLeafInBlockmap(GameMap* map, BspLeaf* bspLeaf);

int GameMap_IterateCellBspLeafs(GameMap* map, const uint coords[2],
sector_t* sector, const AABoxf* box, int localValidCount,
Sector* sector, const AABoxf* box, int localValidCount,
int (*callback) (BspLeaf*, void*), void* parameters);
int GameMap_IterateCellBlockBspLeafs(GameMap* map, const struct gridmapblock_s* blockCoords,
sector_t* sector, const AABoxf* box, int localValidCount,
Sector* sector, const AABoxf* box, int localValidCount,
int (*callback) (BspLeaf*, void*), void* parameters);

int GameMap_BspLeafsBoxIterator(GameMap* map, const AABoxf* box, sector_t* sector,
int GameMap_BspLeafsBoxIterator(GameMap* map, const AABoxf* box, Sector* sector,
int (*callback) (BspLeaf*, void*), void* parameters);

int GameMap_BspLeafIterator(GameMap* map, int (*callback) (BspLeaf*, void*), void* parameters);
Expand Down Expand Up @@ -684,7 +684,7 @@ int GameMap_VertexIterator(GameMap* map, int (*callback) (vertex_t*, void*), voi

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

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

int GameMap_HEdgeIterator(GameMap* map, int (*callback) (HEdge*, void*), void* parameters);

Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/portable/include/mapdata.hs
Expand Up @@ -86,7 +86,7 @@ public
#define DMT_HEDGE_SIDEDEF DDVT_PTR
end

struct seg
struct HEdge
PTR vertex_s*[2] v // [Start, End] of the segment.
PTR linedef_s* lineDef
PTR sector_s*[2] sec
Expand Down Expand Up @@ -305,7 +305,7 @@ typedef struct msector_s {
} msector_t;
end

struct sector
struct Sector
- int frameFlags
INT int validCount // if == validCount, already checked.
- int flags
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/p_mapdata.h
Expand Up @@ -175,7 +175,7 @@ typedef struct {
extern Uri* mapUri;
extern vertex_t* vertexes;
extern HEdge* hedges;
extern sector_t* sectors;
extern Sector* sectors;
extern BspLeaf* bspLeafs;
extern BspNode* bspNodes;
extern LineDef* lineDefs;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/p_maptypes.h
Expand Up @@ -310,7 +310,7 @@ typedef struct sector_s {
float reverb[NUM_REVERB_DATA];
origin_t origin;
msector_t buildData;
} sector_t;
} Sector;

// Sidedef sections.
typedef enum sidedefsection_e {
Expand Down
8 changes: 4 additions & 4 deletions doomsday/engine/portable/include/p_maputil.h
Expand Up @@ -112,7 +112,7 @@ BspLeaf* P_BspLeafAtPointXY(float x, float y);
*
* @return @c true, if the point is inside the sector.
*/
boolean P_IsPointXYInSector(float x, float y, const sector_t* sector);
boolean P_IsPointXYInSector(float x, float y, const Sector* sector);

/**
* Is the point inside the BspLeaf (according to the edges).
Expand Down Expand Up @@ -154,11 +154,11 @@ int PIT_AddMobjIntercepts(mobj_t* mobj, void* parameters);

int P_MobjLinesIterator(mobj_t* mo, int (*func) (LineDef*, void*), void* parameters);

int P_MobjSectorsIterator(mobj_t* mo, int (*func) (sector_t*, void*), void* parameters);
int P_MobjSectorsIterator(mobj_t* mo, int (*func) (Sector*, void*), void* parameters);

int P_LineMobjsIterator(LineDef* lineDef, int (*func) (mobj_t*, void*), void* parameters);

int P_SectorTouchingMobjsIterator(sector_t* sector, int (*func) (mobj_t*, void*), void *parameters);
int P_SectorTouchingMobjsIterator(Sector* sector, int (*func) (mobj_t*, void*), void *parameters);

int P_MobjsBoxIterator(const AABoxf* box, int (*callback) (mobj_t*, void*), void* parameters);

Expand All @@ -182,7 +182,7 @@ int P_PolyobjLinesBoxIterator(const AABoxf* box, int (*callback) (LineDef*, void
*/
int P_AllLinesBoxIterator(const AABoxf* box, int (*callback) (LineDef*, void*), void* parameters);

int P_BspLeafsBoxIterator(const AABoxf* box, sector_t* sector, int (*callback) (BspLeaf*, void*), void* parameters);
int P_BspLeafsBoxIterator(const AABoxf* box, Sector* sector, int (*callback) (BspLeaf*, void*), void* parameters);

int P_PathTraverse(float const from[2], float const to[2], int flags, traverser_t callback);
int P_PathTraverse2(float const from[2], float const to[2], int flags, traverser_t callback, void* parameters);
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/p_particle.h
Expand Up @@ -92,7 +92,7 @@ typedef struct {
short tics;
fixed_t pos[3]; // Coordinates.
fixed_t mov[3]; // Momentum.
sector_t* sector; // Updated when needed.
Sector* sector; // Updated when needed.
LineDef* contact; // Updated when lines hit/avoided.
ushort yaw, pitch; // Rotation angles (0-65536 => 0-360).
} particle_t;
Expand Down
14 changes: 7 additions & 7 deletions doomsday/engine/portable/include/p_sector.h
@@ -1,4 +1,4 @@
/**\file p_sector.h
/**\file sector.h
*\section License
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
Expand Down Expand Up @@ -36,22 +36,22 @@
* Update the origin of the sector according to the point defined by the center of
* the sector's axis-aligned bounding box (which must be initialized before calling).
*
* @param sec Sector instance.
* @param sector Sector instance.
*/
void Sector_UpdateOrigin(sector_t* sec);
void Sector_UpdateOrigin(Sector* sector);

/**
* Get the value of a sector property, selected by DMU_* name.
*
* @param sec Sector instance.
* @param sector Sector instance.
*/
int Sector_GetProperty(const sector_t* sector, setargs_t* args);
int Sector_GetProperty(const Sector* sector, setargs_t* args);

/**
* Update the sector property, selected by DMU_* name.
*
* @param sec Sector instance.
* @param sector Sector instance.
*/
int Sector_SetProperty(sector_t* sector, const setargs_t* args);
int Sector_SetProperty(Sector* sector, const setargs_t* args);

#endif /* LIBDENG_MAP_SECTOR_H */
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/r_lgrid.h
Expand Up @@ -38,7 +38,7 @@ void LG_Update(void);
*/
void LG_MarkAllForUpdate(void);

void LG_SectorChanged(sector_t* sector);
void LG_SectorChanged(Sector* sector);

/**
* Calculate the light color for a 3D point in the world.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/r_util.h
Expand Up @@ -38,7 +38,7 @@ angle_t R_PointToAngle2(float x1, float y1,
float x2, float y2);
float R_PointToDist(const float x, const float y);

sector_t* R_GetSectorForOrigin(const void* ddMobjBase);
Sector* R_GetSectorForOrigin(const void* ddMobjBase);

/**
* Scale @a color uniformly so that the highest component becomes one.
Expand Down
18 changes: 9 additions & 9 deletions doomsday/engine/portable/include/r_world.h
Expand Up @@ -72,7 +72,7 @@ void R_SetupFogDefaults(void);
/**
* Sector light color may be affected by the sky light color.
*/
const float* R_GetSectorLightColor(const sector_t* sector);
const float* R_GetSectorLightColor(const Sector* sector);

float R_DistAttenuateLightLevel(float distToViewer, float lightLevel);

Expand All @@ -97,15 +97,15 @@ float R_CheckSectorLight(float lightlevel, float min, float max);
*/
boolean R_IsSkySurface(const surface_t* suf);

boolean R_SectorContainsSkySurfaces(const sector_t* sec);
boolean R_SectorContainsSkySurfaces(const Sector* sec);

void R_UpdatePlanes(void);
void R_ClearSectorFlags(void);
void R_InitSkyFix(void);
void R_MapInitSurfaceLists(void);

void R_UpdateSkyFixForSec(const sector_t* sec);
void R_OrderVertices(const LineDef* line, const sector_t* sector,
void R_UpdateSkyFixForSec(const Sector* sec);
void R_OrderVertices(const LineDef* line, const Sector* sector,
vertex_t* verts[2]);
boolean R_FindBottomTop(LineDef* lineDef, int side, sidedefsection_t section,
float matOffsetX, float matOffsetY,
Expand All @@ -114,8 +114,8 @@ boolean R_FindBottomTop(LineDef* lineDef, int side, sidedefsection_t sec
boolean unpegBottom, boolean unpegTop,
boolean stretchMiddle, boolean isSelfRef,
float* bottom, float* top, float texOffset[2]);
plane_t* R_NewPlaneForSector(sector_t* sec);
void R_DestroyPlaneOfSector(uint id, sector_t* sec);
plane_t* R_NewPlaneForSector(Sector* sec);
void R_DestroyPlaneOfSector(uint id, Sector* sec);

surfacedecor_t* R_CreateSurfaceDecoration(surface_t* suf);
void R_ClearSurfaceDecorations(surface_t* suf);
Expand Down Expand Up @@ -162,16 +162,16 @@ boolean R_IsGlowingPlane(const plane_t* plane);
float R_GlowStrength(const plane_t* pln);

lineowner_t* R_GetVtxLineOwner(const vertex_t* vtx, const LineDef* line);
LineDef* R_FindLineNeighbor(const sector_t* sector,
LineDef* R_FindLineNeighbor(const Sector* sector,
const LineDef* line,
const lineowner_t* own,
boolean antiClockwise, binangle_t* diff);
LineDef* R_FindSolidLineNeighbor(const sector_t* sector,
LineDef* R_FindSolidLineNeighbor(const Sector* sector,
const LineDef* line,
const lineowner_t* own,
boolean antiClockwise,
binangle_t* diff);
LineDef* R_FindLineBackNeighbor(const sector_t* sector,
LineDef* R_FindLineBackNeighbor(const Sector* sector,
const LineDef* line,
const lineowner_t* own,
boolean antiClockwise,
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/rend_fakeradio.h
Expand Up @@ -33,7 +33,7 @@ typedef struct {
const float* segOffset;
const float* segLength;
const float* linedefLength;
const sector_t* frontSec, *backSec;
const Sector* frontSec, *backSec;
} rendsegradio_params_t;

/// Register the console commands, variables, etc..., of this module.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/rend_particle.h
Expand Up @@ -55,7 +55,7 @@ void Rend_ParticleInitForNewFrame(void);
* The given sector is visible. All PGs in it should be rendered.
* Scans PG links.
*/
void Rend_ParticleMarkInSectorVisible(sector_t* sector);
void Rend_ParticleMarkInSectorVisible(Sector* sector);

/**
* Render all the visible particle generators.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/s_environ.h
Expand Up @@ -31,7 +31,7 @@

#include "p_mapdata.h"

void S_CalcSectorReverb(sector_t* sec);
void S_CalcSectorReverb(Sector* sec);
void S_DetermineSubsecsAffectingSectorReverb(GameMap* map);

/// @return Environment class name for identifier @a mclass.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/sv_pool.h
Expand Up @@ -403,7 +403,7 @@ void Sv_AckDeltaSet(uint clientNumber, int set, byte resent);
uint Sv_CountUnackedDeltas(uint clientNumber);

void Sv_NewSoundDelta(int soundId, mobj_t* emitter,
sector_t* sourceSector, polyobj_t* sourcePoly,
Sector* sourceSector, polyobj_t* sourcePoly,
float volume, boolean isRepeating,
int clientsMask);

Expand Down

0 comments on commit a57a336

Please sign in to comment.