Skip to content

Commit

Permalink
Began cleanup after commonization of p_ceilings.c
Browse files Browse the repository at this point in the history
  • Loading branch information
danij committed Mar 18, 2007
1 parent 54534aa commit 66ebc67
Show file tree
Hide file tree
Showing 9 changed files with 147 additions and 155 deletions.
236 changes: 117 additions & 119 deletions doomsday/plugins/common/src/p_ceilings.c

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions doomsday/plugins/common/src/p_saveg.c
Expand Up @@ -491,7 +491,7 @@ static thinkerinfo_t thinkerInfo[] = {

/**
* Exit with a fatal error if thr value at the current location in the save
* file does not match that associated with the specified segment type.
* file does not match that associated with the specified segment type.
*
* @param segType Value by which to check for alignment.
*/
Expand Down Expand Up @@ -1788,7 +1788,7 @@ static int SV_ReadMobj(thinker_t *th)
mo->pos[VY] = SV_ReadLong();
mo->pos[VZ] = SV_ReadLong();

//More drawing info: to determine current sprite.
//More drawing info: to determine current sprite.
mo->angle = SV_ReadLong(); // orientation
mo->sprite = SV_ReadLong(); // used to find patch_t and flip value
mo->frame = SV_ReadLong(); // might be ORed with FF_FULLBRIGHT
Expand Down Expand Up @@ -3135,7 +3135,7 @@ static void SV_WriteLight(light_t *th)
static int SV_ReadLight(light_t *th)
{
sector_t *sector;

if(saveVersion >= 4)
{
/*int ver =*/ SV_ReadByte(); // version byte.
Expand All @@ -3151,7 +3151,7 @@ static int SV_ReadLight(light_t *th)
th->value2 = SV_ReadLong();
th->tics1 = SV_ReadLong();
th->tics2 = SV_ReadLong();
th->count = SV_ReadLong();
th->count = SV_ReadLong();
}
else
{
Expand Down Expand Up @@ -3198,7 +3198,7 @@ static void SV_WritePhase(phase_t *th)
static int SV_ReadPhase(phase_t *th)
{
sector_t *sector;

if(saveVersion >= 4)
{
// Note: the thinker class byte has already been read.
Expand Down Expand Up @@ -3339,7 +3339,7 @@ static void SV_WriteDoorPoly(polydoor_t *th)
}

static int SV_ReadDoorPoly(polydoor_t *th)
{
{
if(saveVersion >= 4)
{
// Note: the thinker class byte has already been read.
Expand Down Expand Up @@ -3512,7 +3512,7 @@ static void SV_WritePillar(pillar_t *th)
static int SV_ReadPillar(pillar_t *th)
{
sector_t *sector;

if(saveVersion >= 4)
{
// Note: the thinker class byte has already been read.
Expand Down Expand Up @@ -4035,6 +4035,10 @@ static void DoArchiveThinker(thinker_t *th, thinkerclass_t tclass)
*/
static void P_ArchiveThinkers(void)
{
#if !__JHEXEN__
extern ceilinglist_t *activeceilings;
#endif

thinker_t *th = 0;
thinkerinfo_t *thInfo;
#if !__JHEXEN__
Expand Down
2 changes: 0 additions & 2 deletions doomsday/plugins/doom64tc/include/p_spec.h
Expand Up @@ -346,8 +346,6 @@ typedef struct ceilinglist {
#define CEILSPEED 1
#define CEILWAIT 150

extern ceilinglist_t *activeceilings;

int EV_DoCeiling(line_t *line, ceiling_e type);

void T_MoveCeiling(ceiling_t *ceiling);
Expand Down
2 changes: 0 additions & 2 deletions doomsday/plugins/jdoom/include/p_spec.h
Expand Up @@ -315,8 +315,6 @@ typedef struct ceilinglist {
#define CEILSPEED 1
#define CEILWAIT 150

extern ceilinglist_t *activeceilings;

int EV_DoCeiling(line_t *line, ceiling_e type);

void T_MoveCeiling(ceiling_t *ceiling);
Expand Down
2 changes: 0 additions & 2 deletions doomsday/plugins/jheretic/include/p_spec.h
Expand Up @@ -301,8 +301,6 @@ typedef struct ceilinglist {
#define CEILSPEED 1
#define CEILWAIT 150

extern ceilinglist_t *activeceilings;

int EV_DoCeiling(line_t *line, ceiling_e type);

void T_MoveCeiling(ceiling_t *ceiling);
Expand Down
19 changes: 9 additions & 10 deletions doomsday/plugins/jhexen/include/p_spec.h
Expand Up @@ -253,14 +253,14 @@ void T_VerticalDoor(vldoor_t *door);
// Ceiling
//
typedef enum {
CLEV_LOWERTOFLOOR,
CLEV_RAISETOHIGHEST,
CLEV_LOWERANDCRUSH,
CLEV_CRUSHANDRAISE,
CLEV_LOWERBYVALUE,
CLEV_RAISEBYVALUE,
CLEV_CRUSHRAISEANDSTAY,
CLEV_MOVETOVALUETIMES8
lowerToFloor,
raiseToHighest,
lowerAndCrush,
crushAndRaise,
lowerByValue,
raiseByValue,
crushRaiseAndStay,
moveToValueTimes8
} ceiling_e;

typedef struct {
Expand All @@ -280,12 +280,11 @@ typedef struct {
#define CEILWAIT 150
#define MAXCEILINGS 30

extern ceiling_t *activeceilings[MAXCEILINGS];

int EV_DoCeiling(line_t *line, byte *args, ceiling_e type);
void T_MoveCeiling(ceiling_t *ceiling);
void P_AddActiveCeiling(ceiling_t *c);
void P_RemoveActiveCeiling(ceiling_t *c);
void P_RemoveAllActiveCeilings(void);
int EV_CeilingCrushStop(line_t *line, byte *args);

//
Expand Down
4 changes: 2 additions & 2 deletions doomsday/plugins/jhexen/src/p_floor.c
Expand Up @@ -491,7 +491,7 @@ int EV_DoFloorAndCeiling(line_t *line, byte *args, boolean raise)
{
P_XSector(sec)->specialdata = NULL;
}
ceiling = EV_DoCeiling(line, args, CLEV_RAISEBYVALUE);
ceiling = EV_DoCeiling(line, args, raiseByValue);
}
else
{
Expand All @@ -500,7 +500,7 @@ int EV_DoFloorAndCeiling(line_t *line, byte *args, boolean raise)
{
P_XSector(sec)->specialdata = NULL;
}
ceiling = EV_DoCeiling(line, args, CLEV_LOWERBYVALUE);
ceiling = EV_DoCeiling(line, args, lowerByValue);
}
return (floor | ceiling);
}
Expand Down
17 changes: 8 additions & 9 deletions doomsday/plugins/jhexen/src/p_spec.c
Expand Up @@ -348,27 +348,27 @@ boolean P_ExecuteLineSpecial(int special, byte *args, line_t *line, int side,
break;

case 40: // Ceiling Lower by Value
buttonSuccess = EV_DoCeiling(line, args, CLEV_LOWERBYVALUE);
buttonSuccess = EV_DoCeiling(line, args, lowerByValue);
break;

case 41: // Ceiling Raise by Value
buttonSuccess = EV_DoCeiling(line, args, CLEV_RAISEBYVALUE);
buttonSuccess = EV_DoCeiling(line, args, raiseByValue);
break;

case 42: // Ceiling Crush and Raise
buttonSuccess = EV_DoCeiling(line, args, CLEV_CRUSHANDRAISE);
buttonSuccess = EV_DoCeiling(line, args, crushAndRaise);
break;

case 43: // Ceiling Lower and Crush
buttonSuccess = EV_DoCeiling(line, args, CLEV_LOWERANDCRUSH);
buttonSuccess = EV_DoCeiling(line, args, lowerAndCrush);
break;

case 44: // Ceiling Crush Stop
buttonSuccess = EV_CeilingCrushStop(line, args);
break;

case 45: // Ceiling Crush Raise and Stay
buttonSuccess = EV_DoCeiling(line, args, CLEV_CRUSHRAISEANDSTAY);
buttonSuccess = EV_DoCeiling(line, args, crushRaiseAndStay);
break;

case 46: // Floor Crush Stop
Expand Down Expand Up @@ -412,7 +412,7 @@ boolean P_ExecuteLineSpecial(int special, byte *args, line_t *line, int side,
break;

case 69: // Ceiling Move to Value * 8
buttonSuccess = EV_DoCeiling(line, args, CLEV_MOVETOVALUETIMES8);
buttonSuccess = EV_DoCeiling(line, args, moveToValueTimes8);
break;

case 70: // Teleport
Expand Down Expand Up @@ -920,9 +920,8 @@ void P_SpawnSpecials(void)
}
}

// FIXME: Remove fixed limits
for(i = 0; i < MAXCEILINGS; ++i)
activeceilings[i] = NULL;
// FIXME: Remove fixed limits.
P_RemoveAllActiveCeilings(); // jff 2/22/98 use killough's scheme
for(i = 0; i < MAXPLATS; ++i)
activeplats[i] = NULL;

Expand Down
2 changes: 0 additions & 2 deletions doomsday/plugins/wolftc/include/p_spec.h
Expand Up @@ -315,8 +315,6 @@ typedef struct ceilinglist {
#define CEILSPEED 1
#define CEILWAIT 150

extern ceilinglist_t *activeceilings;

int EV_DoCeiling(line_t *line, ceiling_e type);

void T_MoveCeiling(ceiling_t *ceiling);
Expand Down

0 comments on commit 66ebc67

Please sign in to comment.