Skip to content

Commit

Permalink
Refactor: Renamed plane_t as Plane
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Mar 10, 2012
1 parent 98591f2 commit a039292
Show file tree
Hide file tree
Showing 24 changed files with 103 additions and 103 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, Sector/plane_t
* origin purposes for all of: mobj_t, Polyobj, Sector/Plane
* @ingroup mobj
*/
typedef struct ddmobj_base_s {
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/api/doomsday.h
Expand Up @@ -72,7 +72,7 @@ extern "C" {
typedef struct hedge_s { int type; } HEdge;
typedef struct bspleaf_s { int type; } BspLeaf;
typedef struct sector_s { int type; } Sector;
typedef struct plane_s { int type; } plane_t;
typedef struct plane_s { int type; } Plane;
typedef struct material_s { int type; } material_t;
#endif

Expand Down
8 changes: 4 additions & 4 deletions doomsday/engine/portable/include/linedef.h
Expand Up @@ -53,28 +53,28 @@ void LineDef_UpdateAABox(LineDef* lineDef);
* If both front and back floor Plane interfaces exist and are equal,
* the front Plane is returned. May return @c NULL if no interfaces.
*/
plane_t* LineDef_FloorMin(const LineDef* lineDef);
Plane* LineDef_FloorMin(const LineDef* lineDef);

/**
* @return Maximal floor Plane which interfaces with this LineDef's face.
* If both front and back floor Plane interfaces exist and are equal,
* the front Plane is returned. May return @c NULL if no interfaces.
*/
plane_t* LineDef_FloorMax(const LineDef* lineDef);
Plane* LineDef_FloorMax(const LineDef* lineDef);

/**
* @return Minimal ceiling Plane which interfaces with this LineDef's face.
* If both front and back ceiling Plane interfaces exist and are equal,
* the front Plane is returned. May return @c NULL if no interfaces.
*/
plane_t* LineDef_CeilingMin(const LineDef* lineDef);
Plane* LineDef_CeilingMin(const LineDef* lineDef);

/**
* @return Maximal ceiling Plane which interfaces with this LineDef's face.
* If both front and back ceiling Plane interfaces exist and are equal,
* the front Plane is returned. May return @c NULL if no interfaces.
*/
plane_t* LineDef_CeilingMax(const LineDef* lineDef);
Plane* LineDef_CeilingMax(const LineDef* lineDef);

/**
* @param ignoreOpacity @c true= do not consider Material opacity.
Expand Down
6 changes: 3 additions & 3 deletions doomsday/engine/portable/include/mapdata.hs
Expand Up @@ -75,10 +75,10 @@ internal

#define HEDGE_SIDEDEF(he) ((he)->lineDef->sideDefs[(he)->side])

// Seg flags
// HEdge flags
#define HEDGEF_POLYOBJ 0x1 /// < Half-edge is part of a poly object.

// Seg frame flags
// HEdge frame flags
#define HEDGEINF_FACINGFRONT 0x0001
end

Expand Down Expand Up @@ -224,7 +224,7 @@ internal
#define PS_inflags surface.inFlags
end

struct plane
struct Plane
PTR ddmobj_base_t soundOrg // Sound origin for plane
PTR sector_s* sector // Owner of the plane (temp)
- surface_t surface
Expand Down
6 changes: 3 additions & 3 deletions doomsday/engine/portable/include/p_maptypes.h
Expand Up @@ -202,8 +202,8 @@ typedef enum {
#define PS_offset surface.offset
#define PS_visoffset surface.visOffset
#define PS_rgba surface.rgba
#define PS_flags surface.flags
#define PS_inflags surface.inFlags
#define PS_flags surface.flags
#define PS_inflags surface.inFlags

typedef struct plane_s {
runtime_mapdata_header_t header;
Expand All @@ -218,7 +218,7 @@ typedef struct plane_s {
float visHeightDelta;
planetype_t type; // PLN_* type.
int planeID;
} plane_t;
} Plane;

// Helper macros for accessing sector floor/ceiling plane data elements.
#define SP_plane(n) planes[(n)]
Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/portable/include/p_particle.h
Expand Up @@ -109,7 +109,7 @@ typedef struct {
// Particle Generator
typedef struct ptcgen_s {
thinker_t thinker; // Func = P_PtcGenThinker
plane_t* plane; // Flat-triggered.
Plane* plane; // Flat-triggered.
const struct ded_ptcgen_s* def; // The definition of this generator.
struct mobj_s* source; // If mobj-triggered.
int srcid; // Source mobj ID.
Expand Down Expand Up @@ -167,7 +167,7 @@ void P_SpawnDamageParticleGen(struct mobj_s* mo, struct mobj_s* inflictor, int a
* Creates a new flat-triggered particle generator based on the given
* definition. The generator is added to the list of active ptcgens.
*/
void P_SpawnPlaneParticleGen(const struct ded_ptcgen_s* def, plane_t* plane);
void P_SpawnPlaneParticleGen(const struct ded_ptcgen_s* def, Plane* plane);

/**
* Called after a reset once the definitions have been re-read.
Expand Down
6 changes: 3 additions & 3 deletions doomsday/engine/portable/include/p_plane.h
@@ -1,4 +1,4 @@
/**\file p_plane.h
/**\file plane.h
*\section License
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
Expand Down Expand Up @@ -38,11 +38,11 @@
/**
* Get the value of a plane property, selected by DMU_* name.
*/
int Plane_GetProperty(const plane_t* plane, setargs_t* args);
int Plane_GetProperty(const Plane* plane, setargs_t* args);

/**
* Update the plane, property is selected by DMU_* name.
*/
int Plane_SetProperty(plane_t* plane, const setargs_t* args);
int Plane_SetProperty(Plane* plane, const setargs_t* args);

#endif /* LIBDENG_MAP_PLANE_H */
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/r_shadow.h
Expand Up @@ -93,6 +93,6 @@ int R_IterateShadowProjections(uint listIdx, int (*callback) (const shadowprojec
*
* @return Found plane else @c NULL if @a mobj is not presently sector-linked.
*/
plane_t* R_FindShadowPlane(struct mobj_s* mobj);
Plane* R_FindShadowPlane(struct mobj_s* mobj);

#endif /* LIBDENG_REFRESH_SHADOW_H */
16 changes: 8 additions & 8 deletions doomsday/engine/portable/include/r_world.h
Expand Up @@ -109,12 +109,12 @@ void R_OrderVertices(const LineDef* line, const Sector* sector,
Vertex* verts[2]);
boolean R_FindBottomTop(LineDef* lineDef, int side, sidedefsection_t section,
float matOffsetX, float matOffsetY,
const plane_t* ffloor, const plane_t* fceil,
const plane_t* bfloor, const plane_t* bceil,
const Plane* ffloor, const Plane* fceil,
const Plane* bfloor, const Plane* bceil,
boolean unpegBottom, boolean unpegTop,
boolean stretchMiddle, boolean isSelfRef,
float* bottom, float* top, float texOffset[2]);
plane_t* R_NewPlaneForSector(Sector* sec);
Plane* R_NewPlaneForSector(Sector* sec);
void R_DestroyPlaneOfSector(uint id, Sector* sec);

surfacedecor_t* R_CreateSurfaceDecoration(surface_t* suf);
Expand All @@ -123,8 +123,8 @@ void R_ClearSurfaceDecorations(surface_t* suf);
void R_UpdateTrackedPlanes(void);
void R_InterpolateTrackedPlanes(boolean resetNextViewer);

void R_AddTrackedPlane(planelist_t* plist, plane_t* pln);
boolean R_RemoveTrackedPlane(planelist_t* plist, const plane_t* pln);
void R_AddTrackedPlane(planelist_t* plist, Plane* pln);
boolean R_RemoveTrackedPlane(planelist_t* plist, const Plane* pln);

void R_UpdateSurfaceScroll(void);
void R_InterpolateSurfaceScroll(boolean resetNextViewer);
Expand All @@ -148,7 +148,7 @@ void R_SurfaceListClear(surfacelist_t* sl);
*/
boolean R_SurfaceListIterate(surfacelist_t* sl, boolean (*callback) (surface_t* suf, void*), void* context);

void R_MarkDependantSurfacesForDecorationUpdate(plane_t* pln);
void R_MarkDependantSurfacesForDecorationUpdate(Plane* pln);

/**
* To be called in response to a Material property changing which may
Expand All @@ -157,9 +157,9 @@ void R_MarkDependantSurfacesForDecorationUpdate(plane_t* pln);
void R_UpdateMapSurfacesOnMaterialChange(material_t* material);

/// @return @c true= @a plane is non-glowing (i.e. not glowing or a sky).
boolean R_IsGlowingPlane(const plane_t* plane);
boolean R_IsGlowingPlane(const Plane* plane);

float R_GlowStrength(const plane_t* pln);
float R_GlowStrength(const Plane* pln);

lineowner_t* R_GetVtxLineOwner(const Vertex* vtx, const LineDef* line);
LineDef* R_FindLineNeighbor(const Sector* sector,
Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/portable/src/cl_world.c
Expand Up @@ -611,8 +611,8 @@ void Cl_ReadSectorDelta2(int deltaType, boolean skip)
{
/// @todo Skipping is never done nowadays...
static Sector dummy; // Used when skipping.
static plane_t* dummyPlaneArray[2];
static plane_t dummyPlanes[2];
static Plane* dummyPlaneArray[2];
static Plane dummyPlanes[2];

GameMap* map = theMap; /// @fixme Do not assume the CURRENT map.
unsigned short num;
Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/portable/src/dam_file.c
Expand Up @@ -430,7 +430,7 @@ static void writeSector(const GameMap *map, uint idx)
writeLong(s->planeCount);
for(i = 0; i < s->planeCount; ++i)
{
plane_t *p = s->planes[i];
Plane *p = s->planes[i];

writeFloat(p->height);
writeFloat(p->target);
Expand Down Expand Up @@ -504,7 +504,7 @@ static void readSector(const GameMap *map, uint idx)
numPlanes = (uint) readLong();
for(i = 0; i < numPlanes; ++i)
{
plane_t *p = R_NewPlaneForSector(s);
Plane *p = R_NewPlaneForSector(s);

p->height = readFloat();
p->target = readFloat();
Expand Down
10 changes: 5 additions & 5 deletions doomsday/engine/portable/src/edit_map.c
Expand Up @@ -1359,8 +1359,8 @@ static void hardenPlanes(GameMap* dest, editmap_t* src)

for(j = 0; j < srcS->planeCount; ++j)
{
plane_t* destP = R_NewPlaneForSector(destS);
plane_t* srcP = srcS->planes[j];
Plane* destP = R_NewPlaneForSector(destS);
Plane* srcP = srcS->planes[j];

destP->height = destP->oldHeight[0] = destP->oldHeight[1] =
destP->visHeight = srcP->height;
Expand Down Expand Up @@ -2212,7 +2212,7 @@ uint MPE_PlaneCreate(uint sector, float height, materialid_t material,
{
uint i;
Sector* s;
plane_t** newList, *pln;
Plane** newList, *pln;

if(!editMapInited)
return 0;
Expand All @@ -2222,7 +2222,7 @@ uint MPE_PlaneCreate(uint sector, float height, materialid_t material,

s = map->sectors[sector - 1];

pln = M_Calloc(sizeof(plane_t));
pln = M_Calloc(sizeof(Plane));
pln->surface.owner = (void*) pln;
pln->height = height;
Surface_SetMaterial(&pln->surface, Materials_ToMaterial(material));
Expand All @@ -2235,7 +2235,7 @@ uint MPE_PlaneCreate(uint sector, float height, materialid_t material,
pln->type = (pln->PS_normal[VZ] < 0? PLN_CEILING : PLN_FLOOR);

pln->sector = s;
newList = M_Malloc(sizeof(plane_t*) * (++s->planeCount + 1));
newList = M_Malloc(sizeof(Plane*) * (++s->planeCount + 1));
for(i = 0; i < s->planeCount - 1; ++i)
{
newList[i] = s->planes[i];
Expand Down
8 changes: 4 additions & 4 deletions doomsday/engine/portable/src/linedef.c
Expand Up @@ -296,7 +296,7 @@ boolean LineDef_MiddleMaterialCoversOpening(const LineDef *line, int side,
return false;
}

plane_t* LineDef_FloorMin(const LineDef* lineDef)
Plane* LineDef_FloorMin(const LineDef* lineDef)
{
assert(lineDef);
if(!lineDef->L_frontsector) return NULL; // No interfaces.
Expand All @@ -306,7 +306,7 @@ plane_t* LineDef_FloorMin(const LineDef* lineDef)
lineDef->L_backsector->SP_plane(PLN_FLOOR) : lineDef->L_frontsector->SP_plane(PLN_FLOOR);
}

plane_t* LineDef_FloorMax(const LineDef* lineDef)
Plane* LineDef_FloorMax(const LineDef* lineDef)
{
assert(lineDef);
if(!lineDef->L_frontsector) return NULL; // No interfaces.
Expand All @@ -316,7 +316,7 @@ plane_t* LineDef_FloorMax(const LineDef* lineDef)
lineDef->L_backsector->SP_plane(PLN_FLOOR) : lineDef->L_frontsector->SP_plane(PLN_FLOOR);
}

plane_t* LineDef_CeilingMin(const LineDef* lineDef)
Plane* LineDef_CeilingMin(const LineDef* lineDef)
{
assert(lineDef);
if(!lineDef->L_frontsector) return NULL; // No interfaces.
Expand All @@ -326,7 +326,7 @@ plane_t* LineDef_CeilingMin(const LineDef* lineDef)
lineDef->L_backsector->SP_plane(PLN_CEILING) : lineDef->L_frontsector->SP_plane(PLN_CEILING);
}

plane_t* LineDef_CeilingMax(const LineDef* lineDef)
Plane* LineDef_CeilingMax(const LineDef* lineDef)
{
assert(lineDef);
if(!lineDef->L_frontsector) return NULL; // No interfaces.
Expand Down
12 changes: 6 additions & 6 deletions doomsday/engine/portable/src/p_dmu.c
Expand Up @@ -443,7 +443,7 @@ uint P_ToIndex(const void* ptr)
return GET_BSPNODE_IDX((BspNode*) ptr);

case DMU_PLANE:
return GET_PLANE_IDX((plane_t*) ptr);
return GET_PLANE_IDX((Plane*) ptr);

case DMU_MATERIAL:
return Materials_Id((material_t*) ptr);
Expand Down Expand Up @@ -525,7 +525,7 @@ int P_Iteratep(void *ptr, uint prop, void* context, int (*callback) (void* p, vo

if(sec->planes)
{
plane_t** planePtr = sec->planes;
Plane** planePtr = sec->planes;
while(*planePtr && !(result = callback(*planePtr, context)))
planePtr++;
}
Expand Down Expand Up @@ -913,7 +913,7 @@ static int setProperty(void* obj, void* context)
{
setargs_t* args = (setargs_t*) context;
Sector* updateSector1 = NULL, *updateSector2 = NULL;
plane_t* updatePlane = NULL;
Plane* updatePlane = NULL;
LineDef* updateLinedef = NULL;
SideDef* updateSidedef = NULL;
surface_t* updateSurface = NULL;
Expand Down Expand Up @@ -1014,7 +1014,7 @@ static int setProperty(void* obj, void* context)

if(args->type == DMU_PLANE)
{
updatePlane = (plane_t*) obj;
updatePlane = (Plane*) obj;

switch(args->prop)
{
Expand All @@ -1041,7 +1041,7 @@ static int setProperty(void* obj, void* context)
case DMU_ALPHA:
case DMU_BLENDMODE:
case DMU_FLAGS:
obj = &((plane_t*) obj)->surface;
obj = &((Plane*) obj)->surface;
args->type = DMU_SURFACE;
break;

Expand Down Expand Up @@ -1494,7 +1494,7 @@ static int getProperty(void* obj, void* context)
case DMU_ALPHA:
case DMU_BLENDMODE:
case DMU_FLAGS:
obj = &((plane_t*) obj)->surface;
obj = &((Plane*) obj)->surface;
args->type = DMU_SURFACE;
break;

Expand Down
10 changes: 5 additions & 5 deletions doomsday/engine/portable/src/p_particle.c
Expand Up @@ -183,7 +183,7 @@ void P_MapSpawnPlaneParticleGens(void)

for(j = 0; j < 2; ++j)
{
plane_t* plane = sector->SP_plane(j);
Plane* plane = sector->SP_plane(j);
const ded_ptcgen_t* def = Materials_PtcGenDef(plane->PS_material);
P_SpawnPlaneParticleGen(def, plane);
}
Expand Down Expand Up @@ -332,19 +332,19 @@ void P_SpawnMobjParticleGen(const ded_ptcgen_t* def, mobj_t* source)

static int findGeneratorForPlane(ptcgen_t* gen, void* parameters)
{
plane_t* plane = (plane_t*)parameters;
Plane* plane = (Plane*)parameters;
if(gen->plane == plane) return true; // Stop iteration.
return false; // Continue iteration.
}

/// @return @c true iff there is an active ptcgen for the given plane.
static boolean GameMap_HasGeneratorForPlane(GameMap* map, plane_t* plane)
static boolean GameMap_HasGeneratorForPlane(GameMap* map, Plane* plane)
{
assert(map);
return 0 != Generators_Iterate(GameMap_Generators(map), findGeneratorForPlane, (void*)plane);
}

void P_SpawnPlaneParticleGen(const ded_ptcgen_t* def, plane_t* plane)
void P_SpawnPlaneParticleGen(const ded_ptcgen_t* def, Plane* plane)
{
GameMap* map = theMap; /// @fixme Do not assume plane is from the CURRENT map.
planetype_t relPlane;
Expand Down Expand Up @@ -604,7 +604,7 @@ static void P_NewParticle(ptcgen_t* gen)
else if(gen->plane)
{
fixed_t radius = gen->stages[pt->stage].radius;
const plane_t* plane = gen->plane;
const Plane* plane = gen->plane;
const Sector* sector = gen->plane->sector;
const float* bbox = sector->bBox;

Expand Down

0 comments on commit a039292

Please sign in to comment.