mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-24 04:29:34 -04:00
move action pointers into a separate header file (#780)
* move action pointers into a separate header file * remove redundant declarations from p_enemy.c * fix inclusion guard
This commit is contained in:
parent
b96bd90ec9
commit
e18df53c8f
@ -68,6 +68,7 @@ set(WOOF_SOURCES
|
|||||||
net_sdl.c net_sdl.h
|
net_sdl.c net_sdl.h
|
||||||
net_server.c net_server.h
|
net_server.c net_server.h
|
||||||
net_structrw.c net_structrw.h
|
net_structrw.c net_structrw.h
|
||||||
|
p_action.h
|
||||||
p_ceilng.c
|
p_ceilng.c
|
||||||
p_doors.c
|
p_doors.c
|
||||||
p_enemy.c p_enemy.h
|
p_enemy.c p_enemy.h
|
||||||
|
120
src/d_deh.c
120
src/d_deh.c
@ -1362,125 +1362,7 @@ char *deh_misc[] =
|
|||||||
|
|
||||||
// External references to action functions scattered about the code
|
// External references to action functions scattered about the code
|
||||||
|
|
||||||
extern void A_Light0();
|
#include "p_action.h"
|
||||||
extern void A_WeaponReady();
|
|
||||||
extern void A_Lower();
|
|
||||||
extern void A_Raise();
|
|
||||||
extern void A_Punch();
|
|
||||||
extern void A_ReFire();
|
|
||||||
extern void A_FirePistol();
|
|
||||||
extern void A_Light1();
|
|
||||||
extern void A_FireShotgun();
|
|
||||||
extern void A_Light2();
|
|
||||||
extern void A_FireShotgun2();
|
|
||||||
extern void A_CheckReload();
|
|
||||||
extern void A_OpenShotgun2();
|
|
||||||
extern void A_LoadShotgun2();
|
|
||||||
extern void A_CloseShotgun2();
|
|
||||||
extern void A_FireCGun();
|
|
||||||
extern void A_GunFlash();
|
|
||||||
extern void A_FireMissile();
|
|
||||||
extern void A_Saw();
|
|
||||||
extern void A_FirePlasma();
|
|
||||||
extern void A_BFGsound();
|
|
||||||
extern void A_FireBFG();
|
|
||||||
extern void A_BFGSpray();
|
|
||||||
extern void A_Explode();
|
|
||||||
extern void A_Pain();
|
|
||||||
extern void A_PlayerScream();
|
|
||||||
extern void A_Fall();
|
|
||||||
extern void A_XScream();
|
|
||||||
extern void A_Look();
|
|
||||||
extern void A_Chase();
|
|
||||||
extern void A_FaceTarget();
|
|
||||||
extern void A_PosAttack();
|
|
||||||
extern void A_Scream();
|
|
||||||
extern void A_SPosAttack();
|
|
||||||
extern void A_VileChase();
|
|
||||||
extern void A_VileStart();
|
|
||||||
extern void A_VileTarget();
|
|
||||||
extern void A_VileAttack();
|
|
||||||
extern void A_StartFire();
|
|
||||||
extern void A_Fire();
|
|
||||||
extern void A_FireCrackle();
|
|
||||||
extern void A_Tracer();
|
|
||||||
extern void A_SkelWhoosh();
|
|
||||||
extern void A_SkelFist();
|
|
||||||
extern void A_SkelMissile();
|
|
||||||
extern void A_FatRaise();
|
|
||||||
extern void A_FatAttack1();
|
|
||||||
extern void A_FatAttack2();
|
|
||||||
extern void A_FatAttack3();
|
|
||||||
extern void A_BossDeath();
|
|
||||||
extern void A_CPosAttack();
|
|
||||||
extern void A_CPosRefire();
|
|
||||||
extern void A_TroopAttack();
|
|
||||||
extern void A_SargAttack();
|
|
||||||
extern void A_HeadAttack();
|
|
||||||
extern void A_BruisAttack();
|
|
||||||
extern void A_SkullAttack();
|
|
||||||
extern void A_Metal();
|
|
||||||
extern void A_SpidRefire();
|
|
||||||
extern void A_BabyMetal();
|
|
||||||
extern void A_BspiAttack();
|
|
||||||
extern void A_Hoof();
|
|
||||||
extern void A_CyberAttack();
|
|
||||||
extern void A_PainAttack();
|
|
||||||
extern void A_PainDie();
|
|
||||||
extern void A_KeenDie();
|
|
||||||
extern void A_BrainPain();
|
|
||||||
extern void A_BrainScream();
|
|
||||||
extern void A_BrainDie();
|
|
||||||
extern void A_BrainAwake();
|
|
||||||
extern void A_BrainSpit();
|
|
||||||
extern void A_SpawnSound();
|
|
||||||
extern void A_SpawnFly();
|
|
||||||
extern void A_BrainExplode();
|
|
||||||
extern void A_Detonate(); // killough 8/9/98
|
|
||||||
extern void A_Mushroom(); // killough 10/98
|
|
||||||
extern void A_Die(); // killough 11/98
|
|
||||||
extern void A_Spawn(); // killough 11/98
|
|
||||||
extern void A_Turn(); // killough 11/98
|
|
||||||
extern void A_Face(); // killough 11/98
|
|
||||||
extern void A_Scratch(); // killough 11/98
|
|
||||||
extern void A_PlaySound(); // killough 11/98
|
|
||||||
extern void A_RandomJump(); // killough 11/98
|
|
||||||
extern void A_LineEffect(); // killough 11/98
|
|
||||||
|
|
||||||
extern void A_FireOldBFG(); // killough 7/19/98: classic BFG firing function
|
|
||||||
extern void A_BetaSkullAttack(); // killough 10/98: beta lost souls attacked different
|
|
||||||
extern void A_Stop();
|
|
||||||
|
|
||||||
// [XA] New mbf21 codepointers
|
|
||||||
|
|
||||||
extern void A_SpawnObject();
|
|
||||||
extern void A_MonsterProjectile();
|
|
||||||
extern void A_MonsterBulletAttack();
|
|
||||||
extern void A_MonsterMeleeAttack();
|
|
||||||
extern void A_RadiusDamage();
|
|
||||||
extern void A_NoiseAlert();
|
|
||||||
extern void A_HealChase();
|
|
||||||
extern void A_SeekTracer();
|
|
||||||
extern void A_FindTracer();
|
|
||||||
extern void A_ClearTracer();
|
|
||||||
extern void A_JumpIfHealthBelow();
|
|
||||||
extern void A_JumpIfTargetInSight();
|
|
||||||
extern void A_JumpIfTargetCloser();
|
|
||||||
extern void A_JumpIfTracerInSight();
|
|
||||||
extern void A_JumpIfTracerCloser();
|
|
||||||
extern void A_JumpIfFlagsSet();
|
|
||||||
extern void A_AddFlags();
|
|
||||||
extern void A_RemoveFlags();
|
|
||||||
extern void A_WeaponProjectile();
|
|
||||||
extern void A_WeaponBulletAttack();
|
|
||||||
extern void A_WeaponMeleeAttack();
|
|
||||||
extern void A_WeaponSound();
|
|
||||||
extern void A_WeaponAlert();
|
|
||||||
extern void A_WeaponJump();
|
|
||||||
extern void A_ConsumeAmmo();
|
|
||||||
extern void A_CheckAmmo();
|
|
||||||
extern void A_RefireTo();
|
|
||||||
extern void A_GunFlashTo();
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
actionf_t cptr; // actual pointer to the subroutine
|
actionf_t cptr; // actual pointer to the subroutine
|
||||||
|
89
src/info.c
89
src/info.c
@ -91,94 +91,7 @@ char *original_sprnames[NUMSPRITES+1] = {
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
// ********************************************************************
|
#include "p_action.h"
|
||||||
// Function addresses or Code Pointers
|
|
||||||
// ********************************************************************
|
|
||||||
// These function addresses are the Code Pointers that have been
|
|
||||||
// modified for years by Dehacked enthusiasts. The new BEX format
|
|
||||||
// allows more extensive changes (see d_deh.c)
|
|
||||||
|
|
||||||
// Doesn't work with g++, needs actionf_p1
|
|
||||||
void A_Light0();
|
|
||||||
void A_WeaponReady();
|
|
||||||
void A_Lower();
|
|
||||||
void A_Raise();
|
|
||||||
void A_Punch();
|
|
||||||
void A_ReFire();
|
|
||||||
void A_FirePistol();
|
|
||||||
void A_Light1();
|
|
||||||
void A_FireShotgun();
|
|
||||||
void A_Light2();
|
|
||||||
void A_FireShotgun2();
|
|
||||||
void A_CheckReload();
|
|
||||||
void A_OpenShotgun2();
|
|
||||||
void A_LoadShotgun2();
|
|
||||||
void A_CloseShotgun2();
|
|
||||||
void A_FireCGun();
|
|
||||||
void A_GunFlash();
|
|
||||||
void A_FireMissile();
|
|
||||||
void A_Saw();
|
|
||||||
void A_FirePlasma();
|
|
||||||
void A_BFGsound();
|
|
||||||
void A_FireBFG();
|
|
||||||
void A_BFGSpray();
|
|
||||||
void A_Explode();
|
|
||||||
void A_Pain();
|
|
||||||
void A_PlayerScream();
|
|
||||||
void A_Fall();
|
|
||||||
void A_Stop();
|
|
||||||
void A_XScream();
|
|
||||||
void A_Look();
|
|
||||||
void A_Chase();
|
|
||||||
void A_FaceTarget();
|
|
||||||
void A_PosAttack();
|
|
||||||
void A_Scream();
|
|
||||||
void A_Die();
|
|
||||||
void A_SPosAttack();
|
|
||||||
void A_VileChase();
|
|
||||||
void A_VileStart();
|
|
||||||
void A_VileTarget();
|
|
||||||
void A_VileAttack();
|
|
||||||
void A_StartFire();
|
|
||||||
void A_Fire();
|
|
||||||
void A_FireCrackle();
|
|
||||||
void A_Tracer();
|
|
||||||
void A_SkelWhoosh();
|
|
||||||
void A_SkelFist();
|
|
||||||
void A_SkelMissile();
|
|
||||||
void A_FatRaise();
|
|
||||||
void A_FatAttack1();
|
|
||||||
void A_FatAttack2();
|
|
||||||
void A_FatAttack3();
|
|
||||||
void A_BossDeath();
|
|
||||||
void A_CPosAttack();
|
|
||||||
void A_CPosRefire();
|
|
||||||
void A_TroopAttack();
|
|
||||||
void A_SargAttack();
|
|
||||||
void A_HeadAttack();
|
|
||||||
void A_BruisAttack();
|
|
||||||
void A_SkullAttack();
|
|
||||||
void A_Metal();
|
|
||||||
void A_SpidRefire();
|
|
||||||
void A_BabyMetal();
|
|
||||||
void A_BspiAttack();
|
|
||||||
void A_Hoof();
|
|
||||||
void A_CyberAttack();
|
|
||||||
void A_PainAttack();
|
|
||||||
void A_PainDie();
|
|
||||||
void A_KeenDie();
|
|
||||||
void A_BrainPain();
|
|
||||||
void A_BrainScream();
|
|
||||||
void A_BrainDie();
|
|
||||||
void A_BrainAwake();
|
|
||||||
void A_BrainSpit();
|
|
||||||
void A_SpawnSound();
|
|
||||||
void A_SpawnFly();
|
|
||||||
void A_BrainExplode();
|
|
||||||
void A_FireOldBFG(); // killough 7/19/98: classic BFG firing function
|
|
||||||
void A_Detonate(); // killough 8/9/98: detonate a bomb or other device
|
|
||||||
void A_Mushroom(); // killough 10/98: mushroom effect
|
|
||||||
void A_BetaSkullAttack(); // killough 10/98: beta lost souls attacked different
|
|
||||||
|
|
||||||
// ********************************************************************
|
// ********************************************************************
|
||||||
// State or "frame" information
|
// State or "frame" information
|
||||||
|
155
src/p_action.h
Normal file
155
src/p_action.h
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
//--------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Copyright (C) 1999 by
|
||||||
|
// id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
|
||||||
|
//
|
||||||
|
// This program is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU General Public License
|
||||||
|
// as published by the Free Software Foundation; either version 2
|
||||||
|
// of the License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||||
|
// 02111-1307, USA.
|
||||||
|
//
|
||||||
|
// Description: Action pointers.
|
||||||
|
//
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
|
#ifndef __P_ACTION__
|
||||||
|
#define __P_ACTION__
|
||||||
|
|
||||||
|
// ********************************************************************
|
||||||
|
// Function addresses or Code Pointers
|
||||||
|
// ********************************************************************
|
||||||
|
// These function addresses are the Code Pointers that have been
|
||||||
|
// modified for years by Dehacked enthusiasts. The new BEX format
|
||||||
|
// allows more extensive changes (see d_deh.c)
|
||||||
|
|
||||||
|
extern void A_Light0();
|
||||||
|
extern void A_WeaponReady();
|
||||||
|
extern void A_Lower();
|
||||||
|
extern void A_Raise();
|
||||||
|
extern void A_Punch();
|
||||||
|
extern void A_ReFire();
|
||||||
|
extern void A_FirePistol();
|
||||||
|
extern void A_Light1();
|
||||||
|
extern void A_FireShotgun();
|
||||||
|
extern void A_Light2();
|
||||||
|
extern void A_FireShotgun2();
|
||||||
|
extern void A_CheckReload();
|
||||||
|
extern void A_OpenShotgun2();
|
||||||
|
extern void A_LoadShotgun2();
|
||||||
|
extern void A_CloseShotgun2();
|
||||||
|
extern void A_FireCGun();
|
||||||
|
extern void A_GunFlash();
|
||||||
|
extern void A_FireMissile();
|
||||||
|
extern void A_Saw();
|
||||||
|
extern void A_FirePlasma();
|
||||||
|
extern void A_BFGsound();
|
||||||
|
extern void A_FireBFG();
|
||||||
|
extern void A_BFGSpray();
|
||||||
|
extern void A_Explode();
|
||||||
|
extern void A_Pain();
|
||||||
|
extern void A_PlayerScream();
|
||||||
|
extern void A_Fall();
|
||||||
|
extern void A_XScream();
|
||||||
|
extern void A_Look();
|
||||||
|
extern void A_Chase();
|
||||||
|
extern void A_FaceTarget();
|
||||||
|
extern void A_PosAttack();
|
||||||
|
extern void A_Scream();
|
||||||
|
extern void A_SPosAttack();
|
||||||
|
extern void A_VileChase();
|
||||||
|
extern void A_VileStart();
|
||||||
|
extern void A_VileTarget();
|
||||||
|
extern void A_VileAttack();
|
||||||
|
extern void A_StartFire();
|
||||||
|
extern void A_Fire();
|
||||||
|
extern void A_FireCrackle();
|
||||||
|
extern void A_Tracer();
|
||||||
|
extern void A_SkelWhoosh();
|
||||||
|
extern void A_SkelFist();
|
||||||
|
extern void A_SkelMissile();
|
||||||
|
extern void A_FatRaise();
|
||||||
|
extern void A_FatAttack1();
|
||||||
|
extern void A_FatAttack2();
|
||||||
|
extern void A_FatAttack3();
|
||||||
|
extern void A_BossDeath();
|
||||||
|
extern void A_CPosAttack();
|
||||||
|
extern void A_CPosRefire();
|
||||||
|
extern void A_TroopAttack();
|
||||||
|
extern void A_SargAttack();
|
||||||
|
extern void A_HeadAttack();
|
||||||
|
extern void A_BruisAttack();
|
||||||
|
extern void A_SkullAttack();
|
||||||
|
extern void A_Metal();
|
||||||
|
extern void A_SpidRefire();
|
||||||
|
extern void A_BabyMetal();
|
||||||
|
extern void A_BspiAttack();
|
||||||
|
extern void A_Hoof();
|
||||||
|
extern void A_CyberAttack();
|
||||||
|
extern void A_PainAttack();
|
||||||
|
extern void A_PainDie();
|
||||||
|
extern void A_KeenDie();
|
||||||
|
extern void A_BrainPain();
|
||||||
|
extern void A_BrainScream();
|
||||||
|
extern void A_BrainDie();
|
||||||
|
extern void A_BrainAwake();
|
||||||
|
extern void A_BrainSpit();
|
||||||
|
extern void A_SpawnSound();
|
||||||
|
extern void A_SpawnFly();
|
||||||
|
extern void A_BrainExplode();
|
||||||
|
extern void A_Detonate(); // killough 8/9/98
|
||||||
|
extern void A_Mushroom(); // killough 10/98
|
||||||
|
extern void A_Die(); // killough 11/98
|
||||||
|
extern void A_Spawn(); // killough 11/98
|
||||||
|
extern void A_Turn(); // killough 11/98
|
||||||
|
extern void A_Face(); // killough 11/98
|
||||||
|
extern void A_Scratch(); // killough 11/98
|
||||||
|
extern void A_PlaySound(); // killough 11/98
|
||||||
|
extern void A_RandomJump(); // killough 11/98
|
||||||
|
extern void A_LineEffect(); // killough 11/98
|
||||||
|
|
||||||
|
extern void A_FireOldBFG(); // killough 7/19/98: classic BFG firing function
|
||||||
|
extern void A_BetaSkullAttack(); // killough 10/98: beta lost souls attacked different
|
||||||
|
extern void A_Stop();
|
||||||
|
|
||||||
|
// [XA] New mbf21 codepointers
|
||||||
|
|
||||||
|
extern void A_SpawnObject();
|
||||||
|
extern void A_MonsterProjectile();
|
||||||
|
extern void A_MonsterBulletAttack();
|
||||||
|
extern void A_MonsterMeleeAttack();
|
||||||
|
extern void A_RadiusDamage();
|
||||||
|
extern void A_NoiseAlert();
|
||||||
|
extern void A_HealChase();
|
||||||
|
extern void A_SeekTracer();
|
||||||
|
extern void A_FindTracer();
|
||||||
|
extern void A_ClearTracer();
|
||||||
|
extern void A_JumpIfHealthBelow();
|
||||||
|
extern void A_JumpIfTargetInSight();
|
||||||
|
extern void A_JumpIfTargetCloser();
|
||||||
|
extern void A_JumpIfTracerInSight();
|
||||||
|
extern void A_JumpIfTracerCloser();
|
||||||
|
extern void A_JumpIfFlagsSet();
|
||||||
|
extern void A_AddFlags();
|
||||||
|
extern void A_RemoveFlags();
|
||||||
|
extern void A_WeaponProjectile();
|
||||||
|
extern void A_WeaponBulletAttack();
|
||||||
|
extern void A_WeaponMeleeAttack();
|
||||||
|
extern void A_WeaponSound();
|
||||||
|
extern void A_WeaponAlert();
|
||||||
|
extern void A_WeaponJump();
|
||||||
|
extern void A_ConsumeAmmo();
|
||||||
|
extern void A_CheckAmmo();
|
||||||
|
extern void A_RefireTo();
|
||||||
|
extern void A_GunFlashTo();
|
||||||
|
|
||||||
|
#endif
|
@ -43,6 +43,8 @@
|
|||||||
#include "p_tick.h"
|
#include "p_tick.h"
|
||||||
#include "m_bbox.h"
|
#include "m_bbox.h"
|
||||||
|
|
||||||
|
#include "p_action.h"
|
||||||
|
|
||||||
static mobj_t *current_actor;
|
static mobj_t *current_actor;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@ -58,8 +60,6 @@ typedef enum {
|
|||||||
NUMDIRS
|
NUMDIRS
|
||||||
} dirtype_t;
|
} dirtype_t;
|
||||||
|
|
||||||
void A_Fall(mobj_t *actor);
|
|
||||||
void A_FaceTarget(mobj_t *actor);
|
|
||||||
static void P_NewChaseDir(mobj_t *actor);
|
static void P_NewChaseDir(mobj_t *actor);
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -1762,8 +1762,6 @@ void A_VileStart(mobj_t *actor)
|
|||||||
// Keep fire in front of player unless out of sight
|
// Keep fire in front of player unless out of sight
|
||||||
//
|
//
|
||||||
|
|
||||||
void A_Fire(mobj_t *actor);
|
|
||||||
|
|
||||||
void A_StartFire(mobj_t *actor)
|
void A_StartFire(mobj_t *actor)
|
||||||
{
|
{
|
||||||
S_StartSound(actor,sfx_flamst);
|
S_StartSound(actor,sfx_flamst);
|
||||||
@ -2450,8 +2448,6 @@ void A_LoadShotgun2(player_t *player, pspdef_t *psp)
|
|||||||
S_StartSound(player->mo, sfx_dbload);
|
S_StartSound(player->mo, sfx_dbload);
|
||||||
}
|
}
|
||||||
|
|
||||||
void A_ReFire(player_t *player, pspdef_t *psp);
|
|
||||||
|
|
||||||
void A_CloseShotgun2(player_t *player, pspdef_t *psp)
|
void A_CloseShotgun2(player_t *player, pspdef_t *psp)
|
||||||
{
|
{
|
||||||
S_StartSound(player->mo, sfx_dbcls);
|
S_StartSound(player->mo, sfx_dbcls);
|
||||||
@ -2569,8 +2565,6 @@ void A_BrainSpit(mobj_t *mo)
|
|||||||
S_StartSound(NULL, sfx_bospit);
|
S_StartSound(NULL, sfx_bospit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void A_SpawnFly(mobj_t *mo);
|
|
||||||
|
|
||||||
// travelling cube sound
|
// travelling cube sound
|
||||||
void A_SpawnSound(mobj_t *mo)
|
void A_SpawnSound(mobj_t *mo)
|
||||||
{
|
{
|
||||||
|
@ -39,6 +39,8 @@
|
|||||||
#include "d_event.h"
|
#include "d_event.h"
|
||||||
#include "p_tick.h"
|
#include "p_tick.h"
|
||||||
|
|
||||||
|
#include "p_action.h"
|
||||||
|
|
||||||
#define LOWERSPEED (FRACUNIT*6)
|
#define LOWERSPEED (FRACUNIT*6)
|
||||||
#define RAISESPEED (FRACUNIT*6)
|
#define RAISESPEED (FRACUNIT*6)
|
||||||
#define WEAPONBOTTOM (FRACUNIT*128)
|
#define WEAPONBOTTOM (FRACUNIT*128)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user