make the entire code base clang-15 compatible (#728)

* make cheat codes clang-15 compatible

* make the entire code base clang-15 compatible

* hopefully silence MSVC compiler warnings

* name arguments

* cosmetic line break

* cosmetic spacing

* convert actionf_t into a union of function pointers

* convert some forgotten code pointers

* remove support for non-existant two-arg action pointers

* apparently MSVC makes a difference between func() and func(void), wow!

* back to the original two-arg PSPR function pointers
This commit is contained in:
Fabian Greffrath 2022-09-12 18:55:05 +02:00 committed by GitHub
parent 4bbb448f64
commit efcf56308a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 1294 additions and 1285 deletions

View File

@ -1492,127 +1492,127 @@ typedef struct {
deh_bexptr deh_bexptrs[] =
{
{A_Light0, "A_Light0"},
{A_WeaponReady, "A_WeaponReady"},
{A_Lower, "A_Lower"},
{A_Raise, "A_Raise"},
{A_Punch, "A_Punch"},
{A_ReFire, "A_ReFire"},
{A_FirePistol, "A_FirePistol"},
{A_Light1, "A_Light1"},
{A_FireShotgun, "A_FireShotgun"},
{A_Light2, "A_Light2"},
{A_FireShotgun2, "A_FireShotgun2"},
{A_CheckReload, "A_CheckReload"},
{A_OpenShotgun2, "A_OpenShotgun2"},
{A_LoadShotgun2, "A_LoadShotgun2"},
{A_CloseShotgun2, "A_CloseShotgun2"},
{A_FireCGun, "A_FireCGun"},
{A_GunFlash, "A_GunFlash"},
{A_FireMissile, "A_FireMissile"},
{A_Saw, "A_Saw"},
{A_FirePlasma, "A_FirePlasma"},
{A_BFGsound, "A_BFGsound"},
{A_FireBFG, "A_FireBFG"},
{A_BFGSpray, "A_BFGSpray"},
{A_Explode, "A_Explode"},
{A_Pain, "A_Pain"},
{A_PlayerScream, "A_PlayerScream"},
{A_Fall, "A_Fall"},
{A_XScream, "A_XScream"},
{A_Look, "A_Look"},
{A_Chase, "A_Chase"},
{A_FaceTarget, "A_FaceTarget"},
{A_PosAttack, "A_PosAttack"},
{A_Scream, "A_Scream"},
{A_SPosAttack, "A_SPosAttack"},
{A_VileChase, "A_VileChase"},
{A_VileStart, "A_VileStart"},
{A_VileTarget, "A_VileTarget"},
{A_VileAttack, "A_VileAttack"},
{A_StartFire, "A_StartFire"},
{A_Fire, "A_Fire"},
{A_FireCrackle, "A_FireCrackle"},
{A_Tracer, "A_Tracer"},
{A_SkelWhoosh, "A_SkelWhoosh"},
{A_SkelFist, "A_SkelFist"},
{A_SkelMissile, "A_SkelMissile"},
{A_FatRaise, "A_FatRaise"},
{A_FatAttack1, "A_FatAttack1"},
{A_FatAttack2, "A_FatAttack2"},
{A_FatAttack3, "A_FatAttack3"},
{A_BossDeath, "A_BossDeath"},
{A_CPosAttack, "A_CPosAttack"},
{A_CPosRefire, "A_CPosRefire"},
{A_TroopAttack, "A_TroopAttack"},
{A_SargAttack, "A_SargAttack"},
{A_HeadAttack, "A_HeadAttack"},
{A_BruisAttack, "A_BruisAttack"},
{A_SkullAttack, "A_SkullAttack"},
{A_Metal, "A_Metal"},
{A_SpidRefire, "A_SpidRefire"},
{A_BabyMetal, "A_BabyMetal"},
{A_BspiAttack, "A_BspiAttack"},
{A_Hoof, "A_Hoof"},
{A_CyberAttack, "A_CyberAttack"},
{A_PainAttack, "A_PainAttack"},
{A_PainDie, "A_PainDie"},
{A_KeenDie, "A_KeenDie"},
{A_BrainPain, "A_BrainPain"},
{A_BrainScream, "A_BrainScream"},
{A_BrainDie, "A_BrainDie"},
{A_BrainAwake, "A_BrainAwake"},
{A_BrainSpit, "A_BrainSpit"},
{A_SpawnSound, "A_SpawnSound"},
{A_SpawnFly, "A_SpawnFly"},
{A_BrainExplode, "A_BrainExplode"},
{A_Detonate, "A_Detonate"}, // killough 8/9/98
{A_Mushroom, "A_Mushroom"}, // killough 10/98
{A_Die, "A_Die"}, // killough 11/98
{A_Spawn, "A_Spawn"}, // killough 11/98
{A_Turn, "A_Turn"}, // killough 11/98
{A_Face, "A_Face"}, // killough 11/98
{A_Scratch, "A_Scratch"}, // killough 11/98
{A_PlaySound, "A_PlaySound"}, // killough 11/98
{A_RandomJump, "A_RandomJump"}, // killough 11/98
{A_LineEffect, "A_LineEffect"}, // killough 11/98
{{A_Light0}, "A_Light0"},
{{A_WeaponReady}, "A_WeaponReady"},
{{A_Lower}, "A_Lower"},
{{A_Raise}, "A_Raise"},
{{A_Punch}, "A_Punch"},
{{A_ReFire}, "A_ReFire"},
{{A_FirePistol}, "A_FirePistol"},
{{A_Light1}, "A_Light1"},
{{A_FireShotgun}, "A_FireShotgun"},
{{A_Light2}, "A_Light2"},
{{A_FireShotgun2}, "A_FireShotgun2"},
{{A_CheckReload}, "A_CheckReload"},
{{A_OpenShotgun2}, "A_OpenShotgun2"},
{{A_LoadShotgun2}, "A_LoadShotgun2"},
{{A_CloseShotgun2}, "A_CloseShotgun2"},
{{A_FireCGun}, "A_FireCGun"},
{{A_GunFlash}, "A_GunFlash"},
{{A_FireMissile}, "A_FireMissile"},
{{A_Saw}, "A_Saw"},
{{A_FirePlasma}, "A_FirePlasma"},
{{A_BFGsound}, "A_BFGsound"},
{{A_FireBFG}, "A_FireBFG"},
{{A_BFGSpray}, "A_BFGSpray"},
{{A_Explode}, "A_Explode"},
{{A_Pain}, "A_Pain"},
{{A_PlayerScream}, "A_PlayerScream"},
{{A_Fall}, "A_Fall"},
{{A_XScream}, "A_XScream"},
{{A_Look}, "A_Look"},
{{A_Chase}, "A_Chase"},
{{A_FaceTarget}, "A_FaceTarget"},
{{A_PosAttack}, "A_PosAttack"},
{{A_Scream}, "A_Scream"},
{{A_SPosAttack}, "A_SPosAttack"},
{{A_VileChase}, "A_VileChase"},
{{A_VileStart}, "A_VileStart"},
{{A_VileTarget}, "A_VileTarget"},
{{A_VileAttack}, "A_VileAttack"},
{{A_StartFire}, "A_StartFire"},
{{A_Fire}, "A_Fire"},
{{A_FireCrackle}, "A_FireCrackle"},
{{A_Tracer}, "A_Tracer"},
{{A_SkelWhoosh}, "A_SkelWhoosh"},
{{A_SkelFist}, "A_SkelFist"},
{{A_SkelMissile}, "A_SkelMissile"},
{{A_FatRaise}, "A_FatRaise"},
{{A_FatAttack1}, "A_FatAttack1"},
{{A_FatAttack2}, "A_FatAttack2"},
{{A_FatAttack3}, "A_FatAttack3"},
{{A_BossDeath}, "A_BossDeath"},
{{A_CPosAttack}, "A_CPosAttack"},
{{A_CPosRefire}, "A_CPosRefire"},
{{A_TroopAttack}, "A_TroopAttack"},
{{A_SargAttack}, "A_SargAttack"},
{{A_HeadAttack}, "A_HeadAttack"},
{{A_BruisAttack}, "A_BruisAttack"},
{{A_SkullAttack}, "A_SkullAttack"},
{{A_Metal}, "A_Metal"},
{{A_SpidRefire}, "A_SpidRefire"},
{{A_BabyMetal}, "A_BabyMetal"},
{{A_BspiAttack}, "A_BspiAttack"},
{{A_Hoof}, "A_Hoof"},
{{A_CyberAttack}, "A_CyberAttack"},
{{A_PainAttack}, "A_PainAttack"},
{{A_PainDie}, "A_PainDie"},
{{A_KeenDie}, "A_KeenDie"},
{{A_BrainPain}, "A_BrainPain"},
{{A_BrainScream}, "A_BrainScream"},
{{A_BrainDie}, "A_BrainDie"},
{{A_BrainAwake}, "A_BrainAwake"},
{{A_BrainSpit}, "A_BrainSpit"},
{{A_SpawnSound}, "A_SpawnSound"},
{{A_SpawnFly}, "A_SpawnFly"},
{{A_BrainExplode}, "A_BrainExplode"},
{{A_Detonate}, "A_Detonate"}, // killough 8/9/98
{{A_Mushroom}, "A_Mushroom"}, // killough 10/98
{{A_Die}, "A_Die"}, // killough 11/98
{{A_Spawn}, "A_Spawn"}, // killough 11/98
{{A_Turn}, "A_Turn"}, // killough 11/98
{{A_Face}, "A_Face"}, // killough 11/98
{{A_Scratch}, "A_Scratch"}, // killough 11/98
{{A_PlaySound}, "A_PlaySound"}, // killough 11/98
{{A_RandomJump}, "A_RandomJump"}, // killough 11/98
{{A_LineEffect}, "A_LineEffect"}, // killough 11/98
{A_FireOldBFG, "A_FireOldBFG"}, // killough 7/19/98: classic BFG firing function
{A_BetaSkullAttack, "A_BetaSkullAttack"}, // killough 10/98: beta lost souls attacked different
{A_Stop, "A_Stop"},
{{A_FireOldBFG}, "A_FireOldBFG"}, // killough 7/19/98: classic BFG firing function
{{A_BetaSkullAttack}, "A_BetaSkullAttack"}, // killough 10/98: beta lost souls attacked different
{{A_Stop}, "A_Stop"},
// [XA] New mbf21 codepointers
{A_SpawnObject, "A_SpawnObject", 8},
{A_MonsterProjectile, "A_MonsterProjectile", 5},
{A_MonsterBulletAttack, "A_MonsterBulletAttack", 5, {0, 0, 1, 3, 5}},
{A_MonsterMeleeAttack, "A_MonsterMeleeAttack", 4, {3, 8, 0, 0}},
{A_RadiusDamage, "A_RadiusDamage", 2},
{A_NoiseAlert, "A_NoiseAlert", 0},
{A_HealChase, "A_HealChase", 2},
{A_SeekTracer, "A_SeekTracer", 2},
{A_FindTracer, "A_FindTracer", 2, {0, 10}},
{A_ClearTracer, "A_ClearTracer", 0},
{A_JumpIfHealthBelow, "A_JumpIfHealthBelow", 2},
{A_JumpIfTargetInSight, "A_JumpIfTargetInSight", 2},
{A_JumpIfTargetCloser, "A_JumpIfTargetCloser", 2},
{A_JumpIfTracerInSight, "A_JumpIfTracerInSight", 2},
{A_JumpIfTracerCloser, "A_JumpIfTracerCloser", 2},
{A_JumpIfFlagsSet, "A_JumpIfFlagsSet", 3},
{A_AddFlags, "A_AddFlags", 2},
{A_RemoveFlags, "A_RemoveFlags", 2},
{A_WeaponProjectile, "A_WeaponProjectile", 5},
{A_WeaponBulletAttack, "A_WeaponBulletAttack", 5, {0, 0, 1, 5, 3}},
{A_WeaponMeleeAttack, "A_WeaponMeleeAttack", 5, {2, 10, 1 * FRACUNIT, 0, 0}},
{A_WeaponSound, "A_WeaponSound", 2},
{A_WeaponAlert, "A_WeaponAlert", 0},
{A_WeaponJump, "A_WeaponJump", 2},
{A_ConsumeAmmo, "A_ConsumeAmmo", 1},
{A_CheckAmmo, "A_CheckAmmo", 2},
{A_RefireTo, "A_RefireTo", 2},
{A_GunFlashTo, "A_GunFlashTo", 2},
{{A_SpawnObject}, "A_SpawnObject", 8},
{{A_MonsterProjectile}, "A_MonsterProjectile", 5},
{{A_MonsterBulletAttack}, "A_MonsterBulletAttack", 5, {0, 0, 1, 3, 5}},
{{A_MonsterMeleeAttack}, "A_MonsterMeleeAttack", 4, {3, 8, 0, 0}},
{{A_RadiusDamage}, "A_RadiusDamage", 2},
{{A_NoiseAlert}, "A_NoiseAlert", 0},
{{A_HealChase}, "A_HealChase", 2},
{{A_SeekTracer}, "A_SeekTracer", 2},
{{A_FindTracer}, "A_FindTracer", 2, {0, 10}},
{{A_ClearTracer}, "A_ClearTracer", 0},
{{A_JumpIfHealthBelow}, "A_JumpIfHealthBelow", 2},
{{A_JumpIfTargetInSight}, "A_JumpIfTargetInSight", 2},
{{A_JumpIfTargetCloser}, "A_JumpIfTargetCloser", 2},
{{A_JumpIfTracerInSight}, "A_JumpIfTracerInSight", 2},
{{A_JumpIfTracerCloser}, "A_JumpIfTracerCloser", 2},
{{A_JumpIfFlagsSet}, "A_JumpIfFlagsSet", 3},
{{A_AddFlags}, "A_AddFlags", 2},
{{A_RemoveFlags}, "A_RemoveFlags", 2},
{{A_WeaponProjectile}, "A_WeaponProjectile", 5},
{{A_WeaponBulletAttack}, "A_WeaponBulletAttack", 5, {0, 0, 1, 5, 3}},
{{A_WeaponMeleeAttack}, "A_WeaponMeleeAttack", 5, {2, 10, 1 * FRACUNIT, 0, 0}},
{{A_WeaponSound}, "A_WeaponSound", 2},
{{A_WeaponAlert}, "A_WeaponAlert", 0},
{{A_WeaponJump}, "A_WeaponJump", 2},
{{A_ConsumeAmmo}, "A_ConsumeAmmo", 1},
{{A_CheckAmmo}, "A_CheckAmmo", 2},
{{A_RefireTo}, "A_RefireTo", 2},
{{A_GunFlashTo}, "A_GunFlashTo", 2},
// This NULL entry must be the last in the list
{NULL, "A_NULL"}, // Ty 05/16/98
{{NULL}, "A_NULL"}, // Ty 05/16/98
};
extern byte *defined_codeptr_args;
@ -1848,10 +1848,10 @@ void deh_procBexCodePointers(DEHFILE *fpin, FILE* fpout, char *line)
states[indexnum].action = deh_bexptrs[i].cptr; // assign
if (fpout) fprintf(fpout,
" - applied %p from codeptr[%d] to states[%d]\n",
(void*)(intptr_t)deh_bexptrs[i].cptr,i,indexnum);
(void*)(intptr_t)deh_bexptrs[i].cptr.v,i,indexnum);
found = TRUE;
}
} while (!found && (deh_bexptrs[i].cptr != NULL)); // [FG] lookup is never NULL!
} while (!found && (deh_bexptrs[i].cptr.v != NULL)); // [FG] lookup is never NULL!
if (!found)
if (fpout) fprintf(fpout,
@ -2282,11 +2282,11 @@ void deh_procPointer(DEHFILE *fpin, FILE* fpout, char *line) // done
if (!strcasecmp(key,deh_state[4])) // Codep frame (not set in Frame deh block)
{
states[indexnum].action = deh_codeptr[value];
if (fpout) fprintf(fpout," - applied %p from codeptr[%ld] to states[%d]\n",(void*)(intptr_t)deh_codeptr[value],value,indexnum);
if (fpout) fprintf(fpout," - applied %p from codeptr[%ld] to states[%d]\n",(void*)(intptr_t)deh_codeptr[value].v,value,indexnum);
// Write BEX-oriented line to match:
for (i=0;i<arrlen(deh_bexptrs);i++) // [FG] array size!
{
if (deh_bexptrs[i].cptr == deh_codeptr[value])
if (deh_bexptrs[i].cptr.v == deh_codeptr[value].v)
{
if (fpout) fprintf(fpout,"BEX [CODEPTR] -> FRAME %d = %s\n",
indexnum, &deh_bexptrs[i].lookup[2]);
@ -2296,7 +2296,7 @@ void deh_procPointer(DEHFILE *fpin, FILE* fpout, char *line) // done
}
else
if (fpout) fprintf(fpout,"Invalid frame pointer index for '%s' at %ld, xref %p\n",
key, value, (void*)(intptr_t)deh_codeptr[value]);
key, value, (void*)(intptr_t)deh_codeptr[value].v);
}
return;
}
@ -3320,7 +3320,7 @@ boolean deh_GetData(char *s, char *k, long *l, char **strval, FILE *fpout)
return(okrc);
}
static deh_bexptr null_bexptr = { NULL, "(NULL)" };
static deh_bexptr null_bexptr = { {NULL}, "(NULL)" };
void PostProcessDeh(void)
{
@ -3341,8 +3341,8 @@ void PostProcessDeh(void)
{
bexptr_match = &null_bexptr;
for (j = 0; deh_bexptrs[j].cptr != NULL; ++j)
if (states[i].action == deh_bexptrs[j].cptr)
for (j = 0; deh_bexptrs[j].cptr.v != NULL; ++j)
if (states[i].action.v == deh_bexptrs[j].cptr.v)
{
bexptr_match = &deh_bexptrs[j];
break;

View File

@ -31,8 +31,16 @@
#ifndef __D_THINK__
#define __D_THINK__
// killough 11/98: convert back to C instead of C++
typedef void (*actionf_t)();
typedef void (*actionf_v)();
typedef void (*actionf_p1)(void *);
typedef void (*actionf_p2)(void *, void *);
typedef union
{
actionf_v v;
actionf_p1 p1;
actionf_p2 p2;
} actionf_t;
// Historically, "think_t" is yet another function
// pointer to a routine to handle an actor.

2074
src/info.c

File diff suppressed because it is too large Load Diff

View File

@ -1268,7 +1268,7 @@ typedef struct
spritenum_t sprite; // sprite number to show
long frame; // which frame/subframe of the sprite is shown
long tics; // number of gametics this frame should last
void (*action)(); // code pointer to function for action if any
actionf_t action; // code pointer to function for action if any
statenum_t nextstate; // linked list pointer to next state or zero
long misc1, misc2; // used for psprite positioning
long args[MAXSTATEARGS]; // [XA] mbf21 args

View File

@ -639,7 +639,7 @@ static void cheat_massacre() // jff 2/01/98 kill all monsters
P_MapStart();
do
while ((currentthinker=currentthinker->next)!=&thinkercap)
if (currentthinker->function == P_MobjThinker &&
if (currentthinker->function.p1 == (actionf_p1)P_MobjThinker &&
!(((mobj_t *) currentthinker)->flags & mask) && // killough 7/20/98
(((mobj_t *) currentthinker)->flags & MF_COUNTKILL ||
((mobj_t *) currentthinker)->type == MT_SKULL))
@ -728,7 +728,7 @@ static void cheat_spechits()
for (th = thinkercap.next ; th != &thinkercap ; th = th->next)
{
if (th->function == P_MobjThinker)
if (th->function.p1 == (actionf_p1)P_MobjThinker)
{
mobj_t *mo = (mobj_t *) th;

View File

@ -277,7 +277,7 @@ int EV_DoCeiling
ceiling = Z_Malloc (sizeof(*ceiling), PU_LEVSPEC, 0);
P_AddThinker (&ceiling->thinker);
sec->ceilingdata = ceiling; //jff 2/22/98
ceiling->thinker.function = T_MoveCeiling;
ceiling->thinker.function.p1 = (actionf_p1)T_MoveCeiling;
ceiling->sector = sec;
ceiling->crush = false;
@ -371,7 +371,7 @@ int P_ActivateInStasisCeiling(line_t *line)
if (ceiling->tag == line->tag && ceiling->direction == 0)
{
ceiling->direction = ceiling->olddirection;
ceiling->thinker.function = T_MoveCeiling;
ceiling->thinker.function.p1 = (actionf_p1)T_MoveCeiling;
//jff 4/5/98 return if activated
rtn=1;
}
@ -399,7 +399,7 @@ int EV_CeilingCrushStop(line_t* line)
{
ceiling->olddirection = ceiling->direction;
ceiling->direction = 0;
ceiling->thinker.function = NULL;
ceiling->thinker.function.v = NULL;
rtn=1;
}
}

View File

@ -317,7 +317,7 @@ int EV_DoDoor(line_t *line, vldoor_e type)
P_AddThinker(&door->thinker);
sec->ceilingdata = door; //jff 2/22/98
door->thinker.function = T_VerticalDoor;
door->thinker.function.p1 = (actionf_p1)T_VerticalDoor;
door->sector = sec;
door->type = type;
door->topwait = VDOORWAIT;
@ -477,11 +477,11 @@ int EV_VerticalDoor(line_t *line, mobj_t *thing)
// [FG] DR doors corrupt other actions
// http://prboom.sourceforge.net/mbf-bugs.html
if (door->thinker.function == T_VerticalDoor || !demo_compatibility)
if (door->thinker.function.p1 == (actionf_p1)T_VerticalDoor || !demo_compatibility)
{
door->direction = -1; // start going down immediately
}
else if (door->thinker.function == T_PlatRaise)
else if (door->thinker.function.p1 == (actionf_p1)T_PlatRaise)
{
plat_t *plat = (plat_t *) door;
plat->wait = -1;
@ -517,7 +517,7 @@ int EV_VerticalDoor(line_t *line, mobj_t *thing)
door = Z_Malloc (sizeof(*door), PU_LEVSPEC, 0);
P_AddThinker (&door->thinker);
sec->ceilingdata = door; //jff 2/22/98
door->thinker.function = T_VerticalDoor;
door->thinker.function.p1 = (actionf_p1)T_VerticalDoor;
door->sector = sec;
door->direction = 1;
door->speed = VDOORSPEED;
@ -591,7 +591,7 @@ void P_SpawnDoorCloseIn30 (sector_t* sec)
sec->ceilingdata = door; //jff 2/22/98
sec->special = 0;
door->thinker.function = T_VerticalDoor;
door->thinker.function.p1 = (actionf_p1)T_VerticalDoor;
door->sector = sec;
door->direction = 0;
door->type = doorNormal;
@ -621,7 +621,7 @@ void P_SpawnDoorRaiseIn5Mins(sector_t *sec, int secnum)
sec->ceilingdata = door; //jff 2/22/98
sec->special = 0;
door->thinker.function = T_VerticalDoor;
door->thinker.function.p1 = (actionf_p1)T_VerticalDoor;
door->sector = sec;
door->direction = 2;
door->type = raiseIn5Mins;

View File

@ -268,7 +268,7 @@ static boolean P_IsOnLift(const mobj_t *actor)
int l;
// Short-circuit: it's on a lift which is active.
if (sec->floordata && ((thinker_t *) sec->floordata)->function==T_PlatRaise)
if (sec->floordata && ((thinker_t *) sec->floordata)->function.p1==(actionf_p1)T_PlatRaise)
return true;
// Check to see if it's in a sector which can be activated as a lift.
@ -305,7 +305,7 @@ static int P_IsUnderDamage(mobj_t *actor)
int dir = 0;
for (seclist=actor->touching_sectorlist; seclist; seclist=seclist->m_tnext)
if ((cl = seclist->m_sector->ceilingdata) &&
cl->thinker.function == T_MoveCeiling)
cl->thinker.function.p1 == (actionf_p1)T_MoveCeiling)
dir |= cl->direction;
return dir;
}
@ -2026,7 +2026,7 @@ void A_PainShootSkull(mobj_t *actor, angle_t angle)
for (currentthinker = thinkercap.next;
currentthinker != &thinkercap;
currentthinker = currentthinker->next)
if ((currentthinker->function == P_MobjThinker)
if ((currentthinker->function.p1 == (actionf_p1)P_MobjThinker)
&& ((mobj_t *)currentthinker)->type == MT_SKULL)
if (--count < 0) // killough 8/29/98: early exit
return;
@ -2258,7 +2258,7 @@ void A_BossDeath(mobj_t *mo)
// scan the remaining thinkers to see
// if all bosses are dead
for (th = thinkercap.next ; th != &thinkercap ; th=th->next)
if (th->function == P_MobjThinker)
if (th->function.p1 == (actionf_p1)P_MobjThinker)
{
mobj_t *mo2 = (mobj_t *) th;
if (mo2 != mo && mo2->type == mo->type && mo2->health > 0)
@ -2365,7 +2365,7 @@ void A_BossDeath(mobj_t *mo)
// scan the remaining thinkers to see
// if all bosses are dead
for (th = thinkercap.next ; th != &thinkercap ; th=th->next)
if (th->function == P_MobjThinker)
if (th->function.p1 == (actionf_p1)P_MobjThinker)
{
mobj_t *mo2 = (mobj_t *) th;
if (mo2 != mo && mo2->type == mo->type && mo2->health > 0)
@ -2478,7 +2478,7 @@ void P_SpawnBrainTargets(void) // killough 3/26/98: renamed old function
brain.easy = 0; // killough 3/26/98: always init easy to 0
for (thinker=thinkercap.next; thinker != &thinkercap; thinker=thinker->next)
if (thinker->function == P_MobjThinker)
if (thinker->function.p1 == (actionf_p1)P_MobjThinker)
{
mobj_t *m = (mobj_t *) thinker;
@ -2669,7 +2669,7 @@ void A_KeenDie(mobj_t* mo)
// scan the remaining thinkers to see if all Keens are dead
for (th = thinkercap.next ; th != &thinkercap ; th=th->next)
if (th->function == P_MobjThinker)
if (th->function.p1 == (actionf_p1)P_MobjThinker)
{
mobj_t *mo2 = (mobj_t *) th;
if (mo2 != mo && mo2->type == mo->type && mo2->health > 0)

View File

@ -454,7 +454,7 @@ int EV_DoFloor
floor = Z_Malloc (sizeof(*floor), PU_LEVSPEC, 0);
P_AddThinker (&floor->thinker);
sec->floordata = floor; //jff 2/22/98
floor->thinker.function = T_MoveFloor;
floor->thinker.function.p1 = (actionf_p1)T_MoveFloor;
floor->type = floortype;
floor->crush = false;
@ -761,7 +761,7 @@ int EV_BuildStairs
floor = Z_Malloc (sizeof(*floor), PU_LEVSPEC, 0);
P_AddThinker (&floor->thinker);
sec->floordata = floor;
floor->thinker.function = T_MoveFloor;
floor->thinker.function.p1 = (actionf_p1)T_MoveFloor;
floor->direction = 1;
floor->sector = sec;
floor->type = buildStair; //jff 3/31/98 do not leave uninited
@ -844,7 +844,7 @@ int EV_BuildStairs
P_AddThinker (&floor->thinker);
sec->floordata = floor; //jff 2/22/98
floor->thinker.function = T_MoveFloor;
floor->thinker.function.p1 = (actionf_p1)T_MoveFloor;
floor->direction = 1;
floor->sector = sec;
floor->speed = speed;
@ -941,7 +941,7 @@ int EV_DoDonut(line_t* line)
floor = Z_Malloc (sizeof(*floor), PU_LEVSPEC, 0);
P_AddThinker (&floor->thinker);
s2->floordata = floor; //jff 2/22/98
floor->thinker.function = T_MoveFloor;
floor->thinker.function.p1 = (actionf_p1)T_MoveFloor;
floor->type = donutRaise;
floor->crush = false;
floor->direction = 1;
@ -955,7 +955,7 @@ int EV_DoDonut(line_t* line)
floor = Z_Malloc (sizeof(*floor), PU_LEVSPEC, 0);
P_AddThinker (&floor->thinker);
s1->floordata = floor; //jff 2/22/98
floor->thinker.function = T_MoveFloor;
floor->thinker.function.p1 = (actionf_p1)T_MoveFloor;
floor->type = lowerFloor;
floor->crush = false;
floor->direction = -1;
@ -1003,7 +1003,7 @@ int EV_DoElevator
P_AddThinker (&elevator->thinker);
sec->floordata = elevator; //jff 2/22/98
sec->ceilingdata = elevator; //jff 2/22/98
elevator->thinker.function = T_MoveElevator;
elevator->thinker.function.p1 = (actionf_p1)T_MoveElevator;
elevator->type = elevtype;
// set up the fields according to the type of elevator action

View File

@ -106,7 +106,7 @@ manual_floor:
floor = Z_Malloc (sizeof(*floor), PU_LEVSPEC, 0);
P_AddThinker (&floor->thinker);
sec->floordata = floor;
floor->thinker.function = T_MoveFloor;
floor->thinker.function.p1 = (actionf_p1)T_MoveFloor;
floor->crush = Crsh;
floor->direction = Dirn? 1 : -1;
floor->sector = sec;
@ -309,7 +309,7 @@ manual_ceiling:
ceiling = Z_Malloc (sizeof(*ceiling), PU_LEVSPEC, 0);
P_AddThinker (&ceiling->thinker);
sec->ceilingdata = ceiling; //jff 2/22/98
ceiling->thinker.function = T_MoveCeiling;
ceiling->thinker.function.p1 = (actionf_p1)T_MoveCeiling;
ceiling->crush = Crsh;
ceiling->direction = Dirn? 1 : -1;
ceiling->sector = sec;
@ -522,7 +522,7 @@ manual_lift:
plat->sector = sec;
plat->sector->floordata = plat;
plat->thinker.function = T_PlatRaise;
plat->thinker.function.p1 = (actionf_p1)T_PlatRaise;
plat->crush = false;
plat->tag = line->tag;
@ -680,7 +680,7 @@ manual_stair:
floor = Z_Malloc (sizeof(*floor), PU_LEVSPEC, 0);
P_AddThinker (&floor->thinker);
sec->floordata = floor;
floor->thinker.function = T_MoveFloor;
floor->thinker.function.p1 = (actionf_p1)T_MoveFloor;
floor->direction = Dirn? 1 : -1;
floor->sector = sec;
@ -784,7 +784,7 @@ manual_stair:
P_AddThinker (&floor->thinker);
sec->floordata = floor;
floor->thinker.function = T_MoveFloor;
floor->thinker.function.p1 = (actionf_p1)T_MoveFloor;
floor->direction = Dirn? 1 : -1;
floor->sector = sec;
floor->speed = speed;
@ -866,7 +866,7 @@ manual_crusher:
ceiling = Z_Malloc (sizeof(*ceiling), PU_LEVSPEC, 0);
P_AddThinker (&ceiling->thinker);
sec->ceilingdata = ceiling; //jff 2/22/98
ceiling->thinker.function = T_MoveCeiling;
ceiling->thinker.function.p1 = (actionf_p1)T_MoveCeiling;
ceiling->crush = true;
ceiling->direction = -1;
ceiling->sector = sec;
@ -962,7 +962,7 @@ manual_locked:
P_AddThinker (&door->thinker);
sec->ceilingdata = door; //jff 2/22/98
door->thinker.function = T_VerticalDoor;
door->thinker.function.p1 = (actionf_p1)T_VerticalDoor;
door->sector = sec;
door->topwait = VDOORWAIT;
door->line = line;
@ -1070,7 +1070,7 @@ manual_door:
P_AddThinker (&door->thinker);
sec->ceilingdata = door; //jff 2/22/98
door->thinker.function = T_VerticalDoor;
door->thinker.function.p1 = (actionf_p1)T_VerticalDoor;
door->sector = sec;
// setup delay for door remaining open/closed
switch(Dely)

View File

@ -181,7 +181,7 @@ void P_SpawnFireFlicker (sector_t* sector)
P_AddThinker (&flick->thinker);
flick->thinker.function = T_FireFlicker;
flick->thinker.function.p1 = (actionf_p1)T_FireFlicker;
flick->sector = sector;
flick->maxlight = sector->lightlevel;
flick->minlight = P_FindMinSurroundingLight(sector,sector->lightlevel)+16;
@ -207,7 +207,7 @@ void P_SpawnLightFlash (sector_t* sector)
P_AddThinker (&flash->thinker);
flash->thinker.function = T_LightFlash;
flash->thinker.function.p1 = (actionf_p1)T_LightFlash;
flash->sector = sector;
flash->maxlight = sector->lightlevel;
@ -241,7 +241,7 @@ void P_SpawnStrobeFlash
flash->sector = sector;
flash->darktime = fastOrSlow;
flash->brighttime = STROBEBRIGHT;
flash->thinker.function = T_StrobeFlash;
flash->thinker.function.p1 = (actionf_p1)T_StrobeFlash;
flash->maxlight = sector->lightlevel;
flash->minlight = P_FindMinSurroundingLight(sector, sector->lightlevel);
@ -276,7 +276,7 @@ void P_SpawnGlowingLight(sector_t* sector)
g->sector = sector;
g->minlight = P_FindMinSurroundingLight(sector,sector->lightlevel);
g->maxlight = sector->lightlevel;
g->thinker.function = T_Glow;
g->thinker.function.p1 = (actionf_p1)T_Glow;
g->direction = -1;
sector->special &= ~31; //jff 3/14/98 clear non-generalized sector type

View File

@ -88,8 +88,8 @@ boolean P_SetMobjState(mobj_t* mobj,statenum_t state)
// Modified handling.
// Call action functions when the state is set
if (st->action)
st->action(mobj);
if (st->action.p1)
st->action.p1(mobj);
seenstate[state] = 1 + st->nextstate; // killough 4/9/98
@ -732,14 +732,14 @@ void P_MobjThinker (mobj_t* mobj)
{
P_XYMovement(mobj);
mobj->intflags &= ~MIF_SCROLLING;
if (mobj->thinker.function == P_RemoveThinkerDelayed) // killough
if (mobj->thinker.function.p1 == (actionf_p1)P_RemoveThinkerDelayed) // killough
return; // mobj was removed
}
if (mobj->z != mobj->floorz || mobj->momz)
{
P_ZMovement(mobj);
if (mobj->thinker.function == P_RemoveThinkerDelayed) // killough
if (mobj->thinker.function.p1 == (actionf_p1)P_RemoveThinkerDelayed) // killough
return; // mobj was removed
}
else
@ -773,7 +773,7 @@ void P_MobjThinker (mobj_t* mobj)
P_DamageMobj(mobj, NULL, NULL, 10000);
// must have been removed
if (mobj->thinker.function != P_MobjThinker)
if (mobj->thinker.function.p1 != (actionf_p1)P_MobjThinker)
return;
}
}
@ -863,7 +863,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
mobj->z = z == ONFLOORZ ? mobj->floorz : z == ONCEILINGZ ?
mobj->ceilingz - mobj->height : z;
mobj->thinker.function = P_MobjThinker;
mobj->thinker.function.p1 = (actionf_p1)P_MobjThinker;
mobj->above_thing = mobj->below_thing = 0; // phares
// for Boom friction code

View File

@ -219,7 +219,7 @@ int EV_DoPlat
plat->type = type;
plat->sector = sec;
plat->sector->floordata = plat; //jff 2/23/98 multiple thinkers
plat->thinker.function = T_PlatRaise;
plat->thinker.function.p1 = (actionf_p1)T_PlatRaise;
plat->crush = false;
plat->tag = line->tag;
@ -345,7 +345,7 @@ void P_ActivateInStasis(int tag)
plat->status = plat->oldstatus==up? down : up;
else
plat->status = plat->oldstatus;
plat->thinker.function = T_PlatRaise;
plat->thinker.function.p1 = (actionf_p1)T_PlatRaise;
}
}
}
@ -370,7 +370,7 @@ int EV_StopPlat(line_t* line)
{
plat->oldstatus = plat->status; // put it in stasis
plat->status = in_stasis;
plat->thinker.function = NULL;
plat->thinker.function.v = NULL;
}
}
return 1;

View File

@ -122,9 +122,9 @@ void P_SetPspritePtr(player_t *player, pspdef_t *psp, statenum_t stnum)
// Call action routine.
// Modified handling.
if (state->action)
if (state->action.p2)
{
state->action(player, psp);
state->action.p2(player, psp);
if (!psp->state)
break;
}
@ -1088,12 +1088,13 @@ void P_MovePsprites(player_t *player)
psp->sx2 = FRACUNIT;
if (psp->state->action != A_Lower && psp->state->action != A_Raise)
if (psp->state->action.p2 != (actionf_p2)A_Lower &&
psp->state->action.p2 != (actionf_p2)A_Raise)
{
last_sy = psp->sy2;
psp->sy2 = 32 * FRACUNIT;
}
else if (psp->state->action == A_Lower)
else if (psp->state->action.p2 == (actionf_p2)A_Lower)
{
// We want to move smoothly from where we were
psp->sy2 -= (last_sy - 32 * FRACUNIT);
@ -1103,8 +1104,8 @@ void P_MovePsprites(player_t *player)
{
// [FG] don't center during lowering and raising states
if (psp->state->misc1 ||
psp->state->action == A_Lower ||
psp->state->action == A_Raise)
psp->state->action.p2 == (actionf_p2)A_Lower ||
psp->state->action.p2 == (actionf_p2)A_Raise)
{
}
// [FG] not attacking means idle

View File

@ -66,7 +66,7 @@ typedef enum
NUMPSPRITES
} psprnum_t;
typedef struct
typedef struct pspdef_s
{
state_t *state; // a NULL state means not active
int tics;

View File

@ -174,7 +174,7 @@ static int P_ThinkerToIndex(thinker_t* thinker)
for (th = thinkercap.next, i = 0; th != &thinkercap; th = th->next)
{
if (th->function == P_MobjThinker)
if (th->function.p1 == (actionf_p1)P_MobjThinker)
{
i++;
if (th == thinker)
@ -196,7 +196,7 @@ static thinker_t* P_IndexToThinker(int index)
for (th = thinkercap.next, i = 0; th != &thinkercap; th = th->next)
{
if (th->function == P_MobjThinker)
if (th->function.p1 == (actionf_p1)P_MobjThinker)
{
i++;
if (i == index)
@ -273,7 +273,7 @@ static void saveg_read_thinker_t(thinker_t *str)
str->next = saveg_readp();
// think_t function;
str->function = (think_t)(intptr_t)saveg_readp();
str->function.v = (actionf_v)(intptr_t)saveg_readp();
// struct thinker_s* cnext;
str->cnext = saveg_readp();
@ -2123,7 +2123,7 @@ void P_ArchiveThinkers (void)
// the prev field as a placeholder, since it can be restored later.
for (th = thinkercap.next ; th != &thinkercap ; th=th->next)
if (th->function == P_MobjThinker)
if (th->function.p1 == (actionf_p1)P_MobjThinker)
th->prev = (thinker_t *) ++size;
// check that enough room is available in savegame buffer
@ -2132,7 +2132,7 @@ void P_ArchiveThinkers (void)
// save off the current thinkers
for (th = thinkercap.next ; th != &thinkercap ; th=th->next)
if (th->function == P_MobjThinker)
if (th->function.p1 == (actionf_p1)P_MobjThinker)
{
mobj_t *mobj = &tmp;
memcpy (mobj, th, sizeof(*mobj));
@ -2145,13 +2145,13 @@ void P_ArchiveThinkers (void)
// mobj thinker.
if (mobj->target)
mobj->target = mobj->target->thinker.function ==
P_MobjThinker ?
mobj->target = mobj->target->thinker.function.p1 ==
(actionf_p1)P_MobjThinker ?
(mobj_t *) mobj->target->thinker.prev : NULL;
if (mobj->tracer)
mobj->tracer = mobj->tracer->thinker.function ==
P_MobjThinker ?
mobj->tracer = mobj->tracer->thinker.function.p1 ==
(actionf_p1)P_MobjThinker ?
(mobj_t *) mobj->tracer->thinker.prev : NULL;
// killough 2/14/98: new field: save last known enemy. Prevents
@ -2159,20 +2159,20 @@ void P_ArchiveThinkers (void)
// seeing player anymore.
if (mobj->lastenemy)
mobj->lastenemy = mobj->lastenemy->thinker.function ==
P_MobjThinker ?
mobj->lastenemy = mobj->lastenemy->thinker.function.p1 ==
(actionf_p1)P_MobjThinker ?
(mobj_t *) mobj->lastenemy->thinker.prev : NULL;
// killough 2/14/98: end changes
if (mobj->above_thing) // phares
mobj->above_thing = mobj->above_thing->thinker.function ==
P_MobjThinker ?
mobj->above_thing = mobj->above_thing->thinker.function.p1 ==
(actionf_p1)P_MobjThinker ?
(mobj_t *) mobj->above_thing->thinker.prev : NULL;
if (mobj->below_thing)
mobj->below_thing = mobj->below_thing->thinker.function ==
P_MobjThinker ?
mobj->below_thing = mobj->below_thing->thinker.function.p1 ==
(actionf_p1)P_MobjThinker ?
(mobj_t *) mobj->below_thing->thinker.prev : NULL; // phares
if (mobj->player)
@ -2200,7 +2200,7 @@ void P_ArchiveThinkers (void)
// or player corpses waiting for deferred removal will be saved as
// raw pointer values instead of twizzled numbers, causing a crash
// on savegame load!
target = target->thinker.function == P_MobjThinker ?
target = target->thinker.function.p1 == (actionf_p1)P_MobjThinker ?
(mobj_t *)target->thinker.prev : NULL;
}
@ -2252,7 +2252,7 @@ void P_UnArchiveThinkers (void)
for (th = thinkercap.next; th != &thinkercap; )
{
thinker_t *next = th->next;
if (th->function == P_MobjThinker)
if (th->function.p1 == (actionf_p1)P_MobjThinker)
P_RemoveMobj ((mobj_t *) th);
else
Z_Free (th);
@ -2302,7 +2302,7 @@ void P_UnArchiveThinkers (void)
// mobj->floorz = mobj->subsector->sector->floorheight;
// mobj->ceilingz = mobj->subsector->sector->ceilingheight;
mobj->thinker.function = P_MobjThinker;
mobj->thinker.function.p1 = (actionf_p1)P_MobjThinker;
P_AddThinker (&mobj->thinker);
}
@ -2396,7 +2396,7 @@ void P_ArchiveSpecials (void)
// save off the current thinkers (memory size calculation -- killough)
for (th = thinkercap.next ; th != &thinkercap ; th=th->next)
if (!th->function)
if (!th->function.v)
{
platlist_t *pl;
ceilinglist_t *cl; //jff 2/22/98 need this for ceilings too now
@ -2416,18 +2416,18 @@ void P_ArchiveSpecials (void)
}
else
size +=
th->function==T_MoveCeiling ? 4+sizeof(ceiling_t) :
th->function==T_VerticalDoor ? 4+sizeof(vldoor_t) :
th->function==T_MoveFloor ? 4+sizeof(floormove_t):
th->function==T_PlatRaise ? 4+sizeof(plat_t) :
th->function==T_LightFlash ? 4+sizeof(lightflash_t):
th->function==T_StrobeFlash ? 4+sizeof(strobe_t) :
th->function==T_Glow ? 4+sizeof(glow_t) :
th->function==T_MoveElevator ? 4+sizeof(elevator_t):
th->function==T_Scroll ? 4+sizeof(scroll_t) :
th->function==T_Pusher ? 4+sizeof(pusher_t) :
th->function==T_FireFlicker? 4+sizeof(fireflicker_t) :
th->function==T_Friction ? 4+sizeof(friction_t) :
th->function.p1==(actionf_p1)T_MoveCeiling ? 4+sizeof(ceiling_t) :
th->function.p1==(actionf_p1)T_VerticalDoor ? 4+sizeof(vldoor_t) :
th->function.p1==(actionf_p1)T_MoveFloor ? 4+sizeof(floormove_t):
th->function.p1==(actionf_p1)T_PlatRaise ? 4+sizeof(plat_t) :
th->function.p1==(actionf_p1)T_LightFlash ? 4+sizeof(lightflash_t):
th->function.p1==(actionf_p1)T_StrobeFlash ? 4+sizeof(strobe_t) :
th->function.p1==(actionf_p1)T_Glow ? 4+sizeof(glow_t) :
th->function.p1==(actionf_p1)T_MoveElevator ? 4+sizeof(elevator_t):
th->function.p1==(actionf_p1)T_Scroll ? 4+sizeof(scroll_t) :
th->function.p1==(actionf_p1)T_Pusher ? 4+sizeof(pusher_t) :
th->function.p1==(actionf_p1)T_FireFlicker ? 4+sizeof(fireflicker_t) :
th->function.p1==(actionf_p1)T_Friction ? 4+sizeof(friction_t) :
0;
CheckSaveGame(size); // killough
@ -2435,7 +2435,7 @@ void P_ArchiveSpecials (void)
// save off the current thinkers
for (th=thinkercap.next; th!=&thinkercap; th=th->next)
{
if (!th->function)
if (!th->function.v)
{
platlist_t *pl;
ceilinglist_t *cl; //jff 2/22/98 add iter variable for ceilings
@ -2456,7 +2456,7 @@ void P_ArchiveSpecials (void)
continue;
}
if (th->function == T_MoveCeiling)
if (th->function.p1 == (actionf_p1)T_MoveCeiling)
{
ceiling: // killough 2/14/98
saveg_write8(tc_ceiling);
@ -2465,7 +2465,7 @@ void P_ArchiveSpecials (void)
continue;
}
if (th->function == T_VerticalDoor)
if (th->function.p1 == (actionf_p1)T_VerticalDoor)
{
saveg_write8(tc_door);
saveg_write_pad();
@ -2473,7 +2473,7 @@ void P_ArchiveSpecials (void)
continue;
}
if (th->function == T_MoveFloor)
if (th->function.p1 == (actionf_p1)T_MoveFloor)
{
saveg_write8(tc_floor);
saveg_write_pad();
@ -2481,7 +2481,7 @@ void P_ArchiveSpecials (void)
continue;
}
if (th->function == T_PlatRaise)
if (th->function.p1 == (actionf_p1)T_PlatRaise)
{
plat: // killough 2/14/98: added fix for original plat height above
saveg_write8(tc_plat);
@ -2490,7 +2490,7 @@ void P_ArchiveSpecials (void)
continue;
}
if (th->function == T_LightFlash)
if (th->function.p1 == (actionf_p1)T_LightFlash)
{
saveg_write8(tc_flash);
saveg_write_pad();
@ -2498,7 +2498,7 @@ void P_ArchiveSpecials (void)
continue;
}
if (th->function == T_StrobeFlash)
if (th->function.p1 == (actionf_p1)T_StrobeFlash)
{
saveg_write8(tc_strobe);
saveg_write_pad();
@ -2506,7 +2506,7 @@ void P_ArchiveSpecials (void)
continue;
}
if (th->function == T_Glow)
if (th->function.p1 == (actionf_p1)T_Glow)
{
saveg_write8(tc_glow);
saveg_write_pad();
@ -2515,7 +2515,7 @@ void P_ArchiveSpecials (void)
}
// killough 10/4/98: save flickers
if (th->function == T_FireFlicker)
if (th->function.p1 == (actionf_p1)T_FireFlicker)
{
saveg_write8(tc_flicker);
saveg_write_pad();
@ -2524,7 +2524,7 @@ void P_ArchiveSpecials (void)
}
//jff 2/22/98 new case for elevators
if (th->function == T_MoveElevator)
if (th->function.p1 == (actionf_p1)T_MoveElevator)
{
saveg_write8(tc_elevator);
saveg_write_pad();
@ -2533,7 +2533,7 @@ void P_ArchiveSpecials (void)
}
// killough 3/7/98: Scroll effect thinkers
if (th->function == T_Scroll)
if (th->function.p1 == (actionf_p1)T_Scroll)
{
saveg_write8(tc_scroll);
saveg_write_scroll_t((scroll_t *) th);
@ -2542,7 +2542,7 @@ void P_ArchiveSpecials (void)
// phares 3/22/98: Push/Pull effect thinkers
if (th->function == T_Pusher)
if (th->function.p1 == (actionf_p1)T_Pusher)
{
saveg_write8(tc_pusher);
saveg_write_pusher_t((pusher_t *) th);
@ -2550,7 +2550,7 @@ void P_ArchiveSpecials (void)
}
// store friction for complevel Boom
if (th->function == T_Friction)
if (th->function.p1 == (actionf_p1)T_Friction)
{
saveg_write8(tc_friction);
saveg_write_pad();
@ -2582,8 +2582,8 @@ void P_UnArchiveSpecials (void)
saveg_read_ceiling_t(ceiling);
ceiling->sector->ceilingdata = ceiling; //jff 2/22/98
if (ceiling->thinker.function)
ceiling->thinker.function = T_MoveCeiling;
if (ceiling->thinker.function.p1)
ceiling->thinker.function.p1 = (actionf_p1)T_MoveCeiling;
P_AddThinker (&ceiling->thinker);
P_AddActiveCeiling(ceiling);
@ -2600,7 +2600,7 @@ void P_UnArchiveSpecials (void)
door->line = (size_t)door->line!=-1? &lines[(size_t)door->line] : NULL;
door->sector->ceilingdata = door; //jff 2/22/98
door->thinker.function = T_VerticalDoor;
door->thinker.function.p1 = (actionf_p1)T_VerticalDoor;
P_AddThinker (&door->thinker);
break;
}
@ -2611,7 +2611,7 @@ void P_UnArchiveSpecials (void)
floormove_t *floor = Z_Malloc (sizeof(*floor), PU_LEVEL, NULL);
saveg_read_floormove_t(floor);
floor->sector->floordata = floor; //jff 2/22/98
floor->thinker.function = T_MoveFloor;
floor->thinker.function.p1 = (actionf_p1)T_MoveFloor;
P_AddThinker (&floor->thinker);
break;
}
@ -2623,8 +2623,8 @@ void P_UnArchiveSpecials (void)
saveg_read_plat_t(plat);
plat->sector->floordata = plat; //jff 2/22/98
if (plat->thinker.function)
plat->thinker.function = T_PlatRaise;
if (plat->thinker.function.p1)
plat->thinker.function.p1 = (actionf_p1)T_PlatRaise;
P_AddThinker (&plat->thinker);
P_AddActivePlat(plat);
@ -2636,7 +2636,7 @@ void P_UnArchiveSpecials (void)
{
lightflash_t *flash = Z_Malloc (sizeof(*flash), PU_LEVEL, NULL);
saveg_read_lightflash_t(flash);
flash->thinker.function = T_LightFlash;
flash->thinker.function.p1 = (actionf_p1)T_LightFlash;
P_AddThinker (&flash->thinker);
break;
}
@ -2646,7 +2646,7 @@ void P_UnArchiveSpecials (void)
{
strobe_t *strobe = Z_Malloc (sizeof(*strobe), PU_LEVEL, NULL);
saveg_read_strobe_t(strobe);
strobe->thinker.function = T_StrobeFlash;
strobe->thinker.function.p1 = (actionf_p1)T_StrobeFlash;
P_AddThinker (&strobe->thinker);
break;
}
@ -2656,7 +2656,7 @@ void P_UnArchiveSpecials (void)
{
glow_t *glow = Z_Malloc (sizeof(*glow), PU_LEVEL, NULL);
saveg_read_glow_t(glow);
glow->thinker.function = T_Glow;
glow->thinker.function.p1 = (actionf_p1)T_Glow;
P_AddThinker (&glow->thinker);
break;
}
@ -2666,7 +2666,7 @@ void P_UnArchiveSpecials (void)
{
fireflicker_t *flicker = Z_Malloc (sizeof(*flicker), PU_LEVEL, NULL);
saveg_read_fireflicker_t(flicker);
flicker->thinker.function = T_FireFlicker;
flicker->thinker.function.p1 = (actionf_p1)T_FireFlicker;
P_AddThinker (&flicker->thinker);
break;
}
@ -2679,7 +2679,7 @@ void P_UnArchiveSpecials (void)
saveg_read_elevator_t(elevator);
elevator->sector->floordata = elevator; //jff 2/22/98
elevator->sector->ceilingdata = elevator; //jff 2/22/98
elevator->thinker.function = T_MoveElevator;
elevator->thinker.function.p1 = (actionf_p1)T_MoveElevator;
P_AddThinker (&elevator->thinker);
break;
}
@ -2688,7 +2688,7 @@ void P_UnArchiveSpecials (void)
{
scroll_t *scroll = Z_Malloc (sizeof(scroll_t), PU_LEVEL, NULL);
saveg_read_scroll_t(scroll);
scroll->thinker.function = T_Scroll;
scroll->thinker.function.p1 = (actionf_p1)T_Scroll;
P_AddThinker(&scroll->thinker);
break;
}
@ -2697,7 +2697,7 @@ void P_UnArchiveSpecials (void)
{
pusher_t *pusher = Z_Malloc (sizeof(pusher_t), PU_LEVEL, NULL);
saveg_read_pusher_t(pusher);
pusher->thinker.function = T_Pusher;
pusher->thinker.function.p1 = (actionf_p1)T_Pusher;
// can't convert from index to pointer, old save version
if (pusher->source == NULL)
{
@ -2716,7 +2716,7 @@ void P_UnArchiveSpecials (void)
{
friction_t *friction = Z_Malloc (sizeof(friction_t), PU_LEVEL, NULL);
saveg_read_friction_t(friction);
friction->thinker.function = T_Friction;
friction->thinker.function.p1 = (actionf_p1)T_Friction;
P_AddThinker(&friction->thinker);
break;
}

View File

@ -2660,7 +2660,7 @@ static void Add_Scroller(int type, fixed_t dx, fixed_t dy,
int control, int affectee, int accel)
{
scroll_t *s = Z_Malloc(sizeof *s, PU_LEVSPEC, 0);
s->thinker.function = T_Scroll;
s->thinker.function.p1 = (actionf_p1)T_Scroll;
s->type = type;
s->dx = dx;
s->dy = dy;
@ -2823,7 +2823,7 @@ static void Add_Friction(int friction, int movefactor, int affectee)
{
friction_t *f = Z_Malloc(sizeof *f, PU_LEVSPEC, 0);
f->thinker.function/*.acp1*/ = /*(actionf_p1) */T_Friction;
f->thinker.function.p1 = (actionf_p1)T_Friction;
f->friction = friction;
f->movefactor = movefactor;
f->affectee = affectee;
@ -3054,7 +3054,7 @@ static void Add_Pusher(int type, int x_mag, int y_mag,
{
pusher_t *p = Z_Malloc(sizeof *p, PU_LEVSPEC, 0);
p->thinker.function = T_Pusher;
p->thinker.function.p1 = (actionf_p1)T_Pusher;
p->source = source;
p->type = type;
p->x_mag = x_mag>>FRACBITS;

View File

@ -58,7 +58,7 @@ int EV_Teleport(line_t *line, int side, mobj_t *thing)
for (i = -1; (i = P_FindSectorFromLineTag(line, i)) >= 0;)
for (thinker=thinkercap.next; thinker!=&thinkercap; thinker=thinker->next)
if (thinker->function == P_MobjThinker &&
if (thinker->function.p1 == (actionf_p1)P_MobjThinker &&
(m = (mobj_t *) thinker)->type == MT_TELEPORTMAN &&
m->subsector->sector-sectors == i)
{
@ -133,7 +133,7 @@ int EV_SilentTeleport(line_t *line, int side, mobj_t *thing)
for (i = -1; (i = P_FindSectorFromLineTag(line, i)) >= 0;)
for (th = thinkercap.next; th != &thinkercap; th = th->next)
if (th->function == P_MobjThinker &&
if (th->function.p1 == (actionf_p1)P_MobjThinker &&
(m = (mobj_t *) th)->type == MT_TELEPORTMAN &&
m->subsector->sector-sectors == i)
{

View File

@ -86,8 +86,8 @@ void P_UpdateThinker(thinker_t *thinker)
// find the class the thinker belongs to
// haleyjd 07/12/03: don't use "class" as a variable name
int tclass = thinker->function == P_RemoveThinkerDelayed ? th_delete :
thinker->function == P_MobjThinker &&
int tclass = thinker->function.p1 == (actionf_p1)P_RemoveThinkerDelayed ? th_delete :
thinker->function.p1 == (actionf_p1)P_MobjThinker &&
((mobj_t *) thinker)->health > 0 &&
(((mobj_t *) thinker)->flags & MF_COUNTKILL ||
((mobj_t *) thinker)->type == MT_SKULL) ?
@ -171,7 +171,7 @@ void P_RemoveThinkerDelayed(thinker_t *thinker)
//
void P_RemoveThinker(thinker_t *thinker)
{
thinker->function = P_RemoveThinkerDelayed;
thinker->function.p1 = (actionf_p1)P_RemoveThinkerDelayed;
// killough 8/29/98: remove immediately from threaded list
@ -237,8 +237,8 @@ static void P_RunThinkers (void)
for (currentthinker = thinkercap.next;
currentthinker != &thinkercap;
currentthinker = currentthinker->next)
if (currentthinker->function)
currentthinker->function(currentthinker);
if (currentthinker->function.p1)
currentthinker->function.p1(currentthinker);
// [crispy] support MUSINFO lump (dynamic music changing)
T_MusInfo();

View File

@ -1135,7 +1135,7 @@ void R_PrecacheLevel(void)
{
thinker_t *th;
for (th = thinkercap.next ; th != &thinkercap ; th=th->next)
if (th->function == P_MobjThinker)
if (th->function.p1 == (actionf_p1)P_MobjThinker)
hitlist[((mobj_t *)th)->sprite] = 1;
}