turn players into DObjects and fix several bugs with bad memory access.

* DObjects may not be memset to 0.
* There was still code trying to retrieve the player index with pointer artithmetic. With an array of pointers this does not work.
This commit is contained in:
Christoph Oelckers 2023-10-02 21:03:59 +02:00
parent 1ce8ceac5d
commit 5448f6ec2c
126 changed files with 1709 additions and 1585 deletions

View file

@ -4,15 +4,30 @@
#include "packet.h"
#include "gameinput.h"
struct CorePlayer
class DCorePlayer : public DObject
{
DECLARE_CLASS(DCorePlayer, DObject)
HAS_OBJECT_POINTERS
protected:
DCorePlayer() = default;
void Clear()
{
memset(&lastcmd, 0, sizeof(lastcmd));
memset(&cmd, 0, sizeof(cmd));
memset(&Angles, 0, sizeof(Angles));
actor = nullptr;
pnum = 0;
}
public:
ticcmd_t lastcmd, cmd;
PlayerAngles Angles;
DCoreActor* actor;
uint8_t pnum;
virtual ~CorePlayer() { if (actor) actor->Destroy(); };
DCorePlayer(uint8_t p) : pnum(p) {}
void OnDestroy() override { if (actor) actor->Destroy(); actor = nullptr; }
virtual DCoreActor* GetActor() = 0;
};
extern CorePlayer* PlayerArray[MAXPLAYERS];
extern DCorePlayer* PlayerArray[MAXPLAYERS];

View file

@ -166,6 +166,7 @@ void HudScaleChanged();
bool M_SetSpecialMenu(FName& menu, int param);
void OnMenuOpen(bool makeSound);
void DestroyAltHUD();
void MarkPlayers();
DStatusBarCore* StatusBar;
@ -637,7 +638,7 @@ int GameMain()
gi->FreeLevelData();
for (int i = 0; i < MAXPLAYERS; i++)
{
delete PlayerArray[i];
PlayerArray[i]->Destroy();
PlayerArray[i] = nullptr;
}
}
@ -1154,6 +1155,7 @@ int RunGame()
StartWindow->Progress();
GC::AddMarkerFunc(MarkMap);
GC::AddMarkerFunc(MarkPlayers);
gi->app_init();
StartWindow->Progress();
G_ParseMapInfo();

View file

@ -101,7 +101,17 @@ static uint64_t stabilityticduration = 0;
static uint64_t stabilitystarttime = 0;
static double inputScale;
CorePlayer* PlayerArray[MAXPLAYERS];
DCorePlayer* PlayerArray[MAXPLAYERS];
IMPLEMENT_CLASS(DCorePlayer, true, true)
IMPLEMENT_POINTERS_START(DCorePlayer)
IMPLEMENT_POINTER(actor)
IMPLEMENT_POINTERS_END
void MarkPlayers()
{
GC::MarkArray(PlayerArray, MAXPLAYERS);
}
bool r_NoInterpolate;
int entertic;

View file

@ -39,6 +39,7 @@
#include "raze_sound.h"
#include "texturemanager.h"
#include "texinfo.h"
#include "coreplayer.h"
#include "buildtiles.h"
@ -816,6 +817,8 @@ DEFINE_ACTION_FUNCTION_NATIVE(_tspritetype, setSpritePic, tspritetype_setSpriteP
//=============================================================================
DEFINE_FIELD(DCorePlayer, pnum)
DEFINE_FIELD_NAMED(DCoreActor, spr.sectp, sector)
DEFINE_FIELD_NAMED(DCoreActor, spr.cstat, cstat)
DEFINE_FIELD_NAMED(DCoreActor, spr.cstat2, cstat2)

View file

@ -3053,7 +3053,7 @@ static void checkAddFrag(DBloodActor* killerActor, DBloodActor* actor)
{
if (killerActor->IsPlayerActor())
{
BloodPlayer* pPlayer = getPlayer(killerActor->spr.type - kDudePlayer1);
DBloodPlayer* pPlayer = getPlayer(killerActor->spr.type - kDudePlayer1);
if (gGameOptions.nGameType == 1)
pPlayer->fragCount++;
}
@ -3068,7 +3068,7 @@ static void checkAddFrag(DBloodActor* killerActor, DBloodActor* actor)
case kDudeBurningInnocent:
break;
default:
BloodPlayer* pKillerPlayer = getPlayer(killerActor->spr.type - kDudePlayer1);
DBloodPlayer* pKillerPlayer = getPlayer(killerActor->spr.type - kDudePlayer1);
pKillerPlayer->fragCount++;
break;
}
@ -3616,7 +3616,7 @@ static int actDamageDude(DBloodActor* source, DBloodActor* actor, int damage, DA
}
else
{
BloodPlayer* pPlayer = getPlayer(actor->spr.type - kDudePlayer1);
DBloodPlayer* pPlayer = getPlayer(actor->spr.type - kDudePlayer1);
if (actor->xspr.health > 0 || playerSeqPlaying(pPlayer, 16))
damage = playerDamageSprite(source, pPlayer, damageType, damage);
@ -3630,7 +3630,7 @@ static int actDamageDude(DBloodActor* source, DBloodActor* actor, int damage, DA
//
//---------------------------------------------------------------------------
static int actDamageThing(DBloodActor* source, DBloodActor* actor, int damage, DAMAGE_TYPE damageType, BloodPlayer* pSourcePlayer)
static int actDamageThing(DBloodActor* source, DBloodActor* actor, int damage, DAMAGE_TYPE damageType, DBloodPlayer* pSourcePlayer)
{
assert(actor->spr.type >= kThingBase && actor->spr.type < kThingMax);
int nType = actor->spr.type - kThingBase;
@ -3739,7 +3739,7 @@ int actDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE damageT
if (source == nullptr) source = actor;
BloodPlayer* pSourcePlayer = nullptr;
DBloodPlayer* pSourcePlayer = nullptr;
if (source->IsPlayerActor()) pSourcePlayer = getPlayer(source->spr.type - kDudePlayer1);
if (!gGameOptions.bFriendlyFire && IsTargetTeammate(pSourcePlayer, actor)) return 0;
@ -4334,7 +4334,7 @@ static void checkFloorHit(DBloodActor* actor)
}
#endif
BloodPlayer* pPlayer = nullptr;
DBloodPlayer* pPlayer = nullptr;
if (actor->IsPlayerActor()) pPlayer = getPlayer(actor->spr.type - kDudePlayer1);
switch (actor2->spr.type)
@ -4691,7 +4691,7 @@ static Collision MoveThing(DBloodActor* actor)
void MoveDude(DBloodActor* actor)
{
BloodPlayer* pPlayer = nullptr;
DBloodPlayer* pPlayer = nullptr;
if (actor->IsPlayerActor()) pPlayer = getPlayer(actor->spr.type - kDudePlayer1);
if (!(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax))
{
@ -5543,8 +5543,8 @@ static void actCheckProximity()
auto Owner = actor->GetOwner();
if (!Owner->IsPlayerActor()) continue;
BloodPlayer* pPlayer = getPlayer(Owner->spr.type - kDudePlayer1);
BloodPlayer* pPlayer2 = dudeactor->IsPlayerActor() ? getPlayer(dudeactor->spr.type - kDudePlayer1) : nullptr;
auto pPlayer = getPlayer(Owner);
DBloodPlayer* pPlayer2 = dudeactor->IsPlayerActor() ? getPlayer(dudeactor) : nullptr;
if (dudeactor == Owner || dudeactor->spr.type == kDudeZombieAxeBuried || dudeactor->spr.type == kDudeRat || dudeactor->spr.type == kDudeBat) continue;
if (gGameOptions.nGameType == 3 && pPlayer2 && pPlayer->teamId == pPlayer2->teamId) continue;
@ -5975,7 +5975,7 @@ static void actCheckDudes()
}
if (actor->IsPlayerActor())
{
BloodPlayer* pPlayer = getPlayer(actor->spr.type - kDudePlayer1);
DBloodPlayer* pPlayer = getPlayer(actor->spr.type - kDudePlayer1);
if (pPlayer->voodooTargets) voodooTarget(pPlayer);
if (pPlayer->hand && Chance(0x8000)) actDamageSprite(actor, actor, kDamageDrown, 12);
@ -6049,7 +6049,7 @@ static void actCheckDudes()
if (actor->IsPlayerActor())
{
BloodPlayer* pPlayer = getPlayer(actor->spr.type - kDudePlayer1);
DBloodPlayer* pPlayer = getPlayer(actor->spr.type - kDudePlayer1);
double nDrag = FixedToFloat(gDudeDrag);
if (actor->xspr.height > 0)
nDrag -= Scale(nDrag, (double)actor->xspr.height, 256.);
@ -6624,7 +6624,7 @@ void actFireVector(DBloodActor* shooter, double offset, double zoffset, DVector3
if (!gGameOptions.bFriendlyFire && IsTargetTeammate(shooter, hitactor)) return;
if (hitactor->IsPlayerActor())
{
BloodPlayer* pPlayer = getPlayer(hitactor->spr.type - kDudePlayer1);
DBloodPlayer* pPlayer = getPlayer(hitactor->spr.type - kDudePlayer1);
if (powerupCheck(pPlayer, kPwUpReflectShots))
{
gHitInfo.hitActor = shooter;

View file

@ -971,7 +971,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
{
aiPatrolStop(actor, source, actor->xspr.dudeAmbush);
BloodPlayer* pPlayer = getPlayerById(source->spr.type);
DBloodPlayer* pPlayer = getPlayerById(source->spr.type);
if (!pPlayer) return nDamage;
//if (powerupCheck(pPlayer, kPwUpShadowCloak)) pPlayer->pwUpTime[kPwUpShadowCloak] = 0;
if (readyForCrit(source, actor))
@ -1491,7 +1491,7 @@ void aiThinkTarget(DBloodActor* actor)
{
for (int p = connecthead; p >= 0; p = connectpoint2[p])
{
BloodPlayer* pPlayer = getPlayer(p);
DBloodPlayer* pPlayer = getPlayer(p);
if (actor->GetOwner() == pPlayer->GetActor() || pPlayer->GetActor()->xspr.health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0)
continue;
auto ppos = pPlayer->GetActor()->spr.pos;
@ -1536,7 +1536,7 @@ void aiLookForTarget(DBloodActor* actor)
{
for (int p = connecthead; p >= 0; p = connectpoint2[p])
{
BloodPlayer* pPlayer = getPlayer(p);
DBloodPlayer* pPlayer = getPlayer(p);
if (actor->GetOwner() == pPlayer->GetActor() || pPlayer->GetActor()->xspr.health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0)
continue;
auto ppos = pPlayer->GetActor()->spr.pos;

View file

@ -94,7 +94,7 @@ static void batThinkTarget(DBloodActor* actor)
{
for (int p = connecthead; p >= 0; p = connectpoint2[p])
{
BloodPlayer* pPlayer = getPlayer(p);
DBloodPlayer* pPlayer = getPlayer(p);
if (pPlayer->GetActor()->xspr.health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0)
continue;
auto ppos = pPlayer->GetActor()->spr.pos;

View file

@ -106,7 +106,7 @@ static void eelThinkTarget(DBloodActor* actor)
{
for (int p = connecthead; p >= 0; p = connectpoint2[p])
{
BloodPlayer* pPlayer = getPlayer(p);
DBloodPlayer* pPlayer = getPlayer(p);
if (pPlayer->GetActor()->xspr.health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0)
continue;
auto ppos = pPlayer->GetActor()->spr.pos;

View file

@ -237,7 +237,7 @@ static void cerberusThinkTarget(DBloodActor* actor)
{
for (int p = connecthead; p >= 0; p = connectpoint2[p])
{
BloodPlayer* pPlayer = getPlayer(p);
DBloodPlayer* pPlayer = getPlayer(p);
if (pPlayer->GetActor()->xspr.health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0)
continue;
auto ppos = pPlayer->GetActor()->spr.pos;

View file

@ -193,7 +193,7 @@ static void gargThinkTarget(DBloodActor* actor)
{
for (int p = connecthead; p >= 0; p = connectpoint2[p])
{
BloodPlayer* pPlayer = getPlayer(p);
DBloodPlayer* pPlayer = getPlayer(p);
if (pPlayer->GetActor()->xspr.health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0)
continue;
auto ppos = pPlayer->GetActor()->spr.pos;

View file

@ -174,7 +174,7 @@ static void ghostThinkTarget(DBloodActor* actor)
{
for (int p = connecthead; p >= 0; p = connectpoint2[p])
{
BloodPlayer* pPlayer = getPlayer(p);
DBloodPlayer* pPlayer = getPlayer(p);
if (pPlayer->GetActor()->xspr.health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0)
continue;
auto ppos = pPlayer->GetActor()->spr.pos;

View file

@ -47,7 +47,7 @@ void HandJumpSeqCallback(int, DBloodActor* actor)
auto target = actor->GetTarget();
if (target->IsPlayerActor())
{
BloodPlayer* pPlayer = getPlayer(target->spr.type - kDudePlayer1);
DBloodPlayer* pPlayer = getPlayer(target->spr.type - kDudePlayer1);
if (!pPlayer->hand)
{
pPlayer->hand = 1;

View file

@ -49,7 +49,7 @@ static void spidBlindEffect(DBloodActor* actor, int nBlind, int max)
{
nBlind <<= 4;
max <<= 4;
BloodPlayer* pPlayer = getPlayer(actor->spr.type - kDudePlayer1);
DBloodPlayer* pPlayer = getPlayer(actor->spr.type - kDudePlayer1);
if (pPlayer->blindEffect < max)
{
pPlayer->blindEffect = ClipHigh(pPlayer->blindEffect + nBlind, max);
@ -74,7 +74,7 @@ void SpidBiteSeqCallback(int, DBloodActor* actor)
if (hit == 3 && gHitInfo.actor()->IsPlayerActor())
{
vec.Z += target->spr.pos.Z - actor->spr.pos.Z;
BloodPlayer* pPlayer = getPlayer(target->spr.type - kDudePlayer1);
DBloodPlayer* pPlayer = getPlayer(target->spr.type - kDudePlayer1);
switch (actor->spr.type)
{
case kDudeSpiderBrown:

View file

@ -198,7 +198,7 @@ static void sub_725A4(DBloodActor* actor)
{
for (int p = connecthead; p >= 0; p = connectpoint2[p])
{
BloodPlayer* pPlayer = getPlayer(p);
DBloodPlayer* pPlayer = getPlayer(p);
if (pPlayer->GetActor()->xspr.health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0)
continue;
auto ppos = pPlayer->GetActor()->spr.pos;

View file

@ -461,7 +461,7 @@ static void unicultThinkChase(DBloodActor* actor)
if (target->xspr.health <= 0) // target is dead
{
BloodPlayer* pPlayer = NULL;
DBloodPlayer* pPlayer = NULL;
if ((!target->IsPlayerActor()) || ((pPlayer = getPlayerById(target->spr.type)) != NULL && pPlayer->fragger == actor))
{
playGenDudeSound(actor, kGenDudeSndTargetDead);
@ -498,7 +498,7 @@ static void unicultThinkChase(DBloodActor* actor)
}
else if (target->IsPlayerActor())
{
BloodPlayer* pPlayer = getPlayer(target->spr.type - kDudePlayer1);
DBloodPlayer* pPlayer = getPlayer(target->spr.type - kDudePlayer1);
if (powerupCheck(pPlayer, kPwUpShadowCloak) > 0)
{
if (spriteIsUnderwater(actor, false)) aiGenDudeNewState(actor, &genDudeSearchShortW);
@ -1758,7 +1758,7 @@ void dudeLeechOperate(DBloodActor* actor, const EVENT& event)
{
if (actTarget->IsPlayerActor())
{
BloodPlayer* pPlayer = getPlayer(actTarget->spr.type - kDudePlayer1);
DBloodPlayer* pPlayer = getPlayer(actTarget->spr.type - kDudePlayer1);
if (powerupCheck(pPlayer, kPwUpShadowCloak) > 0) return;
}
double top, bottom;

View file

@ -209,7 +209,7 @@ static void myThinkTarget(DBloodActor* actor)
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
for (int p = connecthead; p >= 0; p = connectpoint2[p])
{
BloodPlayer* pPlayer = getPlayer(p);
DBloodPlayer* pPlayer = getPlayer(p);
auto owneractor = actor->GetOwner();
if (owneractor == nullptr || owneractor == pPlayer->GetActor() || pPlayer->GetActor()->xspr.health == 0 || powerupCheck(pPlayer, kPwUpShadowCloak) > 0)
continue;

View file

@ -490,7 +490,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF
case kViewEffectShowWeapon:
{
assert(pTSprite->type >= kDudePlayer1 && pTSprite->type <= kDudePlayer8);
BloodPlayer* pPlayer = getPlayer(pTSprite->type - kDudePlayer1);
DBloodPlayer* pPlayer = getPlayer(pTSprite->type - kDudePlayer1);
WEAPONICON weaponIcon = gWeaponIcon[pPlayer->curWeapon];
auto nTex = weaponIcon.textureID();
if (!nTex.isValid()) break;
@ -555,7 +555,7 @@ static int GetOctant(const DVector2& dPos)
void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA, double interpfrac)
{
BloodPlayer* pPlayer = getPlayer(gViewIndex);
DBloodPlayer* pPlayer = getPlayer(gViewIndex);
int nViewSprites = tsprites.Size();
// shift before interpolating to increase precision.
DAngle myclock = DAngle::fromBuild((PlayClock << 3) + (4 << 3) * interpfrac);
@ -841,7 +841,7 @@ void viewProcessSprites(tspriteArray& tsprites, const DVector3& cPos, DAngle cA,
if (powerupCheck(pPlayer, kPwUpBeastVision) > 0) pTSprite->shade = -128;
if (IsPlayerSprite(pTSprite)) {
BloodPlayer* thisPlayer = getPlayer(pTSprite->type - kDudePlayer1);
DBloodPlayer* thisPlayer = getPlayer(pTSprite->type - kDudePlayer1);
if (powerupCheck(thisPlayer, kPwUpShadowCloak) && !powerupCheck(pPlayer, kPwUpBeastVision)) {
pTSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT;
pTSprite->pal = 5;

View file

@ -43,7 +43,7 @@ int nAmbChannels = 0;
//
//---------------------------------------------------------------------------
void ambProcess(BloodPlayer* pPlayer)
void ambProcess(DBloodPlayer* pPlayer)
{
if (!SoundEnabled())
return;

View file

@ -70,6 +70,31 @@ IMPLEMENT_POINTER(xspr.burnSource)
IMPLEMENT_POINTER(xspr.target)
IMPLEMENT_POINTERS_END
IMPLEMENT_CLASS(DBloodPlayer, false, true)
IMPLEMENT_POINTERS_START(DBloodPlayer)
IMPLEMENT_POINTER(ctfFlagState[0])
IMPLEMENT_POINTER(ctfFlagState[1])
IMPLEMENT_POINTER(aimTarget)
IMPLEMENT_POINTER(fragger)
IMPLEMENT_POINTER(voodooTarget)
IMPLEMENT_POINTER(aimTargets[0])
IMPLEMENT_POINTER(aimTargets[1])
IMPLEMENT_POINTER(aimTargets[2])
IMPLEMENT_POINTER(aimTargets[3])
IMPLEMENT_POINTER(aimTargets[4])
IMPLEMENT_POINTER(aimTargets[5])
IMPLEMENT_POINTER(aimTargets[6])
IMPLEMENT_POINTER(aimTargets[7])
IMPLEMENT_POINTER(aimTargets[8])
IMPLEMENT_POINTER(aimTargets[9])
IMPLEMENT_POINTER(aimTargets[10])
IMPLEMENT_POINTER(aimTargets[11])
IMPLEMENT_POINTER(aimTargets[12])
IMPLEMENT_POINTER(aimTargets[13])
IMPLEMENT_POINTER(aimTargets[14])
IMPLEMENT_POINTER(aimTargets[15])
IMPLEMENT_POINTERS_END
//---------------------------------------------------------------------------
//
//
@ -96,19 +121,6 @@ static void markgcroots()
GC::MarkArray(gPhysSpritesList, gPhysSpritesCount);
GC::MarkArray(gImpactSpritesList, gImpactSpritesCount);
MarkSprInSect();
for (int i = 0; i < MAXPLAYERS; i++)
{
auto plr = getPlayer(i);
if (plr)
{
GC::Mark(plr->actor);
GC::MarkArray(plr->ctfFlagState, 2);
GC::Mark(plr->aimTarget);
GC::MarkArray(plr->aimTargets, 16);
GC::Mark(plr->fragger);
GC::Mark(plr->voodooTarget);
}
}
for (auto& evobj : rxBucket)
{
evobj.Mark();
@ -127,7 +139,7 @@ bool bNoDemo = false;
int gNetPlayers;
int gChokeCounter = 0;
int blood_globalflags;
BloodPlayer gPlayerTemp[kMaxPlayers];
PlayerSave gPlayerTemp[kMaxPlayers];
int gHealthTemp[kMaxPlayers];
int16_t startang;
sectortype* startsector;
@ -343,19 +355,10 @@ void StartLevel(MapRecord* level, bool newgame)
{
for (int i = connecthead; i >= 0; i = connectpoint2[i])
{
BloodPlayer* pPlayer = getPlayer(i);
DBloodPlayer* pPlayer = getPlayer(i);
pPlayer->GetActor()->xspr.health &= 0xf000;
pPlayer->GetActor()->xspr.health |= gHealthTemp[i];
pPlayer->weaponQav = gPlayerTemp[i].weaponQav;
pPlayer->curWeapon = gPlayerTemp[i].curWeapon;
pPlayer->weaponState = gPlayerTemp[i].weaponState;
pPlayer->weaponAmmo = gPlayerTemp[i].weaponAmmo;
pPlayer->qavCallback = gPlayerTemp[i].qavCallback;
pPlayer->qavLoop = gPlayerTemp[i].qavLoop;
pPlayer->weaponTimer = gPlayerTemp[i].weaponTimer;
pPlayer->nextWeapon = gPlayerTemp[i].nextWeapon;
pPlayer->qavLastTick = gPlayerTemp[i].qavLastTick;
pPlayer->qavTimer = gPlayerTemp[i].qavTimer;
gPlayerTemp[i].CopyToPlayer(pPlayer);
}
}
PreloadCache();
@ -425,7 +428,7 @@ void GameInterface::Ticker()
thinktime.Reset();
thinktime.Clock();
BloodPlayer* pPlayer = getPlayer(myconnectindex);
DBloodPlayer* pPlayer = getPlayer(myconnectindex);
// disable synchronised input if set by game.
resetForcedSyncInput();
@ -592,8 +595,8 @@ void GameInterface::app_init()
// Initialise player array.
for (unsigned i = 0; i < MAXPLAYERS; i++)
{
PlayerArray[i] = new BloodPlayer;
*getPlayer(i) = {};
PlayerArray[i] = Create<DBloodPlayer>(i);
GC::WriteBarrier(PlayerArray[i]);
}
mirrortile = tileGetTextureID(504);
@ -772,13 +775,13 @@ DEFINE_ACTION_FUNCTION(_Blood, GetViewPlayer)
DEFINE_ACTION_FUNCTION(_BloodPlayer, GetHealth)
{
PARAM_SELF_STRUCT_PROLOGUE(BloodPlayer);
PARAM_SELF_STRUCT_PROLOGUE(DBloodPlayer);
ACTION_RETURN_INT(self->GetActor()->xspr.health);
}
DEFINE_ACTION_FUNCTION_NATIVE(_BloodPlayer, powerupCheck, powerupCheck)
{
PARAM_SELF_STRUCT_PROLOGUE(BloodPlayer);
PARAM_SELF_STRUCT_PROLOGUE(DBloodPlayer);
PARAM_INT(pwup);
ACTION_RETURN_INT(powerupCheck(self, pwup));
}

View file

@ -159,13 +159,27 @@ public:
};
struct BloodPlayer final : public CorePlayer
class DBloodPlayer final : public DCorePlayer
{
DUDEINFO* pDudeInfo;
DECLARE_CLASS(DBloodPlayer, DCorePlayer)
HAS_OBJECT_POINTERS
DBloodPlayer() = default;
public:
DBloodPlayer(uint8_t p) : DCorePlayer(p) {}
void Clear()
{
Super::Clear();
// Quick'n dirty clear
memset(&startOfMem, 0, sizeof(DBloodPlayer) - myoffsetof(DBloodPlayer, startOfMem));
}
uint8_t startOfMem; // only for Clear
uint8_t newWeapon;
bool isRunning;
DUDEINFO* pDudeInfo;
int weaponQav;
int qavCallback;
bool isRunning;
int posture; // stand, crouch, swim
int sceneQav; // by NoOne: used to keep qav id
double bobPhase;
@ -258,11 +272,59 @@ struct BloodPlayer final : public CorePlayer
}
};
inline BloodPlayer* getPlayer(int index)
inline DBloodPlayer* getPlayer(int index)
{
return static_cast<BloodPlayer*>(PlayerArray[index]);
return static_cast<DBloodPlayer*>(PlayerArray[index]);
}
inline DBloodPlayer* getPlayer(DBloodActor* ac)
{
return static_cast<DBloodPlayer*>(PlayerArray[ac->spr.type - kDudePlayer1]);
}
struct PlayerSave
{
int weaponQav;
int8_t curWeapon;
int weaponState;
int weaponAmmo;
int qavCallback;
bool qavLoop;
int weaponTimer;
int8_t nextWeapon;
int qavLastTick;
int qavTimer;
void CopyFromPlayer(DBloodPlayer* p)
{
weaponQav = p->weaponQav;
curWeapon = p->curWeapon;
weaponState = p->weaponState;
weaponAmmo = p->weaponAmmo;
qavCallback = p->qavCallback;
qavLoop = p->qavLoop;
weaponTimer = p->weaponTimer;
nextWeapon = p->nextWeapon;
qavLastTick = p->qavLastTick;
qavTimer = p->qavTimer;
}
void CopyToPlayer(DBloodPlayer* p)
{
p->weaponQav = weaponQav;
p->curWeapon = curWeapon;
p->weaponState = weaponState;
p->weaponAmmo = weaponAmmo;
p->qavCallback = qavCallback;
p->qavLoop = qavLoop;
p->weaponTimer = weaponTimer;
p->nextWeapon = nextWeapon;
p->qavLastTick = qavLastTick;
p->qavTimer = qavTimer;
}
};
// subclassed to add a game specific actor() method
extern HitInfo gHitInfo;
@ -288,7 +350,7 @@ inline bool IsTargetTeammate(DBloodActor* pSource, DBloodActor* pTarget)
{
if (!pSource->IsPlayerActor())
return false;
BloodPlayer* pSourcePlayer = getPlayer(pSource->spr.type - kDudePlayer1);
DBloodPlayer* pSourcePlayer = getPlayer(pSource->spr.type - kDudePlayer1);
return IsTargetTeammate(pSourcePlayer, pTarget);
}

View file

@ -337,7 +337,7 @@ void PlayerBubble(DBloodActor* actor, sectortype*) // 10
if (!actor) return;
if (actor->IsPlayerActor())
{
BloodPlayer* pPlayer = getPlayer(actor->spr.type - kDudePlayer1);
DBloodPlayer* pPlayer = getPlayer(actor->spr.type - kDudePlayer1);
if (!pPlayer->bubbleTime)
return;
double top, bottom;
@ -694,7 +694,7 @@ void LeechStateTimer(DBloodActor* actor, sectortype*) // 20
//
//---------------------------------------------------------------------------
void sub_76A08(DBloodActor* actor, DBloodActor* actor2, BloodPlayer* pPlayer) // ???
void sub_76A08(DBloodActor* actor, DBloodActor* actor2, DBloodPlayer* pPlayer) // ???
{
double top, bottom;
GetActorExtents(actor, &top, &bottom);
@ -726,7 +726,7 @@ void DropVoodooCb(DBloodActor* actor, sectortype*) // unused
evPostActor(actor, 0, kCallbackRemove);
return;
}
BloodPlayer* pPlayer;
DBloodPlayer* pPlayer;
if (Owner->IsPlayerActor())
pPlayer = getPlayer(Owner->spr.type - kDudePlayer1);
else
@ -753,7 +753,7 @@ void DropVoodooCb(DBloodActor* actor, sectortype*) // unused
continue;
if (actor2->hasX())
{
BloodPlayer* pPlayer2;
DBloodPlayer* pPlayer2;
if (actor2->IsPlayerActor())
pPlayer2 = getPlayer(actor2->spr.type - kDudePlayer1);
else

View file

@ -35,7 +35,7 @@ BEGIN_BLD_NS
//
//---------------------------------------------------------------------------
void CChoke::init(int a1, void(*a2)(BloodPlayer*))
void CChoke::init(int a1, void(*a2)(DBloodPlayer*))
{
callback = a2;
if (!qav && a1 != -1)
@ -82,7 +82,7 @@ void CChoke::animateChoke(int x, int y, double interpfrac)
//
//---------------------------------------------------------------------------
void chokeCallback(BloodPlayer* pPlayer)
void chokeCallback(DBloodPlayer* pPlayer)
{
int t = gGameOptions.nDifficulty + 2;
if (pPlayer->handTime < 64)

View file

@ -40,7 +40,7 @@ public:
x = 0;
y = 0;
};
void init(int a1, void(*a2)(BloodPlayer*));
void init(int a1, void(*a2)(DBloodPlayer*));
void animateChoke(int x, int y, double interpfrac);
void reset() { time = 0; }
QAV* qav;
@ -48,10 +48,10 @@ public:
int time;
int x;
int y;
void(*callback)(BloodPlayer*);
void(*callback)(DBloodPlayer*);
};
void chokeCallback(BloodPlayer*);
void chokeCallback(DBloodPlayer*);
extern CChoke gChoke;

View file

@ -37,7 +37,7 @@ void GameInterface::LevelCompleted(MapRecord* map, int skill)
{
if (getPlayer(i)->GetActor())
{
memcpy(&gPlayerTemp[i], getPlayer(i), sizeof(BloodPlayer));
gPlayerTemp[i].CopyFromPlayer(getPlayer(i));
gHealthTemp[i] = getPlayer(i)->GetActor()->xspr.health;
}
}

View file

@ -311,7 +311,7 @@ void evSend(EventObject& eob, int rxId, COMMAND_ID command, DBloodActor* initiat
if (gModernMap)
{
// allow to send commands on player sprites
BloodPlayer* pPlayer = NULL;
DBloodPlayer* pPlayer = NULL;
if (playerRXRngIsFine(rxId))
{
if ((pPlayer = getPlayerById((rxId - kChannelPlayer7) + kMaxPlayers)) != nullptr)

View file

@ -100,7 +100,7 @@ static void viewBurnTime(int gScale)
//
//---------------------------------------------------------------------------
void hudDraw(BloodPlayer* pPlayer, sectortype* pSector, double bobx, double boby, double zDelta, DAngle angle, int basepal, double interpfrac)
void hudDraw(DBloodPlayer* pPlayer, sectortype* pSector, double bobx, double boby, double zDelta, DAngle angle, int basepal, double interpfrac)
{
if (gViewPos == 0)
{
@ -169,7 +169,7 @@ void hudDraw(BloodPlayer* pPlayer, sectortype* pSector, double bobx, double boby
}
int zn = int(((pPlayer->zWeapon - pPlayer->zView - 12) * 2.) + 220);
BloodPlayer* pPSprite = getPlayer(pPlayer->GetActor()->spr.type - kDudePlayer1);
DBloodPlayer* pPSprite = getPlayer(pPlayer->GetActor()->spr.type - kDudePlayer1);
if (pPlayer->GetActor()->IsPlayerActor() && pPSprite->hand == 1)
{
gChoke.animateChoke(160, zn, interpfrac);

View file

@ -46,7 +46,7 @@ void sub_5A928(void)
buttonMap.ClearButton(i);
}
const char* SetGodMode(BloodPlayer* pPlayer, bool god)
const char* SetGodMode(DBloodPlayer* pPlayer, bool god)
{
playerSetGodMode(pPlayer, god);
bPlayerCheated = true;
@ -60,13 +60,13 @@ const char* SetClipMode(bool noclip)
return gNoClip ? GStrings("TXTB_NOCLIP") : GStrings("TXTB_NOCLIPOFF");
}
void packStuff(BloodPlayer* pPlayer)
void packStuff(DBloodPlayer* pPlayer)
{
for (int i = 0; i < 5; i++)
packAddItem(pPlayer, i);
}
void packClear(BloodPlayer* pPlayer)
void packClear(DBloodPlayer* pPlayer)
{
pPlayer->packItemId = 0;
for (int i = 0; i < 5; i++)
@ -76,7 +76,7 @@ void packClear(BloodPlayer* pPlayer)
}
}
void SetAmmo(BloodPlayer* pPlayer, bool stat)
void SetAmmo(DBloodPlayer* pPlayer, bool stat)
{
if (stat)
{
@ -92,7 +92,7 @@ void SetAmmo(BloodPlayer* pPlayer, bool stat)
}
}
void SetWeapons(BloodPlayer* pPlayer, bool stat)
void SetWeapons(DBloodPlayer* pPlayer, bool stat)
{
for (int i = 0; i < 14; i++)
{
@ -114,7 +114,7 @@ void SetWeapons(BloodPlayer* pPlayer, bool stat)
}
}
void SetToys(BloodPlayer* pPlayer, bool stat)
void SetToys(DBloodPlayer* pPlayer, bool stat)
{
if (stat)
{
@ -128,7 +128,7 @@ void SetToys(BloodPlayer* pPlayer, bool stat)
}
}
void SetArmor(BloodPlayer* pPlayer, bool stat)
void SetArmor(DBloodPlayer* pPlayer, bool stat)
{
int nAmount;
if (stat)
@ -145,7 +145,7 @@ void SetArmor(BloodPlayer* pPlayer, bool stat)
pPlayer->armor[i] = nAmount;
}
void SetKeys(BloodPlayer* pPlayer, bool stat)
void SetKeys(DBloodPlayer* pPlayer, bool stat)
{
for (int i = 1; i <= 7; i++)
pPlayer->hasKey[i] = stat;
@ -173,7 +173,7 @@ void SetMap(bool stat)
viewSetMessage(GStrings("TXTB_NOALLMAP"));
}
void SetWooMode(BloodPlayer* pPlayer, bool stat)
void SetWooMode(DBloodPlayer* pPlayer, bool stat)
{
if (stat)
{
@ -191,12 +191,12 @@ void SetWooMode(BloodPlayer* pPlayer, bool stat)
}
}
void ToggleWooMode(BloodPlayer* pPlayer)
void ToggleWooMode(DBloodPlayer* pPlayer)
{
SetWooMode(pPlayer, !(powerupCheck(pPlayer, kPwUpTwoGuns) != 0));
}
void ToggleBoots(BloodPlayer* pPlayer)
void ToggleBoots(DBloodPlayer* pPlayer)
{
if (powerupCheck(pPlayer, kPwUpJumpBoots))
{
@ -217,7 +217,7 @@ void ToggleBoots(BloodPlayer* pPlayer)
}
}
void ToggleInvisibility(BloodPlayer* pPlayer)
void ToggleInvisibility(DBloodPlayer* pPlayer)
{
if (powerupCheck(pPlayer, kPwUpShadowCloak))
{
@ -233,7 +233,7 @@ void ToggleInvisibility(BloodPlayer* pPlayer)
}
}
void ToggleInvulnerability(BloodPlayer* pPlayer)
void ToggleInvulnerability(DBloodPlayer* pPlayer)
{
if (powerupCheck(pPlayer, kPwUpDeathMask))
{
@ -249,7 +249,7 @@ void ToggleInvulnerability(BloodPlayer* pPlayer)
}
}
void ToggleDelirium(BloodPlayer* pPlayer)
void ToggleDelirium(DBloodPlayer* pPlayer)
{
if (powerupCheck(pPlayer, kPwUpDeliriumShroom))
{
@ -292,7 +292,7 @@ static int parseArgs(char* pzArgs, int* nArg1, int* nArg2)
const char* GameInterface::GenericCheat(int player, int cheat)
{
// message processing is not perfect because many cheats output multiple messages.
BloodPlayer* pPlayer = getPlayer(player);
DBloodPlayer* pPlayer = getPlayer(player);
if (gGameOptions.nGameType != 0 || numplayers > 1) // sp only for now.
return nullptr;
@ -512,7 +512,7 @@ static cheatseq_t s_CheatInfo[] = {
void cheatReset(void)
{
BloodPlayer* pPlayer = getPlayer(myconnectindex);
DBloodPlayer* pPlayer = getPlayer(myconnectindex);
bPlayerCheated = 0;
playerSetGodMode(pPlayer, 0);
gNoClip = 0;
@ -530,7 +530,7 @@ void cheatReset(void)
static void cmd_Give(int player, uint8_t** stream, bool skip)
{
BloodPlayer* pPlayer = getPlayer(player);
DBloodPlayer* pPlayer = getPlayer(player);
int type = ReadByte(stream);
if (skip) return;

View file

@ -48,16 +48,16 @@ void processSpritesOnOtherSideOfPortal(int x, int y, int interpolation);
void DrawMirrors(int x, int y, int z, fixed_t a, fixed_t horiz, int smooth, int viewPlayer);
int qanimateoffs(int a1, int a2);
struct BloodPlayer;
class DBloodPlayer;
bool checkLitSprayOrTNT(BloodPlayer* pPlayer);
bool checkLitSprayOrTNT(DBloodPlayer* pPlayer);
void WeaponInit(void);
void WeaponDraw(BloodPlayer* pPlayer, int shade, double xpos, double ypos, int palnum, DAngle angle);
void WeaponRaise(BloodPlayer* pPlayer);
void WeaponLower(BloodPlayer* pPlayer);
int WeaponUpgrade(BloodPlayer* pPlayer, int newWeapon);
void WeaponProcess(BloodPlayer* pPlayer);
void WeaponUpdateState(BloodPlayer* pPlayer);
void WeaponDraw(DBloodPlayer* pPlayer, int shade, double xpos, double ypos, int palnum, DAngle angle);
void WeaponRaise(DBloodPlayer* pPlayer);
void WeaponLower(DBloodPlayer* pPlayer);
int WeaponUpgrade(DBloodPlayer* pPlayer, int newWeapon);
void WeaponProcess(DBloodPlayer* pPlayer);
void WeaponUpdateState(DBloodPlayer* pPlayer);
void teslaHit(DBloodActor* pMissile, int a2);
void WeaponPrecache();

View file

@ -1175,7 +1175,7 @@ void nnExtProcessSuperSprites()
{
for (int a = connecthead; a >= 0; a = connectpoint2[a])
{
BloodPlayer* pPlayer = getPlayer(a);
DBloodPlayer* pPlayer = getPlayer(a);
if (!pPlayer || !xsprIsFine(pPlayer->GetActor()) || pPlayer->GetActor()->xspr.health <= 0)
continue;
@ -1213,7 +1213,7 @@ void nnExtProcessSuperSprites()
for (int a = connecthead; a >= 0; a = connectpoint2[a])
{
BloodPlayer* pPlayer = getPlayer(a);
DBloodPlayer* pPlayer = getPlayer(a);
if (!pPlayer || !xsprIsFine(pPlayer->GetActor()) || pPlayer->GetActor()->xspr.health <= 0)
continue;
@ -1300,7 +1300,7 @@ void nnExtProcessSuperSprites()
if (debrisactor->xspr.physAttr & kPhysDebrisTouch)
{
BloodPlayer* pPlayer = NULL;
DBloodPlayer* pPlayer = NULL;
for (int a = connecthead; a != -1; a = connectpoint2[a])
{
pPlayer = getPlayer(a);
@ -1940,7 +1940,7 @@ void windGenStopWindOnSectors(DBloodActor* sourceactor)
//
//---------------------------------------------------------------------------
void trPlayerCtrlStartScene(DBloodActor* sourceactor, BloodPlayer* pPlayer, bool force)
void trPlayerCtrlStartScene(DBloodActor* sourceactor, DBloodPlayer* pPlayer, bool force)
{
TRPLAYERCTRL* pCtrl = &gPlayerCtrl[pPlayer->pnum];
@ -1982,7 +1982,7 @@ void trPlayerCtrlStartScene(DBloodActor* sourceactor, BloodPlayer* pPlayer, bool
//
//---------------------------------------------------------------------------
void trPlayerCtrlStopScene(BloodPlayer* pPlayer)
void trPlayerCtrlStopScene(DBloodPlayer* pPlayer)
{
TRPLAYERCTRL* pCtrl = &gPlayerCtrl[pPlayer->pnum];
auto initiator = pCtrl->qavScene.initiator;
@ -2014,7 +2014,7 @@ void trPlayerCtrlStopScene(BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void trPlayerCtrlLink(DBloodActor* sourceactor, BloodPlayer* pPlayer, bool checkCondition)
void trPlayerCtrlLink(DBloodActor* sourceactor, DBloodPlayer* pPlayer, bool checkCondition)
{
// save player's sprite index to let the tracking condition know it after savegame loading...
auto actor = pPlayer->GetActor();
@ -2074,7 +2074,7 @@ void trPlayerCtrlLink(DBloodActor* sourceactor, BloodPlayer* pPlayer, bool check
//
//---------------------------------------------------------------------------
void trPlayerCtrlSetRace(int value, BloodPlayer* pPlayer)
void trPlayerCtrlSetRace(int value, DBloodPlayer* pPlayer)
{
playerSetRace(pPlayer, value);
switch (pPlayer->lifeMode)
@ -2098,7 +2098,7 @@ void trPlayerCtrlSetRace(int value, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void trPlayerCtrlSetMoveSpeed(int value, BloodPlayer* pPlayer)
void trPlayerCtrlSetMoveSpeed(int value, DBloodPlayer* pPlayer)
{
int speed = ClipRange(value, 0, 500);
for (int i = 0; i < kModeMax; i++)
@ -2119,7 +2119,7 @@ void trPlayerCtrlSetMoveSpeed(int value, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void trPlayerCtrlSetJumpHeight(int value, BloodPlayer* pPlayer)
void trPlayerCtrlSetJumpHeight(int value, DBloodPlayer* pPlayer)
{
int jump = ClipRange(value, 0, 500);
for (int i = 0; i < kModeMax; i++)
@ -2136,7 +2136,7 @@ void trPlayerCtrlSetJumpHeight(int value, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void trPlayerCtrlSetScreenEffect(int value, int timeval, BloodPlayer* pPlayer)
void trPlayerCtrlSetScreenEffect(int value, int timeval, DBloodPlayer* pPlayer)
{
int eff = ClipLow(value, 0);
int time = (eff > 0) ? timeval : 0;
@ -2179,7 +2179,7 @@ void trPlayerCtrlSetScreenEffect(int value, int timeval, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void trPlayerCtrlSetLookAngle(int value, BloodPlayer* pPlayer)
void trPlayerCtrlSetLookAngle(int value, DBloodPlayer* pPlayer)
{
static constexpr double upAngle = 289;
static constexpr double downAngle = -347;
@ -2199,7 +2199,7 @@ void trPlayerCtrlSetLookAngle(int value, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void trPlayerCtrlEraseStuff(int value, BloodPlayer* pPlayer)
void trPlayerCtrlEraseStuff(int value, DBloodPlayer* pPlayer)
{
switch (value)
@ -2251,7 +2251,7 @@ void trPlayerCtrlEraseStuff(int value, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void trPlayerCtrlGiveStuff(int data2, int weapon, int data4, BloodPlayer* pPlayer, TRPLAYERCTRL* pCtrl)
void trPlayerCtrlGiveStuff(int data2, int weapon, int data4, DBloodPlayer* pPlayer, TRPLAYERCTRL* pCtrl)
{
switch (data2)
{
@ -2321,7 +2321,7 @@ void trPlayerCtrlGiveStuff(int data2, int weapon, int data4, BloodPlayer* pPlaye
//
//---------------------------------------------------------------------------
void trPlayerCtrlUsePackItem(int data2, int data3, int data4, BloodPlayer* pPlayer, int evCmd)
void trPlayerCtrlUsePackItem(int data2, int data3, int data4, DBloodPlayer* pPlayer, int evCmd)
{
unsigned int invItem = data2 - 1;
switch (evCmd)
@ -2357,7 +2357,7 @@ void trPlayerCtrlUsePackItem(int data2, int data3, int data4, BloodPlayer* pPlay
//
//---------------------------------------------------------------------------
void trPlayerCtrlUsePowerup(DBloodActor* sourceactor, BloodPlayer* pPlayer, int evCmd)
void trPlayerCtrlUsePowerup(DBloodActor* sourceactor, DBloodPlayer* pPlayer, int evCmd)
{
bool relative = (sourceactor->spr.flags & kModernTypeFlag1);
@ -2891,7 +2891,7 @@ void usePropertiesChanger(DBloodActor* sourceactor, int objType, sectortype* pSe
if (iactor->spr.statnum != kStatDude || !iactor->IsDudeActor() || !iactor->hasX())
continue;
BloodPlayer* pPlayer = getPlayerById(iactor->spr.type);
DBloodPlayer* pPlayer = getPlayerById(iactor->spr.type);
if (pXSector->Underwater)
{
if (aLower)
@ -3138,7 +3138,7 @@ void useVelocityChanger(DBloodActor* actor, sectortype* sect, DBloodActor* initi
void useTeleportTarget(DBloodActor* sourceactor, DBloodActor* actor)
{
BloodPlayer* pPlayer = getPlayerById(actor->spr.type);
DBloodPlayer* pPlayer = getPlayerById(actor->spr.type);
XSECTOR* pXSector = (sourceactor->sector()->hasX()) ? &sourceactor->sector()->xs() : nullptr;
bool isDude = (!pPlayer && actor->IsDudeActor());
@ -3559,7 +3559,7 @@ void damageSprites(DBloodActor* sourceactor, DBloodActor* actor)
int health = 0;
BloodPlayer* pPlayer = getPlayerById(actor->spr.type);
DBloodPlayer* pPlayer = getPlayerById(actor->spr.type);
int dmgType = (sourceactor->xspr.data2 >= kDmgFall) ? ClipHigh(sourceactor->xspr.data2, kDmgElectric) : -1;
int dmg = actor->xspr.health << 4;
int armor[3];
@ -4304,7 +4304,7 @@ bool condCheckWall(DBloodActor* aCond, int cmpOp, bool PUSH)
bool condCheckPlayer(DBloodActor* aCond, int cmpOp, bool PUSH)
{
int var = -1;
BloodPlayer* pPlayer = NULL;
DBloodPlayer* pPlayer = NULL;
int cond = aCond->xspr.data1 - kCondPlayerBase;
int arg1 = aCond->xspr.data2;
int arg2 = aCond->xspr.data3;
@ -4550,7 +4550,7 @@ bool condCheckDude(DBloodActor* aCond, int cmpOp, bool PUSH)
bool condCheckSprite(DBloodActor* aCond, int cmpOp, bool PUSH)
{
int var = -1, var2 = -1, var3 = -1; BloodPlayer* pPlayer = NULL; bool retn = false;
int var = -1, var2 = -1, var3 = -1; DBloodPlayer* pPlayer = NULL; bool retn = false;
int cond = aCond->xspr.data1 - kCondSpriteBase; int arg1 = aCond->xspr.data2;
int arg2 = aCond->xspr.data3; int arg3 = aCond->xspr.data4;
@ -5727,7 +5727,7 @@ bool modernTypeOperateSprite(DBloodActor* actor, EVENT& event)
else if (actor->xspr.data1 >= 666 && actor->xspr.data1 < 669) useSpriteDamager(actor, -1, nullptr, nullptr);
else
{
BloodPlayer* pPlayer = getPlayerById(actor->xspr.data1);
DBloodPlayer* pPlayer = getPlayerById(actor->xspr.data1);
if (pPlayer != NULL)
useSpriteDamager(actor, OBJ_SPRITE, 0, pPlayer->GetActor());
}
@ -5746,7 +5746,7 @@ bool modernTypeOperateSprite(DBloodActor* actor, EVENT& event)
case kMarkerWarpDest:
if (actor->xspr.txID <= 0)
{
BloodPlayer* pPlayer = getPlayerById(actor->xspr.data1);
DBloodPlayer* pPlayer = getPlayerById(actor->xspr.data1);
if (pPlayer != NULL && SetSpriteState(actor, actor->xspr.state ^ 1, initiator) == 1)
useTeleportTarget(actor, pPlayer->GetActor());
return true;
@ -5981,7 +5981,7 @@ bool modernTypeOperateSprite(DBloodActor* actor, EVENT& event)
return true;
case kModernPlayerControl:
{ // WIP
BloodPlayer* pPlayer = NULL;
DBloodPlayer* pPlayer = NULL;
int cmd = (event.cmd >= kCmdNumberic) ? event.cmd : actor->xspr.command;
@ -7252,7 +7252,7 @@ QAV* playerQavSceneLoad(int qavId)
//
//---------------------------------------------------------------------------
void playerQavSceneProcess(BloodPlayer* pPlayer, QAVSCENE* pQavScene)
void playerQavSceneProcess(DBloodPlayer* pPlayer, QAVSCENE* pQavScene)
{
auto initiator = pQavScene->initiator;
if (initiator->hasX())
@ -7303,7 +7303,7 @@ void playerQavSceneProcess(BloodPlayer* pPlayer, QAVSCENE* pQavScene)
//
//---------------------------------------------------------------------------
void playerQavSceneDraw(BloodPlayer* pPlayer, int shade, double xpos, double ypos, int palnum, DAngle angle)
void playerQavSceneDraw(DBloodPlayer* pPlayer, int shade, double xpos, double ypos, int palnum, DAngle angle)
{
if (pPlayer == NULL || pPlayer->sceneQav == -1) return;
@ -7347,7 +7347,7 @@ void playerQavSceneDraw(BloodPlayer* pPlayer, int shade, double xpos, double ypo
//
//---------------------------------------------------------------------------
void playerQavScenePlay(BloodPlayer* pPlayer)
void playerQavScenePlay(DBloodPlayer* pPlayer)
{
if (pPlayer == NULL) return;
@ -7363,7 +7363,7 @@ void playerQavScenePlay(BloodPlayer* pPlayer)
}
}
void playerQavSceneReset(BloodPlayer* pPlayer)
void playerQavSceneReset(DBloodPlayer* pPlayer)
{
QAVSCENE* pQavScene = &gPlayerCtrl[pPlayer->pnum].qavScene;
pQavScene->initiator = nullptr;
@ -7371,28 +7371,28 @@ void playerQavSceneReset(BloodPlayer* pPlayer)
pQavScene->qavResrc = NULL;
}
bool playerSizeShrink(BloodPlayer* pPlayer, int divider)
bool playerSizeShrink(DBloodPlayer* pPlayer, int divider)
{
pPlayer->GetActor()->xspr.scale = 256 / divider;
playerSetRace(pPlayer, kModeHumanShrink);
return true;
}
bool playerSizeGrow(BloodPlayer* pPlayer, int multiplier)
bool playerSizeGrow(DBloodPlayer* pPlayer, int multiplier)
{
pPlayer->GetActor()->xspr.scale = 256 * multiplier;
playerSetRace(pPlayer, kModeHumanGrown);
return true;
}
bool playerSizeReset(BloodPlayer* pPlayer)
bool playerSizeReset(DBloodPlayer* pPlayer)
{
playerSetRace(pPlayer, kModeHuman);
pPlayer->GetActor()->xspr.scale = 0;
return true;
}
void playerDeactivateShrooms(BloodPlayer* pPlayer)
void playerDeactivateShrooms(DBloodPlayer* pPlayer)
{
powerupDeactivate(pPlayer, kPwUpGrowShroom);
pPlayer->pwUpTime[kPwUpGrowShroom] = 0;
@ -7407,7 +7407,7 @@ void playerDeactivateShrooms(BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
BloodPlayer* getPlayerById(int id)
DBloodPlayer* getPlayerById(int id)
{
// relative to connected players
if (id >= 1 && id <= kMaxPlayers)
@ -8380,8 +8380,8 @@ DBloodActor* aiPatrolSearchTargets(DBloodActor* actor)
enum { kMaxPatrolFoundSounds = 256 }; // should be the maximum amount of sound channels the engine can play at the same time.
PATROL_FOUND_SOUNDS patrolBonkles[kMaxPatrolFoundSounds];
assert(actor->spr.type >= kDudeBase && actor->spr.type < kDudeMax);
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); BloodPlayer* pPlayer = NULL;
assert(actor->IsDudeActor());
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type - kDudeBase); DBloodPlayer* pPlayer = NULL;
for (int i = 0; i < kMaxPatrolFoundSounds; i++)
{
@ -9286,7 +9286,7 @@ void changeSpriteAngle(DBloodActor* pSpr, DAngle nAng)
pSpr->spr.Angles.Yaw = nAng;
else
{
BloodPlayer* pPlayer = getPlayerById(pSpr->spr.type);
DBloodPlayer* pPlayer = getPlayerById(pSpr->spr.type);
if (pPlayer)
pPlayer->GetActor()->spr.Angles.Yaw = nAng;
else
@ -9349,7 +9349,7 @@ void killEffectGenCallbacks(DBloodActor* actor)
else if (actor->xspr.txID >= kChannelPlayer0 && actor->xspr.txID < kChannelPlayer0 + kMaxPlayers)
{
// player sprites
BloodPlayer* pPlayer = getPlayerById(actor->xspr.txID - kChannelPlayer0);
DBloodPlayer* pPlayer = getPlayerById(actor->xspr.txID - kChannelPlayer0);
if (pPlayer && pPlayer->GetActor() != nullptr)
dokillEffectGenCallbacks(pPlayer->GetActor());
}

View file

@ -331,8 +331,8 @@ void useCustomDudeSpawn(DBloodActor* pXSource, DBloodActor* pSprite);
void useVelocityChanger(DBloodActor* pXSource, sectortype* sect, DBloodActor* causerID, DBloodActor* pSprite);
void seqTxSendCmdAll(DBloodActor* pXSource, DBloodActor* nIndex, COMMAND_ID cmd, bool modernSend, DBloodActor* initiator);
// ------------------------------------------------------------------------- //
void trPlayerCtrlLink(DBloodActor* pXSource, BloodPlayer* pPlayer, bool checkCondition);
void trPlayerCtrlStopScene(BloodPlayer* pPlayer);
void trPlayerCtrlLink(DBloodActor* pXSource, DBloodPlayer* pPlayer, bool checkCondition);
void trPlayerCtrlStopScene(DBloodPlayer* pPlayer);
// ------------------------------------------------------------------------- //
void modernTypeTrigger(int type, sectortype* sect, walltype* wal, DBloodActor* actor, EVENT& event);
bool modernTypeOperateSector(sectortype* pSector, const EVENT& event);
@ -340,22 +340,22 @@ bool modernTypeOperateSprite(DBloodActor*, EVENT& event);
bool modernTypeOperateWall(walltype* pWall, const EVENT& event);
void modernTypeSendCommand(DBloodActor* nSprite, int channel, COMMAND_ID command, DBloodActor* initiator);
// ------------------------------------------------------------------------- //
bool playerSizeShrink(BloodPlayer* pPlayer, int divider);
bool playerSizeGrow(BloodPlayer* pPlayer, int multiplier);
bool playerSizeReset(BloodPlayer* pPlayer);
void playerDeactivateShrooms(BloodPlayer* pPlayer);
bool playerSizeShrink(DBloodPlayer* pPlayer, int divider);
bool playerSizeGrow(DBloodPlayer* pPlayer, int multiplier);
bool playerSizeReset(DBloodPlayer* pPlayer);
void playerDeactivateShrooms(DBloodPlayer* pPlayer);
// ------------------------------------------------------------------------- //
QAV* playerQavSceneLoad(int qavId);
void playerQavSceneProcess(BloodPlayer* pPlayer, QAVSCENE* pQavScene);
void playerQavScenePlay(BloodPlayer* pPlayer);
void playerQavSceneDraw(BloodPlayer* pPlayer, int shade, double xpos, double ypos, int palnum, DAngle angle);
void playerQavSceneReset(BloodPlayer* pPlayer);
void playerQavSceneProcess(DBloodPlayer* pPlayer, QAVSCENE* pQavScene);
void playerQavScenePlay(DBloodPlayer* pPlayer);
void playerQavSceneDraw(DBloodPlayer* pPlayer, int shade, double xpos, double ypos, int palnum, DAngle angle);
void playerQavSceneReset(DBloodPlayer* pPlayer);
// ------------------------------------------------------------------------- //
void callbackUniMissileBurst(DBloodActor* actor, sectortype* nSprite);
void callbackMakeMissileBlocking(DBloodActor* actor, sectortype* nSprite);
void callbackGenDudeUpdate(DBloodActor* actor, sectortype* nSprite);
// ------------------------------------------------------------------------- //
BloodPlayer* getPlayerById(int id);
DBloodPlayer* getPlayerById(int id);
bool isGrown(DBloodActor* pSprite);
bool isShrinked(DBloodActor* pSprite);
bool IsBurningDude(DBloodActor* pSprite);

View file

@ -228,7 +228,7 @@ DAMAGEINFO damageInfo[7] = {
//
//---------------------------------------------------------------------------
inline bool IsTargetTeammate(BloodPlayer* pSourcePlayer, DBloodActor* target)
inline bool IsTargetTeammate(DBloodPlayer* pSourcePlayer, DBloodActor* target)
{
if (pSourcePlayer == nullptr)
return false;
@ -236,7 +236,7 @@ inline bool IsTargetTeammate(BloodPlayer* pSourcePlayer, DBloodActor* target)
return false;
if (gGameOptions.nGameType == 1 || gGameOptions.nGameType == 3)
{
BloodPlayer* pTargetPlayer = getPlayer(target->spr.type - kDudePlayer1);
DBloodPlayer* pTargetPlayer = getPlayer(target->spr.type - kDudePlayer1);
if (pSourcePlayer != pTargetPlayer)
{
if (gGameOptions.nGameType == 1)
@ -256,7 +256,7 @@ inline bool IsTargetTeammate(BloodPlayer* pSourcePlayer, DBloodActor* target)
//
//---------------------------------------------------------------------------
int powerupCheck(BloodPlayer* pPlayer, int nPowerUp)
int powerupCheck(DBloodPlayer* pPlayer, int nPowerUp)
{
assert(pPlayer != NULL);
assert(nPowerUp >= 0 && nPowerUp < kMaxPowerUps);
@ -273,7 +273,7 @@ int powerupCheck(BloodPlayer* pPlayer, int nPowerUp)
//
//---------------------------------------------------------------------------
bool powerupActivate(BloodPlayer* pPlayer, int nPowerUp)
bool powerupActivate(DBloodPlayer* pPlayer, int nPowerUp)
{
if (powerupCheck(pPlayer, nPowerUp) > 0 && gPowerUpInfo[nPowerUp].pickupOnce)
return 0;
@ -346,7 +346,7 @@ bool powerupActivate(BloodPlayer* pPlayer, int nPowerUp)
//
//---------------------------------------------------------------------------
void powerupDeactivate(BloodPlayer* pPlayer, int nPowerUp)
void powerupDeactivate(DBloodPlayer* pPlayer, int nPowerUp)
{
int nPack = powerupToPackItem(nPowerUp);
if (nPack >= 0)
@ -401,7 +401,7 @@ void powerupDeactivate(BloodPlayer* pPlayer, int nPowerUp)
//
//---------------------------------------------------------------------------
void powerupSetState(BloodPlayer* pPlayer, int nPowerUp, bool bState)
void powerupSetState(DBloodPlayer* pPlayer, int nPowerUp, bool bState)
{
if (!bState)
powerupActivate(pPlayer, nPowerUp);
@ -415,7 +415,7 @@ void powerupSetState(BloodPlayer* pPlayer, int nPowerUp, bool bState)
//
//---------------------------------------------------------------------------
void powerupProcess(BloodPlayer* pPlayer)
void powerupProcess(DBloodPlayer* pPlayer)
{
pPlayer->packItemTime = ClipLow(pPlayer->packItemTime - 4, 0);
for (int i = kMaxPowerUps - 1; i >= 0; i--)
@ -451,7 +451,7 @@ void powerupProcess(BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void powerupClear(BloodPlayer* pPlayer)
void powerupClear(DBloodPlayer* pPlayer)
{
for (int i = kMaxPowerUps - 1; i >= 0; i--)
{
@ -517,7 +517,7 @@ int powerupToPackItem(int nPowerUp)
//
//---------------------------------------------------------------------------
bool packAddItem(BloodPlayer* pPlayer, unsigned int nPack)
bool packAddItem(DBloodPlayer* pPlayer, unsigned int nPack)
{
if (nPack <= 4)
{
@ -543,12 +543,12 @@ bool packAddItem(BloodPlayer* pPlayer, unsigned int nPack)
//
//---------------------------------------------------------------------------
int packCheckItem(BloodPlayer* pPlayer, int nPack)
int packCheckItem(DBloodPlayer* pPlayer, int nPack)
{
return pPlayer->packSlots[nPack].curAmount;
}
bool packItemActive(BloodPlayer* pPlayer, int nPack)
bool packItemActive(DBloodPlayer* pPlayer, int nPack)
{
return pPlayer->packSlots[nPack].isActive;
}
@ -559,7 +559,7 @@ bool packItemActive(BloodPlayer* pPlayer, int nPack)
//
//---------------------------------------------------------------------------
void packUseItem(BloodPlayer* pPlayer, int nPack)
void packUseItem(DBloodPlayer* pPlayer, int nPack)
{
bool v4 = 0;
int nPowerUp = -1;
@ -612,7 +612,7 @@ void packUseItem(BloodPlayer* pPlayer, int nPack)
//
//---------------------------------------------------------------------------
void packPrevItem(BloodPlayer* pPlayer)
void packPrevItem(DBloodPlayer* pPlayer)
{
if (pPlayer->packItemTime > 0)
{
@ -641,7 +641,7 @@ void packPrevItem(BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void packNextItem(BloodPlayer* pPlayer)
void packNextItem(DBloodPlayer* pPlayer)
{
if (pPlayer->packItemTime > 0)
{
@ -669,7 +669,7 @@ void packNextItem(BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
bool playerSeqPlaying(BloodPlayer* pPlayer, int nSeq)
bool playerSeqPlaying(DBloodPlayer* pPlayer, int nSeq)
{
int nCurSeq = seqGetID(pPlayer->GetActor());
if (pPlayer->pDudeInfo->seqStartID + nSeq == nCurSeq && seqGetStatus(pPlayer->GetActor()) >= 0)
@ -683,7 +683,7 @@ bool playerSeqPlaying(BloodPlayer* pPlayer, int nSeq)
//
//---------------------------------------------------------------------------
void playerSetRace(BloodPlayer* pPlayer, int nLifeMode)
void playerSetRace(DBloodPlayer* pPlayer, int nLifeMode)
{
assert(nLifeMode >= kModeHuman && nLifeMode <= kModeHumanGrown);
DUDEINFO* pDudeInfo = pPlayer->pDudeInfo;
@ -703,12 +703,12 @@ void playerSetRace(BloodPlayer* pPlayer, int nLifeMode)
//
//---------------------------------------------------------------------------
void playerSetGodMode(BloodPlayer* pPlayer, bool bGodMode)
void playerSetGodMode(DBloodPlayer* pPlayer, bool bGodMode)
{
pPlayer->godMode = bGodMode;
}
void playerResetInertia(BloodPlayer* pPlayer)
void playerResetInertia(DBloodPlayer* pPlayer)
{
POSTURE* pPosture = &pPlayer->pPosture[pPlayer->lifeMode][pPlayer->posture];
pPlayer->zView = pPlayer->GetActor()->spr.pos.Z - pPosture->eyeAboveZ;
@ -717,7 +717,7 @@ void playerResetInertia(BloodPlayer* pPlayer)
viewBackupView(pPlayer->pnum);
}
void playerCorrectInertia(BloodPlayer* pPlayer, const DVector3& oldpos)
void playerCorrectInertia(DBloodPlayer* pPlayer, const DVector3& oldpos)
{
auto zAdj = pPlayer->GetActor()->spr.pos.Z - oldpos.Z;
pPlayer->zView += zAdj;
@ -727,7 +727,7 @@ void playerCorrectInertia(BloodPlayer* pPlayer, const DVector3& oldpos)
pPlayer->GetActor()->opos.Z += zAdj;
}
void playerResetPowerUps(BloodPlayer* pPlayer)
void playerResetPowerUps(DBloodPlayer* pPlayer)
{
for (int i = 0; i < kMaxPowerUps; i++) {
if (!VanillaMode() && (i == kPwUpJumpBoots || i == kPwUpDivingSuit || i == kPwUpCrystalBall || i == kPwUpBeastVision))
@ -736,7 +736,7 @@ void playerResetPowerUps(BloodPlayer* pPlayer)
}
}
void playerResetPosture(BloodPlayer* pPlayer) {
void playerResetPosture(DBloodPlayer* pPlayer) {
memcpy(pPlayer->pPosture, gPostureDefaults, sizeof(gPostureDefaults));
if (!VanillaMode()) {
pPlayer->bobPhase = 0;
@ -757,7 +757,7 @@ void playerResetPosture(BloodPlayer* pPlayer) {
void playerStart(int nPlayer, int bNewLevel)
{
BloodPlayer* pPlayer = getPlayer(nPlayer);
DBloodPlayer* pPlayer = getPlayer(nPlayer);
InputPacket* pInput = &pPlayer->cmd.ucmd;
ZONE* pStartZone = NULL;
@ -916,7 +916,7 @@ void playerStart(int nPlayer, int bNewLevel)
//
//---------------------------------------------------------------------------
void playerReset(BloodPlayer* pPlayer)
void playerReset(DBloodPlayer* pPlayer)
{
static int dword_136400[] = {
3, 4, 2, 8, 9, 10, 7, 1, 1, 1, 1, 1, 1, 1
@ -980,9 +980,9 @@ int team_ticker[8];
void playerInit(int nPlayer, unsigned int a2)
{
if (!(a2 & 1))
*getPlayer(nPlayer) = {};
getPlayer(nPlayer)->Clear();
BloodPlayer* pPlayer = getPlayer(nPlayer);
DBloodPlayer* pPlayer = getPlayer(nPlayer);
pPlayer->pnum = nPlayer;
pPlayer->teamId = nPlayer;
if (gGameOptions.nGameType == 3)
@ -1002,7 +1002,7 @@ void playerInit(int nPlayer, unsigned int a2)
//
//---------------------------------------------------------------------------
bool findDroppedLeech(BloodPlayer* a1, DBloodActor* a2)
bool findDroppedLeech(DBloodPlayer* a1, DBloodActor* a2)
{
BloodStatIterator it(kStatThing);
while (auto actor = it.Next())
@ -1021,7 +1021,7 @@ bool findDroppedLeech(BloodPlayer* a1, DBloodActor* a2)
//
//---------------------------------------------------------------------------
bool PickupItem(BloodPlayer* pPlayer, DBloodActor* itemactor)
bool PickupItem(DBloodPlayer* pPlayer, DBloodActor* itemactor)
{
char buffer[80];
int pickupSnd = 775;
@ -1254,7 +1254,7 @@ bool PickupItem(BloodPlayer* pPlayer, DBloodActor* itemactor)
//
//---------------------------------------------------------------------------
bool PickupAmmo(BloodPlayer* pPlayer, DBloodActor* ammoactor)
bool PickupAmmo(DBloodPlayer* pPlayer, DBloodActor* ammoactor)
{
const AMMOITEMDATA* pAmmoItemData = &gAmmoItemData[ammoactor->spr.type - kItemAmmoBase];
int nAmmoType = pAmmoItemData->type;
@ -1278,7 +1278,7 @@ bool PickupAmmo(BloodPlayer* pPlayer, DBloodActor* ammoactor)
//
//---------------------------------------------------------------------------
bool PickupWeapon(BloodPlayer* pPlayer, DBloodActor* weaponactor)
bool PickupWeapon(DBloodPlayer* pPlayer, DBloodActor* weaponactor)
{
const WEAPONITEMDATA* pWeaponItemData = &gWeaponItemData[weaponactor->spr.type - kItemWeaponBase];
int nWeaponType = pWeaponItemData->type;
@ -1323,7 +1323,7 @@ bool PickupWeapon(BloodPlayer* pPlayer, DBloodActor* weaponactor)
//
//---------------------------------------------------------------------------
void PickUp(BloodPlayer* pPlayer, DBloodActor* actor)
void PickUp(DBloodPlayer* pPlayer, DBloodActor* actor)
{
const char* msg = nullptr;
int nType = actor->spr.type;
@ -1374,7 +1374,7 @@ void PickUp(BloodPlayer* pPlayer, DBloodActor* actor)
//
//---------------------------------------------------------------------------
void CheckPickUp(BloodPlayer* pPlayer)
void CheckPickUp(DBloodPlayer* pPlayer)
{
auto plActor = pPlayer->GetActor();
auto ppos = plActor->spr.pos;
@ -1415,7 +1415,7 @@ void CheckPickUp(BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
int ActionScan(BloodPlayer* pPlayer, HitInfo* out)
int ActionScan(DBloodPlayer* pPlayer, HitInfo* out)
{
auto plActor = pPlayer->GetActor();
*out = {};
@ -1507,7 +1507,7 @@ unsigned GameInterface::getCrouchState()
//
//---------------------------------------------------------------------------
void ProcessInput(BloodPlayer* pPlayer)
void ProcessInput(DBloodPlayer* pPlayer)
{
enum
{
@ -1762,7 +1762,7 @@ void ProcessInput(BloodPlayer* pPlayer)
CheckPickUp(pPlayer);
}
void playerProcess(BloodPlayer* pPlayer)
void playerProcess(DBloodPlayer* pPlayer)
{
DBloodActor* actor = pPlayer->GetActor();
POSTURE* pPosture = &pPlayer->pPosture[pPlayer->lifeMode][pPlayer->posture];
@ -1890,12 +1890,12 @@ void playerProcess(BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
DBloodActor* playerFireMissile(BloodPlayer* pPlayer, double xyoff, const DVector3& dv, int nType)
DBloodActor* playerFireMissile(DBloodPlayer* pPlayer, double xyoff, const DVector3& dv, int nType)
{
return actFireMissile(pPlayer->GetActor(), xyoff, pPlayer->zWeapon - pPlayer->GetActor()->spr.pos.Z, dv, nType);
}
DBloodActor* playerFireThing(BloodPlayer* pPlayer, double xyoff, double zvel, int thingType, double nSpeed)
DBloodActor* playerFireThing(DBloodPlayer* pPlayer, double xyoff, double zvel, int thingType, double nSpeed)
{
return actFireThing(pPlayer->GetActor(), xyoff, pPlayer->zWeapon - pPlayer->GetActor()->spr.pos.Z, pPlayer->slope * 0.25 + zvel, thingType, nSpeed);
}
@ -1906,7 +1906,7 @@ DBloodActor* playerFireThing(BloodPlayer* pPlayer, double xyoff, double zvel, in
//
//---------------------------------------------------------------------------
void playerFrag(BloodPlayer* pKiller, BloodPlayer* pVictim)
void playerFrag(DBloodPlayer* pKiller, DBloodPlayer* pVictim)
{
assert(pKiller != NULL);
assert(pVictim != NULL);
@ -1972,11 +1972,11 @@ void playerFrag(BloodPlayer* pKiller, BloodPlayer* pVictim)
//
//---------------------------------------------------------------------------
void FragPlayer(BloodPlayer* pPlayer, DBloodActor* killer)
void FragPlayer(DBloodPlayer* pPlayer, DBloodActor* killer)
{
if (killer && killer->IsPlayerActor())
{
BloodPlayer* pKiller = getPlayer(killer->spr.type - kDudePlayer1);
DBloodPlayer* pKiller = getPlayer(killer->spr.type - kDudePlayer1);
playerFrag(pKiller, pPlayer);
int nTeam1 = pKiller->teamId & 1;
int nTeam2 = pPlayer->teamId & 1;
@ -2003,7 +2003,7 @@ void FragPlayer(BloodPlayer* pPlayer, DBloodActor* killer)
//
//---------------------------------------------------------------------------
int playerDamageArmor(BloodPlayer* pPlayer, DAMAGE_TYPE nType, int nDamage)
int playerDamageArmor(DBloodPlayer* pPlayer, DAMAGE_TYPE nType, int nDamage)
{
DAMAGEINFO* pDamageInfo = &damageInfo[nType];
int nArmorType = pDamageInfo->armorType;
@ -2030,7 +2030,7 @@ int playerDamageArmor(BloodPlayer* pPlayer, DAMAGE_TYPE nType, int nDamage)
//
//---------------------------------------------------------------------------
void flagDropped(BloodPlayer* pPlayer, int a2)
void flagDropped(DBloodPlayer* pPlayer, int a2)
{
DBloodActor* playeractor = pPlayer->GetActor();
DBloodActor* actor;
@ -2064,7 +2064,7 @@ void flagDropped(BloodPlayer* pPlayer, int a2)
//
//---------------------------------------------------------------------------
int playerDamageSprite(DBloodActor* source, BloodPlayer* pPlayer, DAMAGE_TYPE nDamageType, int nDamage)
int playerDamageSprite(DBloodActor* source, DBloodPlayer* pPlayer, DAMAGE_TYPE nDamageType, int nDamage)
{
assert(pPlayer != NULL);
if (pPlayer->damageControl[nDamageType] || pPlayer->godMode)
@ -2232,7 +2232,7 @@ int playerDamageSprite(DBloodActor* source, BloodPlayer* pPlayer, DAMAGE_TYPE nD
//
//---------------------------------------------------------------------------
int UseAmmo(BloodPlayer* pPlayer, int nAmmoType, int nDec)
int UseAmmo(DBloodPlayer* pPlayer, int nAmmoType, int nDec)
{
if (gInfiniteAmmo)
return 9999;
@ -2248,7 +2248,7 @@ int UseAmmo(BloodPlayer* pPlayer, int nAmmoType, int nDec)
//
//---------------------------------------------------------------------------
void voodooTarget(BloodPlayer* pPlayer)
void voodooTarget(DBloodPlayer* pPlayer)
{
DBloodActor* actor = pPlayer->GetActor();
double aimz = pPlayer->aim.Z;
@ -2275,7 +2275,7 @@ void voodooTarget(BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void playerLandingSound(BloodPlayer* pPlayer)
void playerLandingSound(DBloodPlayer* pPlayer)
{
static int surfaceSound[] = {
-1,
@ -2320,7 +2320,7 @@ void PlayerSurvive(int, DBloodActor* actor)
sfxPlay3DSound(actor, 3009, 0, 6);
if (actor->IsPlayerActor())
{
BloodPlayer* pPlayer = getPlayer(actor->spr.type - kDudePlayer1);
DBloodPlayer* pPlayer = getPlayer(actor->spr.type - kDudePlayer1);
if (pPlayer->pnum == myconnectindex)
viewSetMessage(GStrings("TXT_LIVEAGAIM"));
else
@ -2345,7 +2345,7 @@ void PlayerKneelsOver(int, DBloodActor* actor)
{
if (getPlayer(p)->GetActor() == actor)
{
BloodPlayer* pPlayer = getPlayer(p);
DBloodPlayer* pPlayer = getPlayer(p);
playerDamageSprite(pPlayer->fragger, pPlayer, kDamageSpirit, 500 << 4);
return;
}
@ -2394,7 +2394,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, POSTURE& w, POSTUR
return arc;
}
FSerializer& Serialize(FSerializer& arc, const char* keyname, BloodPlayer& w, BloodPlayer* def)
FSerializer& Serialize(FSerializer& arc, const char* keyname, DBloodPlayer& w, DBloodPlayer* def)
{
if (arc.BeginObject(keyname))
{
@ -2562,76 +2562,77 @@ void SerializePlayers(FSerializer& arc)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, newWeapon)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, weaponQav)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, qavCallback)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, isRunning)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, posture) // stand, crouch, swim
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, sceneQav) // by NoOne: used to keep qav id
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, bobPhase)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, bobAmp)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, bobHeight)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, bobWidth)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, swayAmp)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, swayHeight)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, swayWidth)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, pnum) // Connect id
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, lifeMode)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, zView)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, zViewVel)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, zWeapon)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, zWeaponVel)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, slope)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, isUnderwater)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, hasKey)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, hasFlag)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, damageControl)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, curWeapon)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, nextWeapon)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, weaponTimer)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, weaponState)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, weaponAmmo) //rename
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, hasWeapon)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, weaponMode)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, weaponOrder)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, ammoCount)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, qavLoop)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, fuseTime)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, throwTime)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, throwPower)
//DEFINE_FIELD_X(BloodPlayer, PLAYER, aim) // world
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, aimTargetsCount)
//DEFINE_FIELD_X(BloodPlayer, PLAYER, aimTargets)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, deathTime)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, pwUpTime)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, teamId)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, fragCount)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, fragInfo)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, underwaterTime)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, bubbleTime)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, restTime)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, kickPower)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, laughCount)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, godMode)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, fallScream)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, cantJump)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, packItemTime) // pack timer
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, packItemId) // pack id 1: diving suit, 2: crystal ball, 3:
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, packSlots) // at325 1]: diving suit, [2]: crystal ball,
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, armor) // armor
//DEFINE_FIELD_X(BloodPlayer, PLAYER, voodooTarget)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, flickerEffect)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, tiltEffect)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, visibility)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, painEffect)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, blindEffect)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, chokeEffect)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, handTime)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, hand) // if true, there is hand start choking the player
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, pickupEffect)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, flashEffect) // if true, reduce pPlayer->visibility counter
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, quakeEffect)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, player_par)
DEFINE_FIELD_X(BloodPlayer, BloodPlayer, nWaterPal)
DEFINE_FIELD(DBloodPlayer, actor)
DEFINE_FIELD(DBloodPlayer, newWeapon)
DEFINE_FIELD(DBloodPlayer, weaponQav)
DEFINE_FIELD(DBloodPlayer, qavCallback)
DEFINE_FIELD(DBloodPlayer, isRunning)
DEFINE_FIELD(DBloodPlayer, posture) // stand, crouch, swim
DEFINE_FIELD(DBloodPlayer, sceneQav) // by NoOne: used to keep qav id
DEFINE_FIELD(DBloodPlayer, bobPhase)
DEFINE_FIELD(DBloodPlayer, bobAmp)
DEFINE_FIELD(DBloodPlayer, bobHeight)
DEFINE_FIELD(DBloodPlayer, bobWidth)
DEFINE_FIELD(DBloodPlayer, swayAmp)
DEFINE_FIELD(DBloodPlayer, swayHeight)
DEFINE_FIELD(DBloodPlayer, swayWidth)
DEFINE_FIELD(DBloodPlayer, pnum) // Connect id
DEFINE_FIELD(DBloodPlayer, lifeMode)
DEFINE_FIELD(DBloodPlayer, zView)
DEFINE_FIELD(DBloodPlayer, zViewVel)
DEFINE_FIELD(DBloodPlayer, zWeapon)
DEFINE_FIELD(DBloodPlayer, zWeaponVel)
DEFINE_FIELD(DBloodPlayer, slope)
DEFINE_FIELD(DBloodPlayer, isUnderwater)
DEFINE_FIELD(DBloodPlayer, hasKey)
DEFINE_FIELD(DBloodPlayer, hasFlag)
DEFINE_FIELD(DBloodPlayer, damageControl)
DEFINE_FIELD(DBloodPlayer, curWeapon)
DEFINE_FIELD(DBloodPlayer, nextWeapon)
DEFINE_FIELD(DBloodPlayer, weaponTimer)
DEFINE_FIELD(DBloodPlayer, weaponState)
DEFINE_FIELD(DBloodPlayer, weaponAmmo) //rename
DEFINE_FIELD(DBloodPlayer, hasWeapon)
DEFINE_FIELD(DBloodPlayer, weaponMode)
DEFINE_FIELD(DBloodPlayer, weaponOrder)
DEFINE_FIELD(DBloodPlayer, ammoCount)
DEFINE_FIELD(DBloodPlayer, qavLoop)
DEFINE_FIELD(DBloodPlayer, fuseTime)
DEFINE_FIELD(DBloodPlayer, throwTime)
DEFINE_FIELD(DBloodPlayer, throwPower)
//DEFINE_FIELD(DBloodPlayer, aim) // world
DEFINE_FIELD(DBloodPlayer, aimTargetsCount)
//DEFINE_FIELD(DBloodPlayer, aimTargets)
DEFINE_FIELD(DBloodPlayer, deathTime)
DEFINE_FIELD(DBloodPlayer, pwUpTime)
DEFINE_FIELD(DBloodPlayer, teamId)
DEFINE_FIELD(DBloodPlayer, fragCount)
DEFINE_FIELD(DBloodPlayer, fragInfo)
DEFINE_FIELD(DBloodPlayer, underwaterTime)
DEFINE_FIELD(DBloodPlayer, bubbleTime)
DEFINE_FIELD(DBloodPlayer, restTime)
DEFINE_FIELD(DBloodPlayer, kickPower)
DEFINE_FIELD(DBloodPlayer, laughCount)
DEFINE_FIELD(DBloodPlayer, godMode)
DEFINE_FIELD(DBloodPlayer, fallScream)
DEFINE_FIELD(DBloodPlayer, cantJump)
DEFINE_FIELD(DBloodPlayer, packItemTime) // pack timer
DEFINE_FIELD(DBloodPlayer, packItemId) // pack id 1: diving suit, 2: crystal ball, 3:
DEFINE_FIELD(DBloodPlayer, packSlots) // at325 1]: diving suit, [2]: crystal ball,
DEFINE_FIELD(DBloodPlayer, armor) // armor
//DEFINE_FIELD(DBloodPlayer, voodooTarget)
DEFINE_FIELD(DBloodPlayer, flickerEffect)
DEFINE_FIELD(DBloodPlayer, tiltEffect)
DEFINE_FIELD(DBloodPlayer, visibility)
DEFINE_FIELD(DBloodPlayer, painEffect)
DEFINE_FIELD(DBloodPlayer, blindEffect)
DEFINE_FIELD(DBloodPlayer, chokeEffect)
DEFINE_FIELD(DBloodPlayer, handTime)
DEFINE_FIELD(DBloodPlayer, hand) // if true, there is hand start choking the player
DEFINE_FIELD(DBloodPlayer, pickupEffect)
DEFINE_FIELD(DBloodPlayer, flashEffect) // if true, reduce pPlayer->visibility counter
DEFINE_FIELD(DBloodPlayer, quakeEffect)
DEFINE_FIELD(DBloodPlayer, player_par)
DEFINE_FIELD(DBloodPlayer, nWaterPal)
END_BLD_NS

View file

@ -78,7 +78,7 @@ struct POSTURE
extern POSTURE gPostureDefaults[kModeMax][kPostureMax];
struct BloodPlayer;
class DBloodPlayer;
struct AMMOINFO
{
@ -95,7 +95,7 @@ struct POWERUPINFO
FTextureID textureID() const { return tileGetTextureID(picno); }
};
void playerResetPosture(BloodPlayer* pPlayer);
void playerResetPosture(DBloodPlayer* pPlayer);
extern bool gBlueFlagDropped;
extern bool gRedFlagDropped;
@ -105,40 +105,40 @@ extern int team_ticker[kMaxPlayers];
extern AMMOINFO gAmmoInfo[];
extern POWERUPINFO gPowerUpInfo[kMaxPowerUps];
bool IsTargetTeammate(BloodPlayer* pSourcePlayer, DBloodActor* target);
int powerupCheck(BloodPlayer* pPlayer, int nPowerUp);
bool powerupActivate(BloodPlayer* pPlayer, int nPowerUp);
void powerupDeactivate(BloodPlayer* pPlayer, int nPowerUp);
void powerupSetState(BloodPlayer* pPlayer, int nPowerUp, bool bState);
void powerupProcess(BloodPlayer* pPlayer);
void powerupClear(BloodPlayer* pPlayer);
bool IsTargetTeammate(DBloodPlayer* pSourcePlayer, DBloodActor* target);
int powerupCheck(DBloodPlayer* pPlayer, int nPowerUp);
bool powerupActivate(DBloodPlayer* pPlayer, int nPowerUp);
void powerupDeactivate(DBloodPlayer* pPlayer, int nPowerUp);
void powerupSetState(DBloodPlayer* pPlayer, int nPowerUp, bool bState);
void powerupProcess(DBloodPlayer* pPlayer);
void powerupClear(DBloodPlayer* pPlayer);
int packItemToPowerup(int nPack);
int powerupToPackItem(int nPowerUp);
bool packAddItem(BloodPlayer* pPlayer, unsigned int nPack);
int packCheckItem(BloodPlayer* pPlayer, int nPack);
bool packItemActive(BloodPlayer* pPlayer, int nPack);
void packUseItem(BloodPlayer* pPlayer, int nPack);
void packPrevItem(BloodPlayer* pPlayer);
void packNextItem(BloodPlayer* pPlayer);
bool playerSeqPlaying(BloodPlayer* pPlayer, int nSeq);
void playerSetRace(BloodPlayer* pPlayer, int nLifeMode);
void playerSetGodMode(BloodPlayer* pPlayer, bool bGodMode);
void playerResetInertia(BloodPlayer* pPlayer);
void playerCorrectInertia(BloodPlayer* pPlayer, const DVector3& oldpos);
bool packAddItem(DBloodPlayer* pPlayer, unsigned int nPack);
int packCheckItem(DBloodPlayer* pPlayer, int nPack);
bool packItemActive(DBloodPlayer* pPlayer, int nPack);
void packUseItem(DBloodPlayer* pPlayer, int nPack);
void packPrevItem(DBloodPlayer* pPlayer);
void packNextItem(DBloodPlayer* pPlayer);
bool playerSeqPlaying(DBloodPlayer* pPlayer, int nSeq);
void playerSetRace(DBloodPlayer* pPlayer, int nLifeMode);
void playerSetGodMode(DBloodPlayer* pPlayer, bool bGodMode);
void playerResetInertia(DBloodPlayer* pPlayer);
void playerCorrectInertia(DBloodPlayer* pPlayer, const DVector3& oldpos);
void playerStart(int nPlayer, int bNewLevel = 0);
void playerReset(BloodPlayer* pPlayer);
void playerReset(DBloodPlayer* pPlayer);
void playerInit(int nPlayer, unsigned int a2);
void CheckPickUp(BloodPlayer* pPlayer);
void ProcessInput(BloodPlayer* pPlayer);
void playerProcess(BloodPlayer* pPlayer);
DBloodActor* playerFireMissile(BloodPlayer* pPlayer, double xyoff, const DVector3& vec, int nType);
DBloodActor* playerFireThing(BloodPlayer* pPlayer, double xyoff, double zvel, int thingType, double nSpeed);
void playerFrag(BloodPlayer* pKiller, BloodPlayer* pVictim);
int playerDamageArmor(BloodPlayer* pPlayer, DAMAGE_TYPE nType, int nDamage);
int playerDamageSprite(DBloodActor* nSource, BloodPlayer* pPlayer, DAMAGE_TYPE nDamageType, int nDamage);
int UseAmmo(BloodPlayer* pPlayer, int nAmmoType, int nDec);
void voodooTarget(BloodPlayer* pPlayer);
void playerLandingSound(BloodPlayer* pPlayer);
void CheckPickUp(DBloodPlayer* pPlayer);
void ProcessInput(DBloodPlayer* pPlayer);
void playerProcess(DBloodPlayer* pPlayer);
DBloodActor* playerFireMissile(DBloodPlayer* pPlayer, double xyoff, const DVector3& vec, int nType);
DBloodActor* playerFireThing(DBloodPlayer* pPlayer, double xyoff, double zvel, int thingType, double nSpeed);
void playerFrag(DBloodPlayer* pKiller, DBloodPlayer* pVictim);
int playerDamageArmor(DBloodPlayer* pPlayer, DAMAGE_TYPE nType, int nDamage);
int playerDamageSprite(DBloodActor* nSource, DBloodPlayer* pPlayer, DAMAGE_TYPE nDamageType, int nDamage);
int UseAmmo(DBloodPlayer* pPlayer, int nAmmoType, int nDec);
void voodooTarget(DBloodPlayer* pPlayer);
void playerLandingSound(DBloodPlayer* pPlayer);
void PlayerSurvive(int, DBloodActor*);
END_BLD_NS

View file

@ -39,7 +39,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_BLD_NS
void fakePlayerProcess(BloodPlayer* pPlayer, InputPacket* pInput);
void fakePlayerProcess(DBloodPlayer* pPlayer, InputPacket* pInput);
void fakeActProcessSprites(void);
bool gPrediction = true;
@ -98,7 +98,7 @@ void viewUpdatePrediction(InputPacket* pInput)
#endif
}
static void fakeProcessInput(BloodPlayer* pPlayer, InputPacket* pInput)
static void fakeProcessInput(DBloodPlayer* pPlayer, InputPacket* pInput)
{
#if 0
POSTURE* pPosture = &pPlayer->pPosture[pPlayer->lifeMode][predict.posture];
@ -253,7 +253,7 @@ static void fakeProcessInput(BloodPlayer* pPlayer, InputPacket* pInput)
#endif
}
void fakePlayerProcess(BloodPlayer* pPlayer, InputPacket* pInput)
void fakePlayerProcess(DBloodPlayer* pPlayer, InputPacket* pInput)
{
#if 0
auto pSprite = pPlayer->actor;

View file

@ -227,7 +227,7 @@ void QAV::Draw(int ticks, int stat, int shade, int palnum, bool to3dview, double
//
//---------------------------------------------------------------------------
void QAV::Play(int start, int end, int nCallback, BloodPlayer* pData)
void QAV::Play(int start, int end, int nCallback, DBloodPlayer* pData)
{
auto pActor = pData ? pData->GetActor() : nullptr;
assert(ticksPerFrame > 0);
@ -326,7 +326,7 @@ void qavProcessTicker(QAV* const pQAV, int* duration, int* lastTick)
//
//---------------------------------------------------------------------------
void qavProcessTimer(BloodPlayer* const pPlayer, QAV* const pQAV, int* duration, double* interpfrac, bool const fixedduration, bool const ignoreWeaponTimer)
void qavProcessTimer(DBloodPlayer* const pPlayer, QAV* const pQAV, int* duration, double* interpfrac, bool const fixedduration, bool const ignoreWeaponTimer)
{
// Process clock based on QAV's ticrate and last tick value.
if (!paused)

View file

@ -230,13 +230,13 @@ struct QAV
uint16_t res_id;
FRAMEINFO frames[1]; // 24
void Draw(int ticks, int stat, int shade, int palnum, bool to3dview, double const interpfrac, DAngle angle = nullAngle);
void Play(int, int, int, BloodPlayer*);
void Play(int, int, int, DBloodPlayer*);
void Precache(int palette = 0);
};
QAV* getQAV(int res_id);
void qavProcessTicker(QAV* const pQAV, int* duration, int* lastTick);
void qavProcessTimer(BloodPlayer* const pPlayer, QAV* const pQAV, int* duration, double* interpfrac, bool const fixedduration = false, bool const ignoreWeaponTimer = false);
void qavProcessTimer(DBloodPlayer* const pPlayer, QAV* const pQAV, int* duration, double* interpfrac, bool const fixedduration = false, bool const ignoreWeaponTimer = false);
inline bool qavIsOriginal(const int res_id)
{

View file

@ -73,7 +73,7 @@ static void UpdateFrame(void)
//
//---------------------------------------------------------------------------
void UpdateStatusBar(BloodPlayer* pPlayer)
void UpdateStatusBar(DBloodPlayer* pPlayer)
{
if (automapMode == am_off && hud_size <= Hud_Stbar)
{

View file

@ -63,7 +63,7 @@ void BloodSoundEngine::CalcPosVel(int type, const void* source, const float pt[3
{
if (pos != nullptr && type != SOURCE_None)
{
BloodPlayer* pPlayer = getPlayer(myconnectindex);
DBloodPlayer* pPlayer = getPlayer(myconnectindex);
FVector3 camera;
if (pPlayer && pPlayer->GetActor()) camera = GetSoundPos(pPlayer->GetActor()->spr.pos);
@ -105,7 +105,7 @@ void BloodSoundEngine::CalcPosVel(int type, const void* source, const float pt[3
void GameInterface::UpdateSounds()
{
BloodPlayer* pPlayer = getPlayer(myconnectindex);
DBloodPlayer* pPlayer = getPlayer(myconnectindex);
SoundListener listener;
if (pPlayer->GetActor())

View file

@ -36,7 +36,7 @@ void sfxKillAllSounds(void);
void sfxSetReverb(bool toggle);
void sfxSetReverb2(bool toggle);
void ambProcess(BloodPlayer* pPlayer);
void ambProcess(DBloodPlayer* pPlayer);
void ambKillAll(void);
void ambInit(void);

View file

@ -237,7 +237,7 @@ void LifeLeechOperate(DBloodActor* actor, EVENT event)
int nPlayer = actor->xspr.data4;
if (nPlayer >= 0 && nPlayer < kMaxPlayers && playeringame[nPlayer])
{
BloodPlayer* pPlayer = getPlayer(nPlayer);
DBloodPlayer* pPlayer = getPlayer(nPlayer);
if (pPlayer->GetActor()->xspr.health > 0)
{
evKillActor(actor);
@ -598,7 +598,7 @@ void OperateSprite(DBloodActor* actor, EVENT event)
case kSoundPlayer:
if (gGameOptions.nGameType == 0)
{
BloodPlayer* pPlayer = getPlayer(myconnectindex);
DBloodPlayer* pPlayer = getPlayer(myconnectindex);
if (pPlayer->GetActor()->xspr.health <= 0)
break;
@ -1596,7 +1596,7 @@ void OperateTeleport(sectortype* pSector)
{
if (actor->spr.statnum == kStatDude)
{
BloodPlayer* pPlayer;
DBloodPlayer* pPlayer;
bool bPlayer = actor->IsPlayerActor();
if (bPlayer)
pPlayer = getPlayer(actor->spr.type - kDudePlayer1);

View file

@ -58,7 +58,7 @@ int gViewIndex;
void viewBackupView(int nPlayer)
{
BloodPlayer* pPlayer = getPlayer(nPlayer);
DBloodPlayer* pPlayer = getPlayer(nPlayer);
pPlayer->ozView = pPlayer->zView;
pPlayer->ozWeapon = pPlayer->zWeapon - pPlayer->zView - 12;
pPlayer->obobHeight = pPlayer->bobHeight;
@ -100,7 +100,7 @@ void viewDrawText(FFont* pFont, const char* pString, int x, int y, int nShade, i
//
//---------------------------------------------------------------------------
void viewDrawAimedPlayerName(BloodPlayer* pPlayer)
void viewDrawAimedPlayerName(DBloodPlayer* pPlayer)
{
if (!cl_idplayers || (pPlayer->aim.XY().isZero()))
return;
@ -280,7 +280,7 @@ void UpdateDacs(int nPalette, bool bNoTint)
//
//---------------------------------------------------------------------------
void UpdateBlend(BloodPlayer* pPlayer)
void UpdateBlend(DBloodPlayer* pPlayer)
{
int nRed = 0;
int nGreen = 0;
@ -324,7 +324,7 @@ int gShowFrameRate = 1;
//
//---------------------------------------------------------------------------
void viewUpdateDelirium(BloodPlayer* pPlayer)
void viewUpdateDelirium(DBloodPlayer* pPlayer)
{
gScreenTiltO = gScreenTilt;
deliriumTurnO = deliriumTurn;
@ -371,7 +371,7 @@ void viewUpdateDelirium(BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void viewUpdateShake(BloodPlayer* pPlayer, DVector3& cPos, DRotator& cAngles, double& pshakeX, double& pshakeY)
void viewUpdateShake(DBloodPlayer* pPlayer, DVector3& cPos, DRotator& cAngles, double& pshakeX, double& pshakeY)
{
auto doEffect = [&](const int& effectType)
{
@ -404,7 +404,7 @@ int32_t g_frameRate;
//
//---------------------------------------------------------------------------
static void DrawMap(BloodPlayer* pPlayer, const double interpfrac)
static void DrawMap(DBloodPlayer* pPlayer, const double interpfrac)
{
int tm = 0;
if (viewport3d.Left() > 0)
@ -423,7 +423,7 @@ static void DrawMap(BloodPlayer* pPlayer, const double interpfrac)
//
//---------------------------------------------------------------------------
static void SetupView(BloodPlayer* pPlayer, DVector3& cPos, DRotator& cAngles, sectortype*& pSector, double& zDelta, double& shakeX, double& shakeY, const double interpfrac)
static void SetupView(DBloodPlayer* pPlayer, DVector3& cPos, DRotator& cAngles, sectortype*& pSector, double& zDelta, double& shakeX, double& shakeY, const double interpfrac)
{
double bobWidth, bobHeight;
@ -558,7 +558,7 @@ void renderCrystalBall()
void viewDrawScreen(bool sceneonly)
{
BloodPlayer* pPlayer = getPlayer(gViewIndex);
DBloodPlayer* pPlayer = getPlayer(gViewIndex);
FireProcess();

View file

@ -73,13 +73,13 @@ extern DAngle gScreenTiltO, gScreenTilt;
extern int gShowFrameRate;
extern int gLastPal;
void hudDraw(BloodPlayer* pPlayer, sectortype* pSector, double bobx, double boby, double zDelta, DAngle angle, int basepal, double interpfrac);
void hudDraw(DBloodPlayer* pPlayer, sectortype* pSector, double bobx, double boby, double zDelta, DAngle angle, int basepal, double interpfrac);
void viewInitializePrediction(void);
void viewUpdatePrediction(InputPacket* pInput);
void viewCorrectPrediction(void);
void viewBackupView(int nPlayer);
void InitStatusBar(void);
void UpdateStatusBar(BloodPlayer* pPlayer);
void UpdateStatusBar(DBloodPlayer* pPlayer);
void viewInit(void);
void viewprocessSprites(tspriteArray& tsprites, int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t smooth);
void viewSetMessage(const char* pMessage, const char* color = nullptr, const MESSAGE_PRIORITY priority = MESSAGE_PRIORITY_NORMAL);
@ -89,7 +89,7 @@ void viewSetErrorMessage(const char* pMessage);
void DoLensEffect(void);
void UpdateDacs(int nPalette, bool bNoTint = false);
void viewDrawScreen(bool sceneonly = false);
void viewUpdateDelirium(BloodPlayer* pPlayer);
void viewUpdateDelirium(DBloodPlayer* pPlayer);
void viewSetSystemMessage(const char* pMessage, ...);
inline void viewInterpolateSector(sectortype* pSector)

View file

@ -32,38 +32,38 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_BLD_NS
void FirePitchfork(int, BloodPlayer* pPlayer);
void FireSpray(int, BloodPlayer* pPlayer);
void ThrowCan(int, BloodPlayer* pPlayer);
void DropCan(int, BloodPlayer* pPlayer);
void ExplodeCan(int, BloodPlayer* pPlayer);
void ThrowBundle(int, BloodPlayer* pPlayer);
void DropBundle(int, BloodPlayer* pPlayer);
void ExplodeBundle(int, BloodPlayer* pPlayer);
void ThrowProx(int, BloodPlayer* pPlayer);
void DropProx(int, BloodPlayer* pPlayer);
void ThrowRemote(int, BloodPlayer* pPlayer);
void DropRemote(int, BloodPlayer* pPlayer);
void FireRemote(int, BloodPlayer* pPlayer);
void FireShotgun(int nTrigger, BloodPlayer* pPlayer);
void EjectShell(int, BloodPlayer* pPlayer);
void FireTommy(int nTrigger, BloodPlayer* pPlayer);
void FireSpread(int nTrigger, BloodPlayer* pPlayer);
void AltFireSpread(int nTrigger, BloodPlayer* pPlayer);
void AltFireSpread2(int nTrigger, BloodPlayer* pPlayer);
void FireFlare(int nTrigger, BloodPlayer* pPlayer);
void AltFireFlare(int nTrigger, BloodPlayer* pPlayer);
void FireVoodoo(int nTrigger, BloodPlayer* pPlayer);
void AltFireVoodoo(int nTrigger, BloodPlayer* pPlayer);
void DropVoodoo(int nTrigger, BloodPlayer* pPlayer);
void FireTesla(int nTrigger, BloodPlayer* pPlayer);
void AltFireTesla(int nTrigger, BloodPlayer* pPlayer);
void FireNapalm(int nTrigger, BloodPlayer* pPlayer);
void FireNapalm2(int nTrigger, BloodPlayer* pPlayer);
void AltFireNapalm(int nTrigger, BloodPlayer* pPlayer);
void FireLifeLeech(int nTrigger, BloodPlayer* pPlayer);
void AltFireLifeLeech(int nTrigger, BloodPlayer* pPlayer);
void FireBeast(int nTrigger, BloodPlayer* pPlayer);
void FirePitchfork(int, DBloodPlayer* pPlayer);
void FireSpray(int, DBloodPlayer* pPlayer);
void ThrowCan(int, DBloodPlayer* pPlayer);
void DropCan(int, DBloodPlayer* pPlayer);
void ExplodeCan(int, DBloodPlayer* pPlayer);
void ThrowBundle(int, DBloodPlayer* pPlayer);
void DropBundle(int, DBloodPlayer* pPlayer);
void ExplodeBundle(int, DBloodPlayer* pPlayer);
void ThrowProx(int, DBloodPlayer* pPlayer);
void DropProx(int, DBloodPlayer* pPlayer);
void ThrowRemote(int, DBloodPlayer* pPlayer);
void DropRemote(int, DBloodPlayer* pPlayer);
void FireRemote(int, DBloodPlayer* pPlayer);
void FireShotgun(int nTrigger, DBloodPlayer* pPlayer);
void EjectShell(int, DBloodPlayer* pPlayer);
void FireTommy(int nTrigger, DBloodPlayer* pPlayer);
void FireSpread(int nTrigger, DBloodPlayer* pPlayer);
void AltFireSpread(int nTrigger, DBloodPlayer* pPlayer);
void AltFireSpread2(int nTrigger, DBloodPlayer* pPlayer);
void FireFlare(int nTrigger, DBloodPlayer* pPlayer);
void AltFireFlare(int nTrigger, DBloodPlayer* pPlayer);
void FireVoodoo(int nTrigger, DBloodPlayer* pPlayer);
void AltFireVoodoo(int nTrigger, DBloodPlayer* pPlayer);
void DropVoodoo(int nTrigger, DBloodPlayer* pPlayer);
void FireTesla(int nTrigger, DBloodPlayer* pPlayer);
void AltFireTesla(int nTrigger, DBloodPlayer* pPlayer);
void FireNapalm(int nTrigger, DBloodPlayer* pPlayer);
void FireNapalm2(int nTrigger, DBloodPlayer* pPlayer);
void AltFireNapalm(int nTrigger, DBloodPlayer* pPlayer);
void FireLifeLeech(int nTrigger, DBloodPlayer* pPlayer);
void AltFireLifeLeech(int nTrigger, DBloodPlayer* pPlayer);
void FireBeast(int nTrigger, DBloodPlayer* pPlayer);
typedef void(*QAVTypeCast)(int, void*);
@ -146,12 +146,12 @@ enum
//
//---------------------------------------------------------------------------
double getThrowPower(BloodPlayer* pPlayer)
double getThrowPower(DBloodPlayer* pPlayer)
{
return pPlayer->throwPower * 23.46666 + 6.4;
}
void setThrowPower(BloodPlayer* pPlayer)
void setThrowPower(DBloodPlayer* pPlayer)
{
pPlayer->throwPower = min((PlayClock - pPlayer->throwTime) / 240., 1.);
}
@ -162,7 +162,7 @@ void setThrowPower(BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
bool checkLitSprayOrTNT(BloodPlayer* pPlayer)
bool checkLitSprayOrTNT(DBloodPlayer* pPlayer)
{
switch (pPlayer->curWeapon)
{
@ -208,7 +208,7 @@ static bool BannedUnderwater(int nWeapon)
//
//---------------------------------------------------------------------------
static bool CheckWeaponAmmo(BloodPlayer* pPlayer, int weapon, int ammotype, int count)
static bool CheckWeaponAmmo(DBloodPlayer* pPlayer, int weapon, int ammotype, int count)
{
if (gInfiniteAmmo)
return 1;
@ -227,7 +227,7 @@ static bool CheckWeaponAmmo(BloodPlayer* pPlayer, int weapon, int ammotype, int
//
//---------------------------------------------------------------------------
static bool CheckAmmo(BloodPlayer* pPlayer, int ammotype, int count)
static bool CheckAmmo(DBloodPlayer* pPlayer, int ammotype, int count)
{
if (gInfiniteAmmo)
return 1;
@ -246,7 +246,7 @@ static bool CheckAmmo(BloodPlayer* pPlayer, int ammotype, int count)
//
//---------------------------------------------------------------------------
static bool checkAmmo2(const BloodPlayer* pPlayer, int ammotype, int amount)
static bool checkAmmo2(const DBloodPlayer* pPlayer, int ammotype, int amount)
{
if (gInfiniteAmmo)
return 1;
@ -261,7 +261,7 @@ static bool checkAmmo2(const BloodPlayer* pPlayer, int ammotype, int amount)
//
//---------------------------------------------------------------------------
void SpawnBulletEject(BloodPlayer* pPlayer, double dist, int rdist)
void SpawnBulletEject(DBloodPlayer* pPlayer, double dist, int rdist)
{
POSTURE* pPosture = &pPlayer->pPosture[pPlayer->lifeMode][pPlayer->posture];
pPlayer->zView = pPlayer->GetActor()->spr.pos.Z - pPosture->eyeAboveZ;
@ -269,7 +269,7 @@ void SpawnBulletEject(BloodPlayer* pPlayer, double dist, int rdist)
fxSpawnEjectingBrass(pPlayer->GetActor(), dz, dist, rdist);
}
void SpawnShellEject(BloodPlayer* pPlayer, double dist, int rdist)
void SpawnShellEject(DBloodPlayer* pPlayer, double dist, int rdist)
{
POSTURE* pPosture = &pPlayer->pPosture[pPlayer->lifeMode][pPlayer->posture];
pPlayer->zView = pPlayer->GetActor()->spr.pos.Z - pPosture->eyeAboveZ;
@ -328,7 +328,7 @@ void WeaponPrecache()
//
//---------------------------------------------------------------------------
void WeaponDraw(BloodPlayer* pPlayer, int shade, double xpos, double ypos, int palnum, DAngle angle)
void WeaponDraw(DBloodPlayer* pPlayer, int shade, double xpos, double ypos, int palnum, DAngle angle)
{
assert(pPlayer != NULL);
if (pPlayer->weaponQav == kQAVNone)
@ -357,7 +357,7 @@ void WeaponDraw(BloodPlayer* pPlayer, int shade, double xpos, double ypos, int p
//
//---------------------------------------------------------------------------
void WeaponPlay(BloodPlayer* pPlayer)
void WeaponPlay(DBloodPlayer* pPlayer)
{
assert(pPlayer != NULL);
if (pPlayer->weaponQav == kQAVNone)
@ -373,7 +373,7 @@ void WeaponPlay(BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
static void StartQAV(BloodPlayer* pPlayer, int nWeaponQAV, int callback = -1, bool looped = false)
static void StartQAV(DBloodPlayer* pPlayer, int nWeaponQAV, int callback = -1, bool looped = false)
{
assert(nWeaponQAV < kQAVEnd);
auto res_id = qavGetCorrectID(nWeaponQAV);
@ -389,7 +389,7 @@ static void StartQAV(BloodPlayer* pPlayer, int nWeaponQAV, int callback = -1, bo
pPlayer->weaponTimer -= 4;
}
static void SetQAV(BloodPlayer* pPlayer, int nWeaponQAV)
static void SetQAV(DBloodPlayer* pPlayer, int nWeaponQAV)
{
assert(nWeaponQAV < kQAVEnd);
pPlayer->weaponQav = qavGetCorrectID(nWeaponQAV);
@ -436,7 +436,7 @@ WEAPONTRACK gWeaponTrack[] = {
//
//---------------------------------------------------------------------------
void UpdateAimVector(BloodPlayer* pPlayer)
void UpdateAimVector(DBloodPlayer* pPlayer)
{
assert(pPlayer != NULL);
auto plActor = pPlayer->GetActor();
@ -590,7 +590,7 @@ t_WeaponModes weaponModes[] = {
{ 0, -1 },
};
void WeaponRaise(BloodPlayer* pPlayer)
void WeaponRaise(DBloodPlayer* pPlayer)
{
assert(pPlayer != NULL);
int prevWeapon = pPlayer->curWeapon;
@ -746,7 +746,7 @@ void WeaponRaise(BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void WeaponLower(BloodPlayer* pPlayer)
void WeaponLower(DBloodPlayer* pPlayer)
{
assert(pPlayer != NULL);
if (checkLitSprayOrTNT(pPlayer))
@ -939,7 +939,7 @@ void WeaponLower(BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void WeaponUpdateState(BloodPlayer* pPlayer)
void WeaponUpdateState(DBloodPlayer* pPlayer)
{
static int lastWeapon = 0;
static int lastState = 0;
@ -1162,7 +1162,7 @@ void WeaponUpdateState(BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void FirePitchfork(int, BloodPlayer* pPlayer)
void FirePitchfork(int, DBloodPlayer* pPlayer)
{
DBloodActor* actor = pPlayer->GetActor();
double r1 = Random2F(2000, 14);
@ -1178,7 +1178,7 @@ void FirePitchfork(int, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void FireSpray(int, BloodPlayer* pPlayer)
void FireSpray(int, DBloodPlayer* pPlayer)
{
playerFireMissile(pPlayer, 0, pPlayer->aim, kMissileFlameSpray);
UseAmmo(pPlayer, 6, 4);
@ -1194,7 +1194,7 @@ void FireSpray(int, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void ThrowCan(int, BloodPlayer* pPlayer)
void ThrowCan(int, DBloodPlayer* pPlayer)
{
sfxKill3DSound(pPlayer->GetActor(), -1, 441);
double nSpeed = getThrowPower(pPlayer);
@ -1217,7 +1217,7 @@ void ThrowCan(int, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void DropCan(int, BloodPlayer* pPlayer)
void DropCan(int, DBloodPlayer* pPlayer)
{
sfxKill3DSound(pPlayer->GetActor(), -1, 441);
auto spawned = playerFireThing(pPlayer, 0, 0, kThingArmedSpray, 0);
@ -1234,7 +1234,7 @@ void DropCan(int, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void ExplodeCan(int, BloodPlayer* pPlayer)
void ExplodeCan(int, DBloodPlayer* pPlayer)
{
sfxKill3DSound(pPlayer->GetActor(), -1, 441);
auto spawned = playerFireThing(pPlayer, 0, 0, kThingArmedSpray, 0);
@ -1254,7 +1254,7 @@ void ExplodeCan(int, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void ThrowBundle(int, BloodPlayer* pPlayer)
void ThrowBundle(int, DBloodPlayer* pPlayer)
{
sfxKill3DSound(pPlayer->GetActor(), 16, -1);
double nSpeed = getThrowPower(pPlayer);
@ -1277,7 +1277,7 @@ void ThrowBundle(int, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void DropBundle(int, BloodPlayer* pPlayer)
void DropBundle(int, DBloodPlayer* pPlayer)
{
sfxKill3DSound(pPlayer->GetActor(), 16, -1);
auto spawned = playerFireThing(pPlayer, 0, 0, kThingArmedTNTBundle, 0);
@ -1294,7 +1294,7 @@ void DropBundle(int, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void ExplodeBundle(int, BloodPlayer* pPlayer)
void ExplodeBundle(int, DBloodPlayer* pPlayer)
{
sfxKill3DSound(pPlayer->GetActor(), 16, -1);
auto spawned = playerFireThing(pPlayer, 0, 0, kThingArmedTNTBundle, 0);
@ -1314,7 +1314,7 @@ void ExplodeBundle(int, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void ThrowProx(int, BloodPlayer* pPlayer)
void ThrowProx(int, DBloodPlayer* pPlayer)
{
double nSpeed = getThrowPower(pPlayer);
sfxPlay3DSound(pPlayer->GetActor(), 455, 1, 0);
@ -1333,7 +1333,7 @@ void ThrowProx(int, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void DropProx(int, BloodPlayer* pPlayer)
void DropProx(int, DBloodPlayer* pPlayer)
{
auto spawned = playerFireThing(pPlayer, 0, 0, kThingArmedProxBomb, 0);
if (spawned)
@ -1349,7 +1349,7 @@ void DropProx(int, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void ThrowRemote(int, BloodPlayer* pPlayer)
void ThrowRemote(int, DBloodPlayer* pPlayer)
{
double nSpeed = getThrowPower(pPlayer);
sfxPlay3DSound(pPlayer->GetActor(), 455, 1, 0);
@ -1368,7 +1368,7 @@ void ThrowRemote(int, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void DropRemote(int, BloodPlayer* pPlayer)
void DropRemote(int, DBloodPlayer* pPlayer)
{
auto spawned = playerFireThing(pPlayer, 0, 0, kThingArmedRemoteBomb, 0);
if (spawned)
@ -1378,7 +1378,7 @@ void DropRemote(int, BloodPlayer* pPlayer)
}
}
void FireRemote(int, BloodPlayer* pPlayer)
void FireRemote(int, DBloodPlayer* pPlayer)
{
evSendGame(90 + (pPlayer->GetActor()->spr.type - kDudePlayer1), kCmdOn);
}
@ -1391,7 +1391,7 @@ void FireRemote(int, BloodPlayer* pPlayer)
enum { kMaxShotgunBarrels = 4 };
void FireShotgun(int nTrigger, BloodPlayer* pPlayer)
void FireShotgun(int nTrigger, DBloodPlayer* pPlayer)
{
DBloodActor* actor = pPlayer->GetActor();
assert(nTrigger > 0 && nTrigger <= kMaxShotgunBarrels);
@ -1438,13 +1438,13 @@ void FireShotgun(int nTrigger, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void EjectShell(int, BloodPlayer* pPlayer)
void EjectShell(int, DBloodPlayer* pPlayer)
{
SpawnShellEject(pPlayer, 25 / 16., 35);
SpawnShellEject(pPlayer, 3, 35);
}
void FireTommy(int nTrigger, BloodPlayer* pPlayer)
void FireTommy(int nTrigger, DBloodPlayer* pPlayer)
{
DBloodActor* actor = pPlayer->GetActor();
sfxPlay3DSound(pPlayer->GetActor(), 431, -1, 0);
@ -1490,7 +1490,7 @@ enum { kMaxSpread = 14 };
static constexpr DAngle DAngle10 = DAngle::fromDeg(10);
static constexpr DAngle DAngle20 = DAngle::fromDeg(20);
void FireSpread(int nTrigger, BloodPlayer* pPlayer)
void FireSpread(int nTrigger, DBloodPlayer* pPlayer)
{
DBloodActor* actor = pPlayer->GetActor();
assert(nTrigger > 0 && nTrigger <= kMaxSpread);
@ -1518,7 +1518,7 @@ void FireSpread(int nTrigger, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void AltFireSpread(int nTrigger, BloodPlayer* pPlayer)
void AltFireSpread(int nTrigger, DBloodPlayer* pPlayer)
{
DBloodActor* actor = pPlayer->GetActor();
assert(nTrigger > 0 && nTrigger <= kMaxSpread);
@ -1554,7 +1554,7 @@ void AltFireSpread(int nTrigger, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void AltFireSpread2(int nTrigger, BloodPlayer* pPlayer)
void AltFireSpread2(int nTrigger, DBloodPlayer* pPlayer)
{
DBloodActor* actor = pPlayer->GetActor();
assert(nTrigger > 0 && nTrigger <= kMaxSpread);
@ -1612,7 +1612,7 @@ void AltFireSpread2(int nTrigger, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void FireFlare(int nTrigger, BloodPlayer* pPlayer)
void FireFlare(int nTrigger, DBloodPlayer* pPlayer)
{
auto plActor = pPlayer->GetActor();
double offset = 0;
@ -1638,7 +1638,7 @@ void FireFlare(int nTrigger, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void AltFireFlare(int nTrigger, BloodPlayer* pPlayer)
void AltFireFlare(int nTrigger, DBloodPlayer* pPlayer)
{
auto plActor = pPlayer->GetActor();
double offset = 0;
@ -1664,7 +1664,7 @@ void AltFireFlare(int nTrigger, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void FireVoodoo(int nTrigger, BloodPlayer* pPlayer)
void FireVoodoo(int nTrigger, DBloodPlayer* pPlayer)
{
nTrigger--;
DBloodActor* actor = pPlayer->GetActor();
@ -1713,7 +1713,7 @@ void FireVoodoo(int nTrigger, BloodPlayer* pPlayer)
int nDamage = actDamageSprite(actor, targetactor, kDamageSpirit, 11 << 4);
if (targetactor->IsPlayerActor())
{
BloodPlayer* pOtherPlayer = getPlayer(targetactor->spr.type - kDudePlayer1);
DBloodPlayer* pOtherPlayer = getPlayer(targetactor->spr.type - kDudePlayer1);
pOtherPlayer->blindEffect = 128;
}
UseAmmo(pPlayer, 9, nDamage / 4);
@ -1728,7 +1728,7 @@ void FireVoodoo(int nTrigger, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void AltFireVoodoo(int nTrigger, BloodPlayer* pPlayer)
void AltFireVoodoo(int nTrigger, DBloodPlayer* pPlayer)
{
DBloodActor* actor = pPlayer->GetActor();
if (nTrigger == 2) {
@ -1756,7 +1756,7 @@ void AltFireVoodoo(int nTrigger, BloodPlayer* pPlayer)
if (targetactor->IsPlayerActor())
{
BloodPlayer* pOtherPlayer = getPlayer(targetactor->spr.type - kDudePlayer1);
DBloodPlayer* pOtherPlayer = getPlayer(targetactor->spr.type - kDudePlayer1);
if (!pOtherPlayer->godMode || !powerupCheck(pOtherPlayer, kPwUpDeathMask))
powerupActivate(pOtherPlayer, kPwUpDeliriumShroom);
}
@ -1794,7 +1794,7 @@ void AltFireVoodoo(int nTrigger, BloodPlayer* pPlayer)
UseAmmo(pPlayer, 9, nDamage);
if (targetactor->IsPlayerActor())
{
BloodPlayer* pOtherPlayer = getPlayer(targetactor->spr.type - kDudePlayer1);
DBloodPlayer* pOtherPlayer = getPlayer(targetactor->spr.type - kDudePlayer1);
if (!pOtherPlayer->godMode || !powerupCheck(pOtherPlayer, kPwUpDeathMask))
powerupActivate(pOtherPlayer, kPwUpDeliriumShroom);
}
@ -1814,7 +1814,7 @@ void AltFireVoodoo(int nTrigger, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void DropVoodoo(int, BloodPlayer* pPlayer)
void DropVoodoo(int, DBloodPlayer* pPlayer)
{
sfxPlay3DSound(pPlayer->GetActor(), 455, 2, 0);
auto spawned = playerFireThing(pPlayer, 0, -4730 / 65536., kThingVoodooHead, 12.8);
@ -1850,7 +1850,7 @@ struct TeslaMissile
//
//---------------------------------------------------------------------------
void FireTesla(int nTrigger, BloodPlayer* pPlayer)
void FireTesla(int nTrigger, DBloodPlayer* pPlayer)
{
TeslaMissile teslaMissile[6] =
{
@ -1891,7 +1891,7 @@ void FireTesla(int nTrigger, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void AltFireTesla(int, BloodPlayer* pPlayer)
void AltFireTesla(int, DBloodPlayer* pPlayer)
{
auto plActor = pPlayer->GetActor();
playerFireMissile(pPlayer, 0., pPlayer->aim, kMissileTeslaAlt);
@ -1907,7 +1907,7 @@ void AltFireTesla(int, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void FireNapalm(int nTrigger, BloodPlayer* pPlayer)
void FireNapalm(int nTrigger, DBloodPlayer* pPlayer)
{
auto plActor = pPlayer->GetActor();
double offset = 0;
@ -1926,7 +1926,7 @@ void FireNapalm(int nTrigger, BloodPlayer* pPlayer)
pPlayer->flashEffect = 1;
}
void FireNapalm2(int, BloodPlayer* pPlayer)
void FireNapalm2(int, DBloodPlayer* pPlayer)
{
auto plActor = pPlayer->GetActor();
playerFireMissile(pPlayer, -7.5, pPlayer->aim, kMissileFireballNapalm);
@ -1942,7 +1942,7 @@ void FireNapalm2(int, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void AltFireNapalm(int, BloodPlayer* pPlayer)
void AltFireNapalm(int, DBloodPlayer* pPlayer)
{
auto missile = playerFireThing(pPlayer, 0, -4730 / 65536., kThingNapalmBall, 18.13333);
if (missile)
@ -1964,7 +1964,7 @@ void AltFireNapalm(int, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void FireLifeLeech(int nTrigger, BloodPlayer* pPlayer)
void FireLifeLeech(int nTrigger, DBloodPlayer* pPlayer)
{
if (!CheckAmmo(pPlayer, 8, 1))
return;
@ -1991,7 +1991,7 @@ void FireLifeLeech(int nTrigger, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void AltFireLifeLeech(int, BloodPlayer* pPlayer)
void AltFireLifeLeech(int, DBloodPlayer* pPlayer)
{
DBloodActor* actor = pPlayer->GetActor();
sfxPlay3DSound(pPlayer->GetActor(), 455, 2, 0);
@ -2030,7 +2030,7 @@ void AltFireLifeLeech(int, BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void FireBeast(int, BloodPlayer* pPlayer)
void FireBeast(int, DBloodPlayer* pPlayer)
{
DBloodActor* actor = pPlayer->GetActor();
double r1 = Random2F(2000, 14);
@ -2061,9 +2061,9 @@ static const uint8_t gWeaponUpgrade[][13] = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 },
};
int WeaponUpgrade(BloodPlayer* pPlayer, int newWeapon)
int WeaponUpgrade(DBloodPlayer* pPlayer, int newWeapon)
{
int weaponswitch = WeaponSwitch(pPlayer - (BloodPlayer*)PlayerArray);
int weaponswitch = WeaponSwitch(pPlayer->pnum);
int weapon = pPlayer->curWeapon;
if (!checkLitSprayOrTNT(pPlayer) && (weaponswitch & 1) && (gWeaponUpgrade[pPlayer->curWeapon][newWeapon] || (weaponswitch & 2)))
weapon = newWeapon;
@ -2079,7 +2079,7 @@ int WeaponUpgrade(BloodPlayer* pPlayer, int newWeapon)
static const int OrderNext[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 1 };
static const int OrderPrev[] = { 12, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1 };
static int WeaponFindNext(BloodPlayer* pPlayer, int* a2, int bDir)
static int WeaponFindNext(DBloodPlayer* pPlayer, int* a2, int bDir)
{
int weapon = pPlayer->curWeapon;
do
@ -2118,7 +2118,7 @@ static int WeaponFindNext(BloodPlayer* pPlayer, int* a2, int bDir)
//
//---------------------------------------------------------------------------
static int WeaponFindLoaded(BloodPlayer* pPlayer, int* a2)
static int WeaponFindLoaded(DBloodPlayer* pPlayer, int* a2)
{
int v4 = 1;
int v14 = 0;
@ -2165,7 +2165,7 @@ static int WeaponFindLoaded(BloodPlayer* pPlayer, int* a2)
//
//---------------------------------------------------------------------------
int processSprayCan(BloodPlayer* pPlayer)
int processSprayCan(DBloodPlayer* pPlayer)
{
const char bUseShootAsThrow = !VanillaMode() && (pPlayer->cmd.ucmd.actions & SB_FIRE);
switch (pPlayer->weaponState)
@ -2210,7 +2210,7 @@ int processSprayCan(BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
static bool processTNT(BloodPlayer* pPlayer)
static bool processTNT(DBloodPlayer* pPlayer)
{
const char bUseShootAsThrow = !VanillaMode() && (pPlayer->cmd.ucmd.actions & SB_FIRE);
switch (pPlayer->weaponState)
@ -2255,7 +2255,7 @@ static bool processTNT(BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
static bool processProxy(BloodPlayer* pPlayer)
static bool processProxy(DBloodPlayer* pPlayer)
{
switch (pPlayer->weaponState)
{
@ -2279,7 +2279,7 @@ static bool processProxy(BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
static bool processRemote(BloodPlayer* pPlayer)
static bool processRemote(DBloodPlayer* pPlayer)
{
switch (pPlayer->weaponState)
{
@ -2301,7 +2301,7 @@ static bool processRemote(BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
static bool processLeech(BloodPlayer* pPlayer)
static bool processLeech(DBloodPlayer* pPlayer)
{
switch (pPlayer->weaponState)
{
@ -2331,7 +2331,7 @@ static bool processLeech(BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
static bool processTesla(BloodPlayer* pPlayer)
static bool processTesla(DBloodPlayer* pPlayer)
{
switch (pPlayer->weaponState)
{
@ -2370,7 +2370,7 @@ static bool processTesla(BloodPlayer* pPlayer)
//
//---------------------------------------------------------------------------
void WeaponProcess(BloodPlayer* pPlayer) {
void WeaponProcess(DBloodPlayer* pPlayer) {
pPlayer->flashEffect = ClipLow(pPlayer->flashEffect - 1, 0);

View file

@ -212,7 +212,7 @@ void RANDOMSCRAP(DDukeActor* origin)
//
//---------------------------------------------------------------------------
void addammo(int weapon, DukePlayer* player, int amount)
void addammo(int weapon, DDukePlayer* player, int amount)
{
player->ammo_amount[weapon] += amount;
@ -226,7 +226,7 @@ void addammo(int weapon, DukePlayer* player, int amount)
//
//---------------------------------------------------------------------------
void checkavailinven(DukePlayer* player)
void checkavailinven(DDukePlayer* player)
{
if (player->firstaid_amount > 0)
@ -252,7 +252,7 @@ void checkavailinven(DukePlayer* player)
//
//---------------------------------------------------------------------------
void checkavailweapon(DukePlayer* player)
void checkavailweapon(DDukePlayer* player)
{
int i, snum;
int weap;
@ -273,7 +273,7 @@ void checkavailweapon(DukePlayer* player)
weap = player->curr_weapon;
if (player->gotweapon[weap])
{
if (player->ammo_amount[weap] > 0 || (WeaponSwitch(player - (DukePlayer*)PlayerArray) & 2) == 0)
if (player->ammo_amount[weap] > 0 || (WeaponSwitch(player->pnum) & 2) == 0)
return;
}
@ -330,7 +330,7 @@ void checkavailweapon(DukePlayer* player)
//
//---------------------------------------------------------------------------
void clearcamera(DukePlayer* ps)
void clearcamera(DDukePlayer* ps)
{
const auto pact = ps->GetActor();
ps->newOwner = nullptr;

View file

@ -49,7 +49,7 @@ BEGIN_DUKE_NS
//
//---------------------------------------------------------------------------
void addweapon_d(DukePlayer *p, int weapon, bool wswitch)
void addweapon_d(DDukePlayer *p, int weapon, bool wswitch)
{
if (p->gotweapon[weapon] == 0 )
{

View file

@ -453,7 +453,7 @@ void moveminecart(void)
void thunder(void)
{
DukePlayer* p;
DDukePlayer* p;
int r1, r2;
int i = 0;
uint8_t shade;

View file

@ -42,7 +42,7 @@ void moveminecart();
//
//---------------------------------------------------------------------------
void addweapon_r(DukePlayer* p, int weapon, bool wswitch)
void addweapon_r(DDukePlayer* p, int weapon, bool wswitch)
{
int cw = p->curr_weapon;
if (p->OnMotorcycle || p->OnBoat)
@ -819,7 +819,7 @@ void moveeffectors_r(void) //STATNUM 3
//
//---------------------------------------------------------------------------
void fakebubbaspawn(DDukeActor *actor, DukePlayer* p)
void fakebubbaspawn(DDukeActor *actor, DDukePlayer* p)
{
fakebubba_spawn++;
switch (fakebubba_spawn)

View file

@ -39,18 +39,18 @@ void activatebysector_r(sectortype* sect, DDukeActor* j);
void checksectors_d(int snum);
void checksectors_r(int snum);
void addweapon_d(DukePlayer* p, int weapon, bool wswitch);
void addweapon_r(DukePlayer* p, int weapon, bool wswitch);
void addweapon_d(DDukePlayer* p, int weapon, bool wswitch);
void addweapon_r(DDukePlayer* p, int weapon, bool wswitch);
int ifhitbyweapon_r(DDukeActor* sn);
int ifhitbyweapon_d(DDukeActor* sn);
void incur_damage_d(DukePlayer* p);
void incur_damage_r(DukePlayer* p);
void incur_damage_d(DDukePlayer* p);
void incur_damage_r(DDukePlayer* p);
void selectweapon_d(int snum, int j);
void selectweapon_r(int snum, int j);
int doincrements_d(DukePlayer* p);
int doincrements_r(DukePlayer* p);
void checkweapons_d(DukePlayer* p);
void checkweapons_r(DukePlayer* p);
int doincrements_d(DDukePlayer* p);
int doincrements_r(DDukePlayer* p);
void checkweapons_d(DDukePlayer* p);
void checkweapons_r(DDukePlayer* p);
void processinput_d(int snum);
void processinput_r(int snum);
void displayweapon_d(int snum, double interpfrac);

View file

@ -74,14 +74,14 @@ struct Dispatcher
void (*activatebysector)(sectortype* sect, DDukeActor* j);
void (*checksectors)(int low);
void (*addweapon)(DukePlayer *p, int weapon, bool wswitch);
void (*addweapon)(DDukePlayer *p, int weapon, bool wswitch);
int (*ifhitbyweapon)(DDukeActor* sectnum);
// player
void (*incur_damage)(DukePlayer* p);
void (*incur_damage)(DDukePlayer* p);
void (*selectweapon)(int snum, int j);
int (*doincrements)(DukePlayer* p);
void (*checkweapons)(DukePlayer* p);
int (*doincrements)(DDukePlayer* p);
void (*checkweapons)(DDukePlayer* p);
void (*processinput)(int snum);
void (*displayweapon)(int snum, double interpfrac);
void (*displaymasks)(int snum, int p, double interpfrac);
@ -98,18 +98,18 @@ void CallTick(DDukeActor* actor);
bool CallOperate(DDukeActor* actor, int plnum);
void CallAction(DDukeActor* actor);
void checkhitsprite(DDukeActor* actor, DDukeActor* hitter);
void CallOnHurt(DDukeActor* actor, DukePlayer* hitter);
void CallOnTouch(DDukeActor* actor, DukePlayer* hitter);
bool CallOnUse(DDukeActor* actor, DukePlayer* user);
void CallOnMotoSmash(DDukeActor* actor, DukePlayer* hitter);
void CallOnHurt(DDukeActor* actor, DDukePlayer* hitter);
void CallOnTouch(DDukeActor* actor, DDukePlayer* hitter);
bool CallOnUse(DDukeActor* actor, DDukePlayer* user);
void CallOnMotoSmash(DDukeActor* actor, DDukePlayer* hitter);
void CallOnRespawn(DDukeActor* actor, int low);
bool CallAnimate(DDukeActor* actor, tspritetype* hitter);
bool CallShootThis(DDukeActor* clsdef, DDukeActor* actor, int pn, const DVector3& spos, DAngle sang);
void CallStaticSetup(DDukeActor* actor);
void CallPlayFTASound(DDukeActor* actor, int mode = 0);
void CallStandingOn(DDukeActor* actor, DukePlayer* p);
void CallStandingOn(DDukeActor* actor, DDukePlayer* p);
void CallRunState(DDukeActor* actor);
int CallTriggerSwitch(DDukeActor* actor, DukePlayer* p);
int CallTriggerSwitch(DDukeActor* actor, DDukePlayer* p);
PClassActor* CallGetRadiusDamageType(DDukeActor* actor, int targhealth);

View file

@ -9,12 +9,12 @@ using DukeStatIterator = TStatIterator<DDukeActor>;
using DukeSectIterator = TSectIterator<DDukeActor>;
using DukeSpriteIterator = TSpriteIterator<DDukeActor>;
inline DDukeActor* DukePlayer::GetActor()
inline DDukeActor* DDukePlayer::GetActor()
{
return static_cast<DDukeActor*>(actor);
}
inline int DukePlayer::GetPlayerNum()
inline int DDukePlayer::GetPlayerNum()
{
return GetActor()->PlayerIndex();
}

View file

@ -39,7 +39,7 @@ void operaterespawns(int low);
void moveclouds(double interpfrac);
void movefta();
void clearcameras(DukePlayer* p);
void clearcameras(DDukePlayer* p);
void RANDOMSCRAP(DDukeActor* i);
void detonate(DDukeActor* i, PClassActor* explosion);
void hitradius(DDukeActor* i, int r, int hp1, int hp2, int hp3, int hp4);
@ -88,8 +88,8 @@ void handle_se130(DDukeActor* i, int countmax);
int dodge(DDukeActor*);
void alterang(int ang, DDukeActor* actor, int g_p);
void checkavailweapon(DukePlayer* p);
void addammo(int weapon, DukePlayer* p, int amount);
void checkavailweapon(DDukePlayer* p);
void addammo(int weapon, DDukePlayer* p, int amount);
int ssp(DDukeActor* i, unsigned int cliptype); //The set sprite function
void insertspriteq(DDukeActor *i);
@ -114,35 +114,35 @@ void playerAimDown(int snum, ESyncBits actions);
DDukeActor* aim(DDukeActor* s, int aang, bool force = true, bool* b = nullptr);
DDukeActor* aim_(DDukeActor* actor, DDukeActor* weapon, double aimangle, bool* b = nullptr);
void shoot(DDukeActor* actor, PClass* cls);
void checkweapons(DukePlayer* const p);
void checkweapons(DDukePlayer* const p);
int findotherplayer(int p, double* d);
void quickkill(DukePlayer* p);
int setpal(DukePlayer* p);
void quickkill(DDukePlayer* p);
int setpal(DDukePlayer* p);
int madenoise(int playerNum);
int haslock(sectortype* sect, int snum);
void purplelavacheck(DukePlayer* p);
void addphealth(DukePlayer* p, int amount, bool bigitem);
int playereat(DukePlayer* p, int amount, bool bigitem);
void playerdrink(DukePlayer* p, int amount);
int playeraddammo(DukePlayer* p, int weaponindex, int amount);
int playeraddweapon(DukePlayer* p, int weaponindex, int amount);
void playeraddinventory(DukePlayer* p, DDukeActor* item, int type, int amount);
void purplelavacheck(DDukePlayer* p);
void addphealth(DDukePlayer* p, int amount, bool bigitem);
int playereat(DDukePlayer* p, int amount, bool bigitem);
void playerdrink(DDukePlayer* p, int amount);
int playeraddammo(DDukePlayer* p, int weaponindex, int amount);
int playeraddweapon(DDukePlayer* p, int weaponindex, int amount);
void playeraddinventory(DDukePlayer* p, DDukeActor* item, int type, int amount);
void actorsizeto(DDukeActor* actor, double x, double y);
void spawndebris(DDukeActor* g_ac, int dnum, int count);
int checkp(DDukeActor* self, DukePlayer* p, int flags);
int playercheckinventory(DukePlayer* p, DDukeActor* item, int type, int amount);
void playerstomp(DukePlayer* p, DDukeActor* stomped);
void playerreset(DukePlayer* p, DDukeActor* g_ac);
void wackplayer(DukePlayer* p);
int checkp(DDukeActor* self, DDukePlayer* p, int flags);
int playercheckinventory(DDukePlayer* p, DDukeActor* item, int type, int amount);
void playerstomp(DDukePlayer* p, DDukeActor* stomped);
void playerreset(DDukePlayer* p, DDukeActor* g_ac);
void wackplayer(DDukePlayer* p);
void actoroperate(DDukeActor* g_ac);
void playerkick(DukePlayer* p, DDukeActor* g_ac);
void playerkick(DDukePlayer* p, DDukeActor* g_ac);
void garybanjo(DDukeActor* g_ac);
int ifsquished(DDukeActor* i, int p);
void fakebubbaspawn(DDukeActor* actor, DukePlayer* p);
void fakebubbaspawn(DDukeActor* actor, DDukePlayer* p);
void tearitup(sectortype* sect);
void destroyit(DDukeActor* actor);
void mamaspawn(DDukeActor* actor);
void forceplayerangle(DukePlayer* snum);
void forceplayerangle(DDukePlayer* snum);
bool checkhitceiling(sectortype* sectp);
@ -156,7 +156,7 @@ void allignwarpelevators(void);
bool isablockdoor(int tileNum);
bool activatewarpelevators(DDukeActor* s, int w);
int check_activator_motion(int lotag);
void operateactivators(int l, DukePlayer* w);
void operateactivators(int l, DDukePlayer* w);
void operateforcefields(DDukeActor* s, int low);
void operatemasterswitches(int lotag);
void operatesectors(sectortype* s, DDukeActor* i);
@ -168,11 +168,11 @@ int setanimation(sectortype* animsect, int animtype, walltype* animtarget, doubl
int setanimation(sectortype* animsect, int animtype, sectortype* animtarget, double thegoal, double thevel);
void dofurniture(walltype* wallNum, sectortype* sectnum, int playerNum);
void dotorch();
double hitawall(DukePlayer* pl, walltype** hitWall);
double hitawall(DDukePlayer* pl, walltype** hitWall);
double hits(DDukeActor* snum);
DDukeActor* LocateTheLocator(int n, sectortype* sectnum);
void clearcamera(DukePlayer* ps);
void clearcamera(DDukePlayer* ps);
void LoadActor(DDukeActor* i, int p, int x);
bool execute(DDukeActor* s, int p, double d, int* killit_flag = nullptr);
@ -189,14 +189,14 @@ void ceilingglass(DDukeActor* snum, sectortype* sectnum, int cnt);
void spriteglass(DDukeActor* snum, int cnt);
void lotsofcolourglass(DDukeActor* snum, walltype* wallNum, int cnt);
void lotsofglass(DDukeActor* snum, walltype* wal, int cnt);
void checkplayerhurt_d(DukePlayer* p, const Collision& coll);
void checkplayerhurt_r(DukePlayer* p, const Collision& coll);
void checkplayerhurt_d(DDukePlayer* p, const Collision& coll);
void checkplayerhurt_r(DDukePlayer* p, const Collision& coll);
DDukeActor* dospawnsprite(DDukeActor* actj, int pn);
void spriteinit(DDukeActor*, TArray<DDukeActor*>& actors);
DDukeActor* spawninit(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>* actors);
void checkavailinven(DukePlayer* p);
void checkavailinven(DDukePlayer* p);
bool initspriteforspawn(DDukeActor* spn);
void initshell(DDukeActor* actj, DDukeActor* acti, bool isshell);
void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors);
@ -204,18 +204,18 @@ int startrts(int lumpNum, int localPlayer);
void pickrandomspot(int pn);
void premapcontroller(DDukeActor* ac);
void resetinventory(DukePlayer* pn);
void resetinventory(DDukePlayer* pn);
void resetplayerstats(int pn);
void resetweapons(DukePlayer* pn);
void resetweapons(DDukePlayer* pn);
void resetprestat(int snum, int g);
void prelevel_common(int g);
void cacheit();
void FTA(int q, DukePlayer* p);
void OnMotorcycle(DukePlayer *pl);
void OffMotorcycle(DukePlayer *pl);
void OnBoat(DukePlayer *pl);
void OffBoat(DukePlayer *pl);
void FTA(int q, DDukePlayer* p);
void OnMotorcycle(DDukePlayer *pl);
void OffMotorcycle(DDukePlayer *pl);
void OnBoat(DDukePlayer *pl);
void OffBoat(DDukePlayer *pl);
void cameratext(DDukeActor* i);
void dobonus(int bonusonly, const CompletionFunc& completion);
@ -236,7 +236,7 @@ void enterlevel(MapRecord* mi, int gm);
void donewgame(MapRecord* map, int sk);
int playercolor2lookup(int color);
void PlayerColorChanged(void);
bool movementBlocked(DukePlayer *p);
bool movementBlocked(DDukePlayer *p);
void underwater(int snum, ESyncBits actions, double floorz, double ceilingz);
void loadcons();
void DrawStatusBar();

View file

@ -68,6 +68,27 @@ IMPLEMENT_POINTER(temp_actor)
IMPLEMENT_POINTER(seek_actor)
IMPLEMENT_POINTERS_END
IMPLEMENT_CLASS(DDukePlayer, false, true)
IMPLEMENT_POINTERS_START(DDukePlayer)
IMPLEMENT_POINTER(actorsqu)
IMPLEMENT_POINTER(wackedbyactor)
IMPLEMENT_POINTER(on_crane)
IMPLEMENT_POINTER(holoduke_on)
IMPLEMENT_POINTER(somethingonplayer)
IMPLEMENT_POINTER(access_spritenum)
IMPLEMENT_POINTER(dummyplayersprite)
IMPLEMENT_POINTER(newOwner)
IMPLEMENT_POINTERS_END
size_t DDukePlayer::PropagateMark()
{
for (auto& var : uservars)
{
var.Mark();
}
return Super::PropagateMark();
}
size_t DDukeActor::PropagateMark()
{
for (auto& var : uservars)
@ -83,26 +104,6 @@ static void markgcroots()
GC::MarkArray(spriteq, 1024);
GC::Mark(currentCommentarySprite);
GC::Mark(ud.cameraactor);
for (int i = 0; i < MAXPLAYERS; i++)
{
auto plr = getPlayer(i);
if (plr)
{
GC::Mark(plr->actor);
GC::Mark(plr->actorsqu);
GC::Mark(plr->wackedbyactor);
GC::Mark(plr->on_crane);
GC::Mark(plr->holoduke_on);
GC::Mark(plr->somethingonplayer);
GC::Mark(plr->access_spritenum);
GC::Mark(plr->dummyplayersprite);
GC::Mark(plr->newOwner);
for (auto& var : plr->uservars)
{
var.Mark();
}
}
}
}
//---------------------------------------------------------------------------
@ -393,8 +394,8 @@ void GameInterface::app_init()
// Initialise player array.
for (unsigned i = 0; i < MAXPLAYERS; i++)
{
PlayerArray[i] = new DukePlayer;
*getPlayer(i) = {};
PlayerArray[i] = Create<DDukePlayer>(i);
GC::WriteBarrier(PlayerArray[i]);
}
RegisterClasses();
@ -645,7 +646,7 @@ void checkhitsprite(DDukeActor* actor, DDukeActor* hitter)
}
}
void CallOnHurt(DDukeActor* actor, DukePlayer* hitter)
void CallOnHurt(DDukeActor* actor, DDukePlayer* hitter)
{
IFVIRTUALPTR(actor, DDukeActor, onHurt)
{
@ -654,7 +655,7 @@ void CallOnHurt(DDukeActor* actor, DukePlayer* hitter)
}
}
void CallOnTouch(DDukeActor* actor, DukePlayer* hitter)
void CallOnTouch(DDukeActor* actor, DDukePlayer* hitter)
{
IFVIRTUALPTR(actor, DDukeActor, onTouch)
{
@ -664,7 +665,7 @@ void CallOnTouch(DDukeActor* actor, DukePlayer* hitter)
}
bool CallOnUse(DDukeActor* actor, DukePlayer* user)
bool CallOnUse(DDukeActor* actor, DDukePlayer* user)
{
int nval = false;
IFVIRTUALPTR(actor, DDukeActor, onUse)
@ -676,7 +677,7 @@ bool CallOnUse(DDukeActor* actor, DukePlayer* user)
return nval;
}
void CallOnMotoSmash(DDukeActor* actor, DukePlayer* hitter)
void CallOnMotoSmash(DDukeActor* actor, DDukePlayer* hitter)
{
IFVIRTUALPTR(actor, DDukeActor, onMotoSmash)
{
@ -737,7 +738,7 @@ void CallPlayFTASound(DDukeActor* actor, int mode)
}
}
void CallStandingOn(DDukeActor* actor, DukePlayer* p)
void CallStandingOn(DDukeActor* actor, DDukePlayer* p)
{
IFVIRTUALPTR(actor, DDukeActor, StandingOn)
{
@ -746,7 +747,7 @@ void CallStandingOn(DDukeActor* actor, DukePlayer* p)
}
}
int CallTriggerSwitch(DDukeActor* actor, DukePlayer* p)
int CallTriggerSwitch(DDukeActor* actor, DDukePlayer* p)
{
int nval = false;
IFVIRTUALPTR(actor, DDukeActor, TriggerSwitch)

View file

@ -96,7 +96,7 @@ void GameInterface::ExitFromMenu()
//
//---------------------------------------------------------------------------
void FTA(int q, DukePlayer* p)
void FTA(int q, DDukePlayer* p)
{
if (q < 0 || gamestate != GS_LEVEL)
return;
@ -211,7 +211,7 @@ void V_AddBlend (float r, float g, float b, float a, float v_blend[4])
void drawoverlays(double interpfrac)
{
DukePlayer* pp;
DDukePlayer* pp;
DVector2 cposxy;
DAngle cang;

View file

@ -1298,7 +1298,7 @@ void DoActor(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
//
//---------------------------------------------------------------------------
int CheckWeapRec(DukePlayer* p, DDukeActor* g_ac, int testonly)
int CheckWeapRec(DDukePlayer* p, DDukeActor* g_ac, int testonly)
{
int j;
for (j = 0; j < p->weapreccnt; j++)
@ -1416,7 +1416,7 @@ static int ifcanshoottarget(DDukeActor *actor, int g_p, int g_x)
//
//---------------------------------------------------------------------------
int ifcansee(DDukeActor* actor, DukePlayer* p)
int ifcansee(DDukeActor* actor, DDukePlayer* p)
{
int j;
DDukeActor* tosee;

View file

@ -61,7 +61,7 @@ inline static void hud_drawpal(double x, double y, const char* tilenum, int shad
//
//---------------------------------------------------------------------------
static void displayloogie(DukePlayer* p, double const interpfrac)
static void displayloogie(DDukePlayer* p, double const interpfrac)
{
if (p->loogcnt == 0) return;
@ -84,7 +84,7 @@ static void displayloogie(DukePlayer* p, double const interpfrac)
//
//---------------------------------------------------------------------------
static bool animatefist(int gs, DukePlayer* p, double xoffset, double yoffset, int fistpal, double const interpfrac)
static bool animatefist(int gs, DDukePlayer* p, double xoffset, double yoffset, int fistpal, double const interpfrac)
{
const double fisti = min(interpolatedvalue<double>(p->ofist_incs, p->fist_incs, interpfrac), 32.);
if (fisti <= 0) return false;
@ -103,7 +103,7 @@ static bool animatefist(int gs, DukePlayer* p, double xoffset, double yoffset, i
//
//---------------------------------------------------------------------------
static bool animateknee(int gs, DukePlayer* p, double xoffset, double yoffset, int pal, double const interpfrac, DAngle angle)
static bool animateknee(int gs, DDukePlayer* p, double xoffset, double yoffset, int pal, double const interpfrac, DAngle angle)
{
if (p->knee_incs > 11 || p->knee_incs == 0 || p->GetActor()->spr.extra <= 0) return false;
@ -121,7 +121,7 @@ static bool animateknee(int gs, DukePlayer* p, double xoffset, double yoffset, i
//
//---------------------------------------------------------------------------
static bool animateknuckles(int gs, DukePlayer* p, double xoffset, double yoffset, int pal, DAngle angle)
static bool animateknuckles(int gs, DDukePlayer* p, double xoffset, double yoffset, int pal, DAngle angle)
{
if (isWW2GI() || p->over_shoulder_on != 0 || p->knuckle_incs == 0 || p->GetActor()->spr.extra <= 0) return false;
static const char* const frames[] = { "CRACKKNUCKLES0", "CRACKKNUCKLES1", "CRACKKNUCKLES2", "CRACKKNUCKLES3" };
@ -158,7 +158,7 @@ void displaymasks_d(int snum, int p, double interpfrac)
//
//---------------------------------------------------------------------------
static bool animatetip(int gs, DukePlayer* p, double xoffset, double yoffset, int pal, double const interpfrac, DAngle angle)
static bool animatetip(int gs, DDukePlayer* p, double xoffset, double yoffset, int pal, double const interpfrac, DAngle angle)
{
if (p->tipincs == 0) return false;
@ -177,7 +177,7 @@ static bool animatetip(int gs, DukePlayer* p, double xoffset, double yoffset, in
//
//---------------------------------------------------------------------------
static bool animateaccess(int gs, DukePlayer* p, double xoffset, double yoffset, double const interpfrac, DAngle angle)
static bool animateaccess(int gs, DDukePlayer* p, double xoffset, double yoffset, double const interpfrac, DAngle angle)
{
if (p->access_incs == 0 || p->GetActor()->spr.extra <= 0) return false;
@ -201,7 +201,7 @@ static bool animateaccess(int gs, DukePlayer* p, double xoffset, double yoffset,
//
//---------------------------------------------------------------------------
void animateshrunken(DukePlayer* p, double xoffset, double yoffset, int8_t shade, int o, double interpfrac)
void animateshrunken(DDukePlayer* p, double xoffset, double yoffset, int8_t shade, int o, double interpfrac)
{
const double fistsign = BobVal(interpolatedvalue<double>(p->ofistsign, p->fistsign, interpfrac)) * 16;
int pal = getPlayer(screenpeek)->cursector->floorpal;
@ -220,7 +220,7 @@ void animateshrunken(DukePlayer* p, double xoffset, double yoffset, int8_t shade
void displayweapon_d(int snum, double interpfrac)
{
int pal, pal2;
DukePlayer* p = getPlayer(snum);
DDukePlayer* p = getPlayer(snum);
if (p->newOwner != nullptr || ud.cameraactor != nullptr || p->over_shoulder_on > 0 || (p->GetActor()->spr.pal != 1 && p->GetActor()->spr.extra <= 0))
return;

View file

@ -208,7 +208,7 @@ void DrawBoat(int const kb, const DVector2& offsets, DAngle angle, int shade, in
//
//
//---------------------------------------------------------------------------
void animateshrunken(DukePlayer* p, double xoffset, double yoffset, int8_t shade, int o, double interpfrac);
void animateshrunken(DDukePlayer* p, double xoffset, double yoffset, int8_t shade, int o, double interpfrac);
void displayweapon_r(int snum, double interpfrac)
{

View file

@ -10,9 +10,9 @@
// all inline functions.
BEGIN_DUKE_NS
inline DukePlayer* getPlayer(int index)
inline DDukePlayer* getPlayer(int index)
{
return static_cast<DukePlayer*>(PlayerArray[index]);
return static_cast<DDukePlayer*>(PlayerArray[index]);
}
inline int rnd(int X)
@ -165,7 +165,7 @@ inline void clearfriction()
}
}
inline void SetPlayerPal(DukePlayer* p, PalEntry pe)
inline void SetPlayerPal(DDukePlayer* p, PalEntry pe)
{
p->pals = pe;
}
@ -175,7 +175,7 @@ inline bool playrunning()
return (paused == 0 || (paused == 1 && (ud.recstat == 2 || ud.multimode > 1)));
}
inline void doslopetilting(DukePlayer* p)
inline void doslopetilting(DDukePlayer* p)
{
p->Angles.doViewPitch(p->aim_mode == 0 && p->on_ground && p->cursector->lotag != ST_2_UNDERWATER);
}
@ -343,7 +343,7 @@ inline void subkill(DDukeActor* actor)
}
}
inline void dokill(DukePlayer* p, DDukeActor* g_ac, int amount)
inline void dokill(DDukePlayer* p, DDukeActor* g_ac, int amount)
{
if (g_ac->spriteextra < 1 || g_ac->spriteextra == 128 || !isRR())
{

View file

@ -54,7 +54,7 @@ void hud_input(int plnum)
{
int i, k;
uint8_t dainv;
DukePlayer* p;
DDukePlayer* p;
p = getPlayer(plnum);
auto pact = p->GetActor();

View file

@ -32,7 +32,7 @@ BEGIN_DUKE_NS
int madenoise(int snum)
{
DukePlayer *p;
DDukePlayer *p;
p = getPlayer(snum);
p->donoise = 1;
p->noise = p->GetActor()->spr.pos.XY();

View file

@ -78,7 +78,7 @@ void PlayerColorChanged(void)
//
//---------------------------------------------------------------------------
int setpal(DukePlayer* p)
int setpal(DDukePlayer* p)
{
int palette;
if (p->DrugMode) palette = DRUGPAL;
@ -96,7 +96,7 @@ int setpal(DukePlayer* p)
//
//---------------------------------------------------------------------------
void quickkill(DukePlayer* p)
void quickkill(DDukePlayer* p)
{
SetPlayerPal(p, PalEntry(48, 48, 48, 48));
@ -113,7 +113,7 @@ void quickkill(DukePlayer* p)
//
//---------------------------------------------------------------------------
void forceplayerangle(DukePlayer* p)
void forceplayerangle(DDukePlayer* p)
{
const auto ang = (DAngle22_5 - randomAngle(45)) / 2.;
@ -174,7 +174,7 @@ double hitasprite(DDukeActor* actor, DDukeActor** hitsp)
//
//---------------------------------------------------------------------------
double hitawall(DukePlayer* p, walltype** hitw)
double hitawall(DDukePlayer* p, walltype** hitw)
{
HitInfo hit{};
@ -708,7 +708,7 @@ void playerJump(int snum, double floorz, double ceilingz)
//
//---------------------------------------------------------------------------
void DukePlayer::apply_seasick()
void DDukePlayer::apply_seasick()
{
if (isRRRA() && SeaSick && (dead_flag == 0))
{
@ -736,7 +736,7 @@ void DukePlayer::apply_seasick()
//
//---------------------------------------------------------------------------
void DukePlayer::backuppos(bool noclipping)
void DDukePlayer::backuppos(bool noclipping)
{
if (!noclipping)
{
@ -758,7 +758,7 @@ void DukePlayer::backuppos(bool noclipping)
//
//---------------------------------------------------------------------------
void DukePlayer::backupweapon()
void DDukePlayer::backupweapon()
{
oweapon_sway = weapon_sway;
oweapon_pos = weapon_pos;
@ -779,7 +779,7 @@ void DukePlayer::backupweapon()
//
//---------------------------------------------------------------------------
void DukePlayer::checkhardlanding()
void DDukePlayer::checkhardlanding()
{
if (hard_landing > 0)
{
@ -788,7 +788,7 @@ void DukePlayer::checkhardlanding()
}
}
void DukePlayer::playerweaponsway(double xvel)
void DDukePlayer::playerweaponsway(double xvel)
{
if (cl_weaponsway)
{
@ -966,7 +966,7 @@ void shoot(DDukeActor* actor, PClass* cls)
//
//---------------------------------------------------------------------------
bool movementBlocked(DukePlayer *p)
bool movementBlocked(DDukePlayer *p)
{
auto blockingweapon = [=]()
{
@ -1026,7 +1026,7 @@ int haslock(sectortype* sectp, int snum)
//
//---------------------------------------------------------------------------
void purplelavacheck(DukePlayer* p)
void purplelavacheck(DDukePlayer* p)
{
auto pact = p->GetActor();
if (p->spritebridge == 0 && pact->insector())
@ -1060,7 +1060,7 @@ void purplelavacheck(DukePlayer* p)
//
//---------------------------------------------------------------------------
void addphealth(DukePlayer* p, int amount, bool bigitem)
void addphealth(DDukePlayer* p, int amount, bool bigitem)
{
if (p->newOwner != nullptr)
{
@ -1124,7 +1124,7 @@ void addphealth(DukePlayer* p, int amount, bool bigitem)
//
//---------------------------------------------------------------------------
int playereat(DukePlayer* p, int amount, bool bigitem)
int playereat(DDukePlayer* p, int amount, bool bigitem)
{
p->eat += amount;
if (p->eat > 100)
@ -1181,7 +1181,7 @@ int playereat(DukePlayer* p, int amount, bool bigitem)
//
//---------------------------------------------------------------------------
void playerdrink(DukePlayer* p, int amount)
void playerdrink(DDukePlayer* p, int amount)
{
p->drink_amt += amount;
int curhealth = p->GetActor()->spr.extra;
@ -1221,7 +1221,7 @@ void playerdrink(DukePlayer* p, int amount)
//
//---------------------------------------------------------------------------
int playeraddammo(DukePlayer* p, int weaponindex, int amount)
int playeraddammo(DDukePlayer* p, int weaponindex, int amount)
{
if (p->ammo_amount[weaponindex] >= gs.max_ammo_amount[weaponindex])
{
@ -1229,21 +1229,21 @@ int playeraddammo(DukePlayer* p, int weaponindex, int amount)
}
addammo(weaponindex, p, amount);
if (p->curr_weapon == KNEE_WEAPON)
if (p->gotweapon[weaponindex] && (WeaponSwitch(p - (DukePlayer*)PlayerArray) & 1))
if (p->gotweapon[weaponindex] && (WeaponSwitch(p->pnum) & 1))
fi.addweapon(p, weaponindex, true);
return true;
}
int playeraddweapon(DukePlayer* p, int weaponindex, int amount)
int playeraddweapon(DDukePlayer* p, int weaponindex, int amount)
{
if (p->gotweapon[weaponindex] == 0) fi.addweapon(p, weaponindex, !!(WeaponSwitch(p - (DukePlayer*)PlayerArray) & 1));
if (p->gotweapon[weaponindex] == 0) fi.addweapon(p, weaponindex, !!(WeaponSwitch(p->pnum) & 1));
else if (p->ammo_amount[weaponindex] >= gs.max_ammo_amount[weaponindex])
{
return false;
}
addammo(weaponindex, p, amount);
if (p->curr_weapon == KNEE_WEAPON)
if (p->gotweapon[weaponindex] && (WeaponSwitch(p - (DukePlayer*)PlayerArray) & 1))
if (p->gotweapon[weaponindex] && (WeaponSwitch(p->pnum) & 1))
fi.addweapon(p, weaponindex, true);
return true;
@ -1255,7 +1255,7 @@ int playeraddweapon(DukePlayer* p, int weaponindex, int amount)
//
//---------------------------------------------------------------------------
void playeraddinventory(DukePlayer* p, DDukeActor* item, int type, int amount)
void playeraddinventory(DDukePlayer* p, DDukeActor* item, int type, int amount)
{
switch (type)
{
@ -1322,12 +1322,12 @@ void playeraddinventory(DukePlayer* p, DDukeActor* item, int type, int amount)
//
//---------------------------------------------------------------------------
int checkp(DDukeActor* self, DukePlayer* p, int flags)
int checkp(DDukeActor* self, DDukePlayer* p, int flags)
{
bool j = 0;
double vel = self->vel.X;
unsigned plindex = unsigned(p - (DukePlayer*)PlayerArray);
unsigned plindex = unsigned(p->pnum);
// sigh.. this was yet another place where number literals were used as bit masks for every single value, making the code totally unreadable.
if ((flags & pducking) && p->on_ground && PlayerInput(plindex, SB_CROUCH))
@ -1381,7 +1381,7 @@ int checkp(DDukeActor* self, DukePlayer* p, int flags)
//
//---------------------------------------------------------------------------
int playercheckinventory(DukePlayer* p, DDukeActor* item, int type, int amount)
int playercheckinventory(DDukePlayer* p, DDukeActor* item, int type, int amount)
{
bool j = 0;
switch (type)
@ -1457,7 +1457,7 @@ int playercheckinventory(DukePlayer* p, DDukeActor* item, int type, int amount)
//
//---------------------------------------------------------------------------
void playerstomp(DukePlayer* p, DDukeActor* stomped)
void playerstomp(DDukePlayer* p, DDukeActor* stomped)
{
if (p->knee_incs == 0 && p->GetActor()->spr.scale.X >= (isRR() ? 0.140625 : 0.625))
if (cansee(stomped->spr.pos.plusZ(-4), stomped->sector(), p->GetActor()->getPosWithOffsetZ().plusZ(16), p->GetActor()->sector()))
@ -1475,7 +1475,7 @@ void playerstomp(DukePlayer* p, DDukeActor* stomped)
//
//---------------------------------------------------------------------------
void playerreset(DukePlayer* p, DDukeActor* g_ac)
void playerreset(DDukePlayer* p, DDukeActor* g_ac)
{
if (ud.multimode < 2)
{
@ -1484,7 +1484,7 @@ void playerreset(DukePlayer* p, DDukeActor* g_ac)
else
{
// I am not convinced this is even remotely smart to be executed from here..
pickrandomspot(int(p - (DukePlayer*)PlayerArray));
pickrandomspot(p->pnum);
g_ac->spr.pos = p->GetActor()->getPosWithOffsetZ();
p->GetActor()->backuppos();
p->setbobpos();
@ -1504,7 +1504,7 @@ void playerreset(DukePlayer* p, DDukeActor* g_ac)
p->wantweaponfire = -1;
p->GetActor()->PrevAngles.Pitch = p->GetActor()->spr.Angles.Pitch = nullAngle;
p->on_crane = nullptr;
p->frag_ps = int(p - (DukePlayer*)PlayerArray);
p->frag_ps = p->pnum;
p->Angles.PrevViewAngles.Pitch = p->Angles.ViewAngles.Pitch = nullAngle;
p->opyoff = 0;
p->wackedbyactor = nullptr;
@ -1540,7 +1540,7 @@ void playerreset(DukePlayer* p, DDukeActor* g_ac)
//
//---------------------------------------------------------------------------
void wackplayer(DukePlayer* p)
void wackplayer(DDukePlayer* p)
{
if (!isRR())
forceplayerangle(p);
@ -1559,7 +1559,7 @@ void wackplayer(DukePlayer* p)
//
//---------------------------------------------------------------------------
void playerkick(DukePlayer* p, DDukeActor* g_ac)
void playerkick(DDukePlayer* p, DDukeActor* g_ac)
{
if (ud.multimode > 1 && g_ac->isPlayer())
{

View file

@ -49,7 +49,7 @@ void operateweapon_ww(int snum, ESyncBits actions);
//
//---------------------------------------------------------------------------
void incur_damage_d(DukePlayer* p)
void incur_damage_d(DDukePlayer* p)
{
int damage = 0L, shield_damage = 0L;
@ -337,7 +337,7 @@ void selectweapon_d(int snum, int weap) // playernum, weaponnum
//
//---------------------------------------------------------------------------
int doincrements_d(DukePlayer* p)
int doincrements_d(DDukePlayer* p)
{
int snum;
@ -536,7 +536,7 @@ int doincrements_d(DukePlayer* p)
//
//---------------------------------------------------------------------------
void checkweapons_d(DukePlayer* p)
void checkweapons_d(DDukePlayer* p)
{
static PClassActor* const * const weapon_sprites[MAX_WEAPONS] = { &DukeMeleeAttackClass, &DukeFirstgunSpriteClass, &DukeShotgunSpriteClass,
&DukeChaingunSpriteClass, &DukeRPGSpriteClass, &DukePipeBombClass, &DukeShrinkerSpriteClass, &DukeDevastatorSpriteClass,
@ -1536,7 +1536,7 @@ void processinput_d(int snum)
Collision chz, clz;
bool shrunk;
int psectlotag;
DukePlayer* p;
DDukePlayer* p;
p = getPlayer(snum);
auto pact = p->GetActor();
@ -1952,7 +1952,7 @@ HORIZONLY:
if (p->show_empty_weapon > 0)
{
p->show_empty_weapon--;
if (p->show_empty_weapon == 0 && (WeaponSwitch(p - (DukePlayer*)PlayerArray) & 2))
if (p->show_empty_weapon == 0 && (WeaponSwitch(p->pnum) & 2))
{
if (p->last_full_weapon == GROW_WEAPON)
p->subweapon |= (1 << GROW_WEAPON);

View file

@ -43,7 +43,7 @@ BEGIN_DUKE_NS
//
//---------------------------------------------------------------------------
void incur_damage_r(DukePlayer* p)
void incur_damage_r(DDukePlayer* p)
{
int damage = 0, shield_damage = 0;
int gut = 0;
@ -343,7 +343,7 @@ void selectweapon_r(int snum, int weap)
//
//---------------------------------------------------------------------------
int doincrements_r(DukePlayer* p)
int doincrements_r(DDukePlayer* p)
{
int snum;
auto pact = p->GetActor();
@ -600,7 +600,7 @@ int doincrements_r(DukePlayer* p)
//
//---------------------------------------------------------------------------
void checkweapons_r(DukePlayer* p)
void checkweapons_r(DDukePlayer* p)
{
static PClassActor* const* const weapon_sprites[MAX_WEAPONS] = { &DukeMeleeAttackClass, &RedneckRevolverClass, &RedneckShotgunClass,
&RedneckRiflegunClass, &RedneckDynamiteClass, &RedneckCrossbowClass, &RedneckRipsawClass, &RedneckBlasterClass,
@ -709,7 +709,7 @@ enum : unsigned
VEH_FWDBRAKING = VEH_FORWARD|VEH_BRAKING,
};
static unsigned outVehicleFlags(DukePlayer* p, ESyncBits& actions)
static unsigned outVehicleFlags(DDukePlayer* p, ESyncBits& actions)
{
unsigned flags = 0;
flags += VEH_FORWARD * (p->cmd.ucmd.fvel > 0);
@ -727,7 +727,7 @@ static unsigned outVehicleFlags(DukePlayer* p, ESyncBits& actions)
//
//---------------------------------------------------------------------------
static void doVehicleTilting(DukePlayer* const p, const bool canTilt)
static void doVehicleTilting(DDukePlayer* const p, const bool canTilt)
{
auto adj = DAngle::fromDeg(p->cmd.ucmd.avel * (545943. / 3200000.) * canTilt);
if (p->OnMotorcycle) adj *= 5 * Sgn(p->MotoSpeed);
@ -744,7 +744,7 @@ static void doVehicleTilting(DukePlayer* const p, const bool canTilt)
//
//---------------------------------------------------------------------------
static void doVehicleBumping(DukePlayer* p, DDukeActor* pact, unsigned flags, bool bumptest, int bumpscale)
static void doVehicleBumping(DDukePlayer* p, DDukeActor* pact, unsigned flags, bool bumptest, int bumpscale)
{
if (p->MotoSpeed != 0 && p->on_ground == 1)
{
@ -805,7 +805,7 @@ static void doVehicleBumping(DukePlayer* p, DDukeActor* pact, unsigned flags, bo
//
//---------------------------------------------------------------------------
static void doVehicleDrunk(DukePlayer* const p)
static void doVehicleDrunk(DDukePlayer* const p)
{
if (p->drink_amt > 88 && p->moto_drink == 0)
{
@ -831,7 +831,7 @@ static void doVehicleDrunk(DukePlayer* const p)
//
//---------------------------------------------------------------------------
static void doVehicleSounds(DukePlayer* p, DDukeActor* pact, unsigned flags, unsigned sound1, unsigned sound2, unsigned sound3, unsigned sound4)
static void doVehicleSounds(DDukePlayer* p, DDukeActor* pact, unsigned flags, unsigned sound1, unsigned sound2, unsigned sound3, unsigned sound4)
{
if ((p->OnBoat && (flags & VEH_FWDBRAKING) == VEH_FORWARD) || flags & VEH_FORWARD)
{
@ -883,7 +883,7 @@ static void doVehicleSounds(DukePlayer* p, DDukeActor* pact, unsigned flags, uns
//
//---------------------------------------------------------------------------
static void doVehicleThrottling(DukePlayer* p, DDukeActor* pact, unsigned& flags, int fwdSpeed, int revSpeed, int brakeSpeed, int vBmpFwd, int vBmpBrake)
static void doVehicleThrottling(DDukePlayer* p, DDukeActor* pact, unsigned& flags, int fwdSpeed, int revSpeed, int brakeSpeed, int vBmpFwd, int vBmpBrake)
{
if (p->on_ground == 1)
{
@ -2910,7 +2910,7 @@ HORIZONLY:
{
p->show_empty_weapon--;
if (p->show_empty_weapon == 0 && (WeaponSwitch(p - (DukePlayer*)PlayerArray) & 2))
if (p->show_empty_weapon == 0 && (WeaponSwitch(p->pnum) & 2))
{
fi.addweapon(p, p->last_full_weapon, true);
return;
@ -2946,7 +2946,7 @@ HORIZONLY:
//
//---------------------------------------------------------------------------
void OnMotorcycle(DukePlayer *p)
void OnMotorcycle(DDukePlayer *p)
{
if (!p->OnMotorcycle && p->cursector->lotag != ST_2_UNDERWATER)
{
@ -2969,7 +2969,7 @@ void OnMotorcycle(DukePlayer *p)
//
//---------------------------------------------------------------------------
void OffMotorcycle(DukePlayer *p)
void OffMotorcycle(DDukePlayer *p)
{
auto pact = p->GetActor();
if (p->OnMotorcycle)
@ -3013,7 +3013,7 @@ void OffMotorcycle(DukePlayer *p)
//
//---------------------------------------------------------------------------
void OnBoat(DukePlayer *p)
void OnBoat(DDukePlayer *p)
{
if (!p->OnBoat)
{
@ -3034,7 +3034,7 @@ void OnBoat(DukePlayer *p)
//
//---------------------------------------------------------------------------
void OffBoat(DukePlayer *p)
void OffBoat(DDukePlayer *p)
{
if (p->OnBoat)
{

View file

@ -48,7 +48,7 @@ int operateTripbomb(int snum);
//
//---------------------------------------------------------------------------
void DoFire(DukePlayer* p, int snum)
void DoFire(DDukePlayer* p, int snum)
{
int i;
@ -105,7 +105,7 @@ void DoFire(DukePlayer* p, int snum)
//
//---------------------------------------------------------------------------
void DoSpawn(DukePlayer *p, int snum)
void DoSpawn(DDukePlayer *p, int snum)
{
if(!aplWeaponSpawn(p->curr_weapon, snum))
return;

View file

@ -60,7 +60,7 @@ void premapcontroller(DDukeActor* ac)
void pickrandomspot(int snum)
{
DukePlayer* p;
DDukePlayer* p;
int i;
p = getPlayer(snum);
@ -85,7 +85,7 @@ void pickrandomspot(int snum)
void resetplayerstats(int snum)
{
DukePlayer* p;
DDukePlayer* p;
p = getPlayer(snum);
@ -259,7 +259,7 @@ void resetplayerstats(int snum)
//
//---------------------------------------------------------------------------
void resetweapons(DukePlayer* p)
void resetweapons(DDukePlayer* p)
{
for (int weapon = PISTOL_WEAPON; weapon < MAX_WEAPONS; weapon++)
{
@ -293,7 +293,7 @@ void resetweapons(DukePlayer* p)
p->gotweapon[SLINGBLADE_WEAPON] = true;
p->ammo_amount[SLINGBLADE_WEAPON] = 1;
}
OnEvent(EVENT_RESETWEAPONS, int(p - (DukePlayer*)PlayerArray), nullptr, -1);
OnEvent(EVENT_RESETWEAPONS, p->pnum, nullptr, -1);
}
//---------------------------------------------------------------------------
@ -302,7 +302,7 @@ void resetweapons(DukePlayer* p)
//
//---------------------------------------------------------------------------
void resetinventory(DukePlayer* p)
void resetinventory(DDukePlayer* p)
{
p->inven_icon = 0;
p->boot_amount = 0;
@ -362,7 +362,7 @@ void resetinventory(DukePlayer* p)
ufocnt = 0;
hulkspawn = 2;
}
OnEvent(EVENT_RESETINVENTORY, int(p - (DukePlayer*)PlayerArray), p->GetActor());
OnEvent(EVENT_RESETINVENTORY, p->pnum, p->GetActor());
}
@ -374,7 +374,7 @@ void resetinventory(DukePlayer* p)
void resetprestat(int snum,int g)
{
DukePlayer* p;
DDukePlayer* p;
p = getPlayer(snum);
@ -1058,7 +1058,7 @@ void cacheit(void)
//
//---------------------------------------------------------------------------
static int LoadTheMap(MapRecord *mi, DukePlayer*p, int gamemode)
static int LoadTheMap(MapRecord *mi, DDukePlayer*p, int gamemode)
{
int16_t lbang;
if (isShareware() && (mi->flags & MI_USERMAP))

View file

@ -42,7 +42,7 @@ BEGIN_DUKE_NS
void prelevel_r(int g, TArray<DDukeActor*>& actors)
{
DukePlayer* p;
DDukePlayer* p;
int j;
int lotaglist;
TArray<short> lotags;

View file

@ -129,7 +129,7 @@ bool GameInterface::GetGeoEffect(GeoEffect* eff, sectortype* viewsector)
//---------------------------------------------------------------------------
int DrugTimer;
static int getdrugmode(DukePlayer *p, int oyrepeat)
static int getdrugmode(DDukePlayer *p, int oyrepeat)
{
int now = I_GetBuildTime() >> 1; // this function works on a 60 fps setup.
if (playrunning() && p->DrugMode > 0)
@ -218,7 +218,7 @@ void displayrooms(int snum, double interpfrac, bool sceneonly)
DVector3 cpos;
DRotator cangles;
DukePlayer* p = getPlayer(snum);
DDukePlayer* p = getPlayer(snum);
// update render angles.
p->Angles.updateCameraAngles(interpfrac);

View file

@ -103,7 +103,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_orig& w, pl
return arc;
}
FSerializer& Serialize(FSerializer& arc, const char* keyname, DukePlayer& w, DukePlayer* def)
FSerializer& Serialize(FSerializer& arc, const char* keyname, DDukePlayer& w, DDukePlayer* def)
{
if (arc.BeginObject(keyname))
{

View file

@ -1126,7 +1126,7 @@ void operatesectors(sectortype* sptr, DDukeActor *actor)
//
//---------------------------------------------------------------------------
void operateactivators(int low, DukePlayer* plr)
void operateactivators(int low, DDukePlayer* plr)
{
int i, j, k;
Cycler * p;

View file

@ -117,7 +117,7 @@ void activatebysector_d(sectortype* sect, DDukeActor* activator)
//
//---------------------------------------------------------------------------
void checkplayerhurt_d(DukePlayer* p, const Collision& coll)
void checkplayerhurt_d(DDukePlayer* p, const Collision& coll)
{
if (coll.type == kHitSprite)
{
@ -158,7 +158,7 @@ void checkplayerhurt_d(DukePlayer* p, const Collision& coll)
//
//---------------------------------------------------------------------------
void clearcameras(DukePlayer* p)
void clearcameras(DDukePlayer* p)
{
p->GetActor()->restorepos();
p->newOwner = nullptr;
@ -181,7 +181,7 @@ void clearcameras(DukePlayer* p)
void checksectors_d(int snum)
{
int i = -1;
DukePlayer* p;
DDukePlayer* p;
walltype* hitscanwall;
HitInfo near;

View file

@ -127,7 +127,7 @@ void activatebysector_r(sectortype* sect, DDukeActor* activator)
//
//---------------------------------------------------------------------------
void checkplayerhurt_r(DukePlayer* p, const Collision &coll)
void checkplayerhurt_r(DDukePlayer* p, const Collision &coll)
{
if (coll.type == kHitSprite)
{
@ -160,7 +160,7 @@ void checkplayerhurt_r(DukePlayer* p, const Collision &coll)
void checksectors_r(int snum)
{
DukePlayer* p;
DDukePlayer* p;
walltype* hitscanwall;
HitInfo near;

View file

@ -224,8 +224,14 @@ struct player_orig
sectortype* os;
};
struct DukePlayer final : public CorePlayer
class DDukePlayer final : public DCorePlayer
{
DECLARE_CLASS(DDukePlayer, DCorePlayer)
HAS_OBJECT_POINTERS
size_t PropagateMark() override;
DDukePlayer() = default;
public:
DDukePlayer(uint8_t p) : DCorePlayer(p) {}
DVector3 vel;
DVector2 bobpos;
DVector2 fric;

View file

@ -33,7 +33,7 @@ void resetswitch(int tag);
//
//---------------------------------------------------------------------------
DukePlayer* duke_getviewplayer()
DDukePlayer* duke_getviewplayer()
{
return getPlayer(screenpeek);
}
@ -44,7 +44,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Duke, getviewplayer, duke_getviewplayer)
ACTION_RETURN_POINTER(duke_getviewplayer());
}
DukePlayer* duke_getlocalplayer()
DDukePlayer* duke_getlocalplayer()
{
return getPlayer(myconnectindex);
}
@ -117,7 +117,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Duke, CheckSoundPlaying, duke_CheckSoundPlaying)
ACTION_RETURN_INT(duke_CheckSoundPlaying(snd));
}
DukePlayer* duke_checkcursectnums(sectortype* sector)
DDukePlayer* duke_checkcursectnums(sectortype* sector)
{
if (!sector) return nullptr;
int pp = checkcursectnums(sector);
@ -196,16 +196,16 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Duke, StopCommentary, StopCommentary)
return 0;
}
int getPlayerIndex(DukePlayer* p)
int getPlayerIndex(DDukePlayer* p)
{
if (!p) return -1;
return int(p - (DukePlayer*)PlayerArray);
return p->pnum;
}
DEFINE_ACTION_FUNCTION_NATIVE(_Duke, getPlayerIndex, getPlayerIndex)
{
PARAM_PROLOGUE;
PARAM_POINTER(p, DukePlayer);
PARAM_POINTER(p, DDukePlayer);
ACTION_RETURN_INT(getPlayerIndex(p));
}
@ -355,7 +355,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, getglobalz, getglobalz)
return 0;
}
DukePlayer* DukeActor_findplayer(DDukeActor* self, double* dist)
DDukePlayer* DukeActor_findplayer(DDukeActor* self, double* dist)
{
double a;
return getPlayer(findplayer(self, dist? dist : &a));
@ -371,7 +371,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, findplayer, DukeActor_findplayer)
return min(numret, 2);
}
DukePlayer* DukeActor_getplayer(DDukeActor* self)
DDukePlayer* DukeActor_getplayer(DDukeActor* self)
{
return self->isPlayer() ? getPlayer(self->PlayerIndex()) : nullptr;
}
@ -713,7 +713,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, restoreloc, DukeActor_restoreloc)
DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, fakebubbaspawn, fakebubbaspawn)
{
PARAM_SELF_PROLOGUE(DDukeActor);
PARAM_POINTER(p, DukePlayer);
PARAM_POINTER(p, DDukePlayer);
fakebubbaspawn(self, p);
return 0;
}
@ -790,7 +790,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, SetAI, Duke_SetAI)
DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, checkp, checkp)
{
PARAM_SELF_PROLOGUE(DDukeActor);
PARAM_POINTER(p, DukePlayer);
PARAM_POINTER(p, DDukePlayer);
PARAM_INT(n);
ACTION_RETURN_INT(checkp(self, p, n));
}
@ -798,7 +798,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, checkp, checkp)
DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, cansee, ifcansee)
{
PARAM_SELF_PROLOGUE(DDukeActor);
PARAM_POINTER(p, DukePlayer);
PARAM_POINTER(p, DDukePlayer);
PARAM_INT(n);
ACTION_RETURN_INT(ifcansee(self, p));
}
@ -813,7 +813,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, actoroperate, actoroperate)
DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, ifsquished, ifsquished)
{
PARAM_SELF_PROLOGUE(DDukeActor);
PARAM_POINTER(p, DukePlayer);
PARAM_POINTER(p, DDukePlayer);
ACTION_RETURN_INT(ifcansee(self, p));
}
@ -830,7 +830,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, ChangeType, Duke_ChangeType)
return 0;
}
void Duke_fall(DDukeActor* self, DukePlayer* p)
void Duke_fall(DDukeActor* self, DDukePlayer* p)
{
fall(self, p->GetPlayerNum());
}
@ -838,7 +838,7 @@ void Duke_fall(DDukeActor* self, DukePlayer* p)
DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, fall, Duke_fall)
{
PARAM_SELF_PROLOGUE(DDukeActor);
PARAM_POINTER(p, DukePlayer);
PARAM_POINTER(p, DDukePlayer);
Duke_fall(self, p);
return 0;
}
@ -858,14 +858,14 @@ DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, dodge, dodge)
ACTION_RETURN_INT(dodge(self));
}
int Duke_ifcanshoottarget(DDukeActor* self, DukePlayer* p, double dist)
int Duke_ifcanshoottarget(DDukeActor* self, DDukePlayer* p, double dist)
{
return ifcanshoottarget(self, p->GetPlayerNum(), int(dist * worldtoint));
}
DEFINE_ACTION_FUNCTION_NATIVE(DDukeActor, ifcanshoottarget, Duke_ifcanshoottarget)
{
PARAM_SELF_PROLOGUE(DDukeActor);
PARAM_POINTER(p, DukePlayer);
PARAM_POINTER(p, DDukePlayer);
PARAM_FLOAT(x);
ACTION_RETURN_INT(Duke_ifcanshoottarget(self, p, x));
}
@ -972,208 +972,208 @@ DEFINE_ACTION_FUNCTION(DDukeActor, killit)
//
//---------------------------------------------------------------------------
DEFINE_FIELD_X(DukePlayer, DukePlayer, gotweapon)
DEFINE_FIELD_X(DukePlayer, DukePlayer, pals)
DEFINE_FIELD_X(DukePlayer, DukePlayer, weapon_sway)
DEFINE_FIELD_X(DukePlayer, DukePlayer, oweapon_sway)
DEFINE_FIELD_X(DukePlayer, DukePlayer, weapon_pos)
DEFINE_FIELD_X(DukePlayer, DukePlayer, kickback_pic)
DEFINE_FIELD_X(DukePlayer, DukePlayer, random_club_frame)
DEFINE_FIELD_X(DukePlayer, DukePlayer, oweapon_pos)
DEFINE_FIELD_X(DukePlayer, DukePlayer, okickback_pic)
DEFINE_FIELD_X(DukePlayer, DukePlayer, orandom_club_frame)
DEFINE_FIELD_X(DukePlayer, DukePlayer, hard_landing)
DEFINE_FIELD_X(DukePlayer, DukePlayer, ohard_landing)
DEFINE_FIELD_X(DukePlayer, DukePlayer, psectlotag)
//DEFINE_FIELD_X(DukePlayer, player_struct, exitx)
//DEFINE_FIELD_X(DukePlayer, player_struct, exity)
DEFINE_FIELD_UNSIZED(DukePlayer, DukePlayer, loogie)
DEFINE_FIELD_X(DukePlayer, DukePlayer, numloogs)
DEFINE_FIELD_X(DukePlayer, DukePlayer, loogcnt)
DEFINE_FIELD_X(DukePlayer, DukePlayer, invdisptime)
//DEFINE_FIELD_X(DukePlayer, player_struct, bobposx)
//DEFINE_FIELD_X(DukePlayer, player_struct, bobposy)
DEFINE_FIELD_X(DukePlayer, DukePlayer, pyoff)
DEFINE_FIELD_X(DukePlayer, DukePlayer, opyoff)
DEFINE_FIELD_X(DukePlayer, DukePlayer, vel)
DEFINE_FIELD_X(DukePlayer, DukePlayer, last_pissed_time)
DEFINE_FIELD_X(DukePlayer, DukePlayer, truefz)
DEFINE_FIELD_X(DukePlayer, DukePlayer, truecz)
DEFINE_FIELD_X(DukePlayer, DukePlayer, player_par)
DEFINE_FIELD_X(DukePlayer, DukePlayer, visibility)
DEFINE_FIELD_X(DukePlayer, DukePlayer, bobcounter)
DEFINE_FIELD_X(DukePlayer, DukePlayer, randomflamex)
DEFINE_FIELD_X(DukePlayer, DukePlayer, crack_time)
DEFINE_FIELD_X(DukePlayer, DukePlayer, aim_mode)
DEFINE_FIELD_X(DukePlayer, DukePlayer, ftt)
DEFINE_FIELD_X(DukePlayer, DukePlayer, cursector)
DEFINE_FIELD_X(DukePlayer, DukePlayer, last_extra)
DEFINE_FIELD_X(DukePlayer, DukePlayer, subweapon)
DEFINE_FIELD_X(DukePlayer, DukePlayer, ammo_amount)
DEFINE_FIELD_X(DukePlayer, DukePlayer, frag)
DEFINE_FIELD_X(DukePlayer, DukePlayer, fraggedself)
DEFINE_FIELD_X(DukePlayer, DukePlayer, curr_weapon)
DEFINE_FIELD_X(DukePlayer, DukePlayer, last_weapon)
DEFINE_FIELD_X(DukePlayer, DukePlayer, tipincs)
DEFINE_FIELD_X(DukePlayer, DukePlayer, wantweaponfire)
DEFINE_FIELD_X(DukePlayer, DukePlayer, holoduke_amount)
DEFINE_FIELD_X(DukePlayer, DukePlayer, hurt_delay)
DEFINE_FIELD_X(DukePlayer, DukePlayer, hbomb_hold_delay)
DEFINE_FIELD_X(DukePlayer, DukePlayer, jumping_counter)
DEFINE_FIELD_X(DukePlayer, DukePlayer, airleft)
DEFINE_FIELD_X(DukePlayer, DukePlayer, knee_incs)
DEFINE_FIELD_X(DukePlayer, DukePlayer, access_incs)
DEFINE_FIELD_X(DukePlayer, DukePlayer, ftq)
DEFINE_FIELD_X(DukePlayer, DukePlayer, access_wall)
DEFINE_FIELD_X(DukePlayer, DukePlayer, got_access)
DEFINE_FIELD_X(DukePlayer, DukePlayer, weapon_ang)
DEFINE_FIELD_X(DukePlayer, DukePlayer, firstaid_amount)
DEFINE_FIELD_X(DukePlayer, DukePlayer, actor)
DEFINE_FIELD_X(DukePlayer, DukePlayer, one_parallax_sectnum)
DEFINE_FIELD_X(DukePlayer, DukePlayer, over_shoulder_on)
DEFINE_FIELD_X(DukePlayer, DukePlayer, fist_incs)
DEFINE_FIELD_X(DukePlayer, DukePlayer, cheat_phase)
DEFINE_FIELD_X(DukePlayer, DukePlayer, extra_extra8)
DEFINE_FIELD_X(DukePlayer, DukePlayer, quick_kick)
DEFINE_FIELD_X(DukePlayer, DukePlayer, last_quick_kick)
DEFINE_FIELD_X(DukePlayer, DukePlayer, heat_amount)
DEFINE_FIELD_X(DukePlayer, DukePlayer, timebeforeexit)
DEFINE_FIELD_X(DukePlayer, DukePlayer, customexitsound)
DEFINE_FIELD_X(DukePlayer, DukePlayer, interface_toggle_flag)
DEFINE_FIELD_X(DukePlayer, DukePlayer, dead_flag)
DEFINE_FIELD_X(DukePlayer, DukePlayer, show_empty_weapon)
DEFINE_FIELD_X(DukePlayer, DukePlayer, scuba_amount)
DEFINE_FIELD_X(DukePlayer, DukePlayer, jetpack_amount)
DEFINE_FIELD_X(DukePlayer, DukePlayer, steroids_amount)
DEFINE_FIELD_X(DukePlayer, DukePlayer, shield_amount)
DEFINE_FIELD_X(DukePlayer, DukePlayer, pycount)
DEFINE_FIELD_X(DukePlayer, DukePlayer, frag_ps)
DEFINE_FIELD_X(DukePlayer, DukePlayer, transporter_hold)
DEFINE_FIELD_X(DukePlayer, DukePlayer, last_full_weapon)
DEFINE_FIELD_X(DukePlayer, DukePlayer, footprintshade)
DEFINE_FIELD_X(DukePlayer, DukePlayer, boot_amount)
DEFINE_FIELD_X(DukePlayer, DukePlayer, on_warping_sector)
DEFINE_FIELD_X(DukePlayer, DukePlayer, footprintcount)
DEFINE_FIELD_X(DukePlayer, DukePlayer, hbomb_on)
DEFINE_FIELD_X(DukePlayer, DukePlayer, jumping_toggle)
DEFINE_FIELD_X(DukePlayer, DukePlayer, rapid_fire_hold)
DEFINE_FIELD_X(DukePlayer, DukePlayer, on_ground)
DEFINE_FIELD_X(DukePlayer, DukePlayer, inven_icon)
DEFINE_FIELD_X(DukePlayer, DukePlayer, buttonpalette)
DEFINE_FIELD_X(DukePlayer, DukePlayer, jetpack_on)
DEFINE_FIELD_X(DukePlayer, DukePlayer, spritebridge)
DEFINE_FIELD_X(DukePlayer, DukePlayer, lastrandomspot)
DEFINE_FIELD_X(DukePlayer, DukePlayer, scuba_on)
DEFINE_FIELD_X(DukePlayer, DukePlayer, footprintpal)
DEFINE_FIELD_X(DukePlayer, DukePlayer, heat_on)
DEFINE_FIELD_X(DukePlayer, DukePlayer, holster_weapon)
DEFINE_FIELD_X(DukePlayer, DukePlayer, falling_counter)
DEFINE_FIELD_X(DukePlayer, DukePlayer, refresh_inventory)
DEFINE_FIELD_X(DukePlayer, DukePlayer, toggle_key_flag)
DEFINE_FIELD_X(DukePlayer, DukePlayer, knuckle_incs)
DEFINE_FIELD_X(DukePlayer, DukePlayer, walking_snd_toggle)
DEFINE_FIELD_X(DukePlayer, DukePlayer, palookup)
DEFINE_FIELD_X(DukePlayer, DukePlayer, quick_kick_msg)
DEFINE_FIELD_X(DukePlayer, DukePlayer, stairs)
DEFINE_FIELD_X(DukePlayer, DukePlayer, detonate_count)
//DEFINE_FIELD_X(DukePlayer, player_struct, noise.X)
//DEFINE_FIELD_X(DukePlayer, player_struct, noise.Y)
DEFINE_FIELD_X(DukePlayer, DukePlayer, noise_radius)
DEFINE_FIELD_X(DukePlayer, DukePlayer, drink_timer)
DEFINE_FIELD_X(DukePlayer, DukePlayer, eat_timer)
DEFINE_FIELD_X(DukePlayer, DukePlayer, SlotWin)
DEFINE_FIELD_X(DukePlayer, DukePlayer, recoil)
DEFINE_FIELD_X(DukePlayer, DukePlayer, detonate_time)
DEFINE_FIELD_X(DukePlayer, DukePlayer, yehaa_timer)
DEFINE_FIELD_X(DukePlayer, DukePlayer, drink_amt)
DEFINE_FIELD_X(DukePlayer, DukePlayer, eat)
DEFINE_FIELD_X(DukePlayer, DukePlayer, drunkang)
DEFINE_FIELD_X(DukePlayer, DukePlayer, eatang)
DEFINE_FIELD_X(DukePlayer, DukePlayer, shotgun_state)
DEFINE_FIELD_X(DukePlayer, DukePlayer, donoise)
DEFINE_FIELD_X(DukePlayer, DukePlayer, keys)
DEFINE_FIELD_X(DukePlayer, DukePlayer, drug_aspect)
DEFINE_FIELD_X(DukePlayer, DukePlayer, drug_timer)
DEFINE_FIELD_X(DukePlayer, DukePlayer, SeaSick)
DEFINE_FIELD_X(DukePlayer, DukePlayer, MamaEnd)
DEFINE_FIELD_X(DukePlayer, DukePlayer, moto_drink)
DEFINE_FIELD_X(DukePlayer, DukePlayer, TiltStatus)
DEFINE_FIELD_X(DukePlayer, DukePlayer, oTiltStatus)
DEFINE_FIELD_X(DukePlayer, DukePlayer, VBumpNow)
DEFINE_FIELD_X(DukePlayer, DukePlayer, VBumpTarget)
DEFINE_FIELD_X(DukePlayer, DukePlayer, TurbCount)
DEFINE_FIELD_X(DukePlayer, DukePlayer, drug_stat)
DEFINE_FIELD_X(DukePlayer, DukePlayer, DrugMode)
DEFINE_FIELD_X(DukePlayer, DukePlayer, lotag800kill)
DEFINE_FIELD_X(DukePlayer, DukePlayer, sea_sick_stat)
DEFINE_FIELD_X(DukePlayer, DukePlayer, hurt_delay2)
DEFINE_FIELD_X(DukePlayer, DukePlayer, nocheat)
DEFINE_FIELD_X(DukePlayer, DukePlayer, OnMotorcycle)
DEFINE_FIELD_X(DukePlayer, DukePlayer, OnBoat)
DEFINE_FIELD_X(DukePlayer, DukePlayer, moto_underwater)
DEFINE_FIELD_X(DukePlayer, DukePlayer, NotOnWater)
DEFINE_FIELD_X(DukePlayer, DukePlayer, MotoOnGround)
DEFINE_FIELD_X(DukePlayer, DukePlayer, moto_do_bump)
DEFINE_FIELD_X(DukePlayer, DukePlayer, moto_bump_fast)
DEFINE_FIELD_X(DukePlayer, DukePlayer, moto_on_oil)
DEFINE_FIELD_X(DukePlayer, DukePlayer, moto_on_mud)
DEFINE_FIELD_X(DukePlayer, DukePlayer, MotoSpeed)
DEFINE_FIELD_X(DukePlayer, DukePlayer, holoduke_on)
DEFINE_FIELD_X(DukePlayer, DukePlayer, actorsqu)
DEFINE_FIELD_X(DukePlayer, DukePlayer, wackedbyactor)
DEFINE_FIELD_X(DukePlayer, DukePlayer, on_crane)
DEFINE_FIELD_X(DukePlayer, DukePlayer, somethingonplayer)
DEFINE_FIELD_X(DukePlayer, DukePlayer, access_spritenum)
DEFINE_FIELD_X(DukePlayer, DukePlayer, dummyplayersprite)
DEFINE_FIELD_X(DukePlayer, DukePlayer, newOwner)
DEFINE_FIELD_X(DukePlayer, DukePlayer, fric)
DEFINE_FIELD(DDukePlayer, actor)
DEFINE_FIELD(DDukePlayer, gotweapon)
DEFINE_FIELD(DDukePlayer, pals)
DEFINE_FIELD(DDukePlayer, weapon_sway)
DEFINE_FIELD(DDukePlayer, oweapon_sway)
DEFINE_FIELD(DDukePlayer, weapon_pos)
DEFINE_FIELD(DDukePlayer, kickback_pic)
DEFINE_FIELD(DDukePlayer, random_club_frame)
DEFINE_FIELD(DDukePlayer, oweapon_pos)
DEFINE_FIELD(DDukePlayer, okickback_pic)
DEFINE_FIELD(DDukePlayer, orandom_club_frame)
DEFINE_FIELD(DDukePlayer, hard_landing)
DEFINE_FIELD(DDukePlayer, ohard_landing)
DEFINE_FIELD(DDukePlayer, psectlotag)
DEFINE_FIELD(DDukePlayer, loogie)
DEFINE_FIELD(DDukePlayer, numloogs)
DEFINE_FIELD(DDukePlayer, loogcnt)
DEFINE_FIELD(DDukePlayer, invdisptime)
//DEFINE_FIELD(DukePlayer, exitx)
//DEFINE_FIELD(DukePlayer, exity)
//DEFINE_FIELD(DukePlayer, bobposx)
//DEFINE_FIELD(DukePlayer, bobposy)
DEFINE_FIELD(DDukePlayer, pyoff)
DEFINE_FIELD(DDukePlayer, opyoff)
DEFINE_FIELD(DDukePlayer, vel)
DEFINE_FIELD(DDukePlayer, last_pissed_time)
DEFINE_FIELD(DDukePlayer, truefz)
DEFINE_FIELD(DDukePlayer, truecz)
DEFINE_FIELD(DDukePlayer, player_par)
DEFINE_FIELD(DDukePlayer, visibility)
DEFINE_FIELD(DDukePlayer, bobcounter)
DEFINE_FIELD(DDukePlayer, randomflamex)
DEFINE_FIELD(DDukePlayer, crack_time)
DEFINE_FIELD(DDukePlayer, aim_mode)
DEFINE_FIELD(DDukePlayer, ftt)
DEFINE_FIELD(DDukePlayer, cursector)
DEFINE_FIELD(DDukePlayer, last_extra)
DEFINE_FIELD(DDukePlayer, subweapon)
DEFINE_FIELD(DDukePlayer, ammo_amount)
DEFINE_FIELD(DDukePlayer, frag)
DEFINE_FIELD(DDukePlayer, fraggedself)
DEFINE_FIELD(DDukePlayer, curr_weapon)
DEFINE_FIELD(DDukePlayer, last_weapon)
DEFINE_FIELD(DDukePlayer, tipincs)
DEFINE_FIELD(DDukePlayer, wantweaponfire)
DEFINE_FIELD(DDukePlayer, holoduke_amount)
DEFINE_FIELD(DDukePlayer, hurt_delay)
DEFINE_FIELD(DDukePlayer, hbomb_hold_delay)
DEFINE_FIELD(DDukePlayer, jumping_counter)
DEFINE_FIELD(DDukePlayer, airleft)
DEFINE_FIELD(DDukePlayer, knee_incs)
DEFINE_FIELD(DDukePlayer, access_incs)
DEFINE_FIELD(DDukePlayer, ftq)
DEFINE_FIELD(DDukePlayer, access_wall)
DEFINE_FIELD(DDukePlayer, got_access)
DEFINE_FIELD(DDukePlayer, weapon_ang)
DEFINE_FIELD(DDukePlayer, firstaid_amount)
DEFINE_FIELD(DDukePlayer, one_parallax_sectnum)
DEFINE_FIELD(DDukePlayer, over_shoulder_on)
DEFINE_FIELD(DDukePlayer, fist_incs)
DEFINE_FIELD(DDukePlayer, cheat_phase)
DEFINE_FIELD(DDukePlayer, extra_extra8)
DEFINE_FIELD(DDukePlayer, quick_kick)
DEFINE_FIELD(DDukePlayer, last_quick_kick)
DEFINE_FIELD(DDukePlayer, heat_amount)
DEFINE_FIELD(DDukePlayer, timebeforeexit)
DEFINE_FIELD(DDukePlayer, customexitsound)
DEFINE_FIELD(DDukePlayer, interface_toggle_flag)
DEFINE_FIELD(DDukePlayer, dead_flag)
DEFINE_FIELD(DDukePlayer, show_empty_weapon)
DEFINE_FIELD(DDukePlayer, scuba_amount)
DEFINE_FIELD(DDukePlayer, jetpack_amount)
DEFINE_FIELD(DDukePlayer, steroids_amount)
DEFINE_FIELD(DDukePlayer, shield_amount)
DEFINE_FIELD(DDukePlayer, pycount)
DEFINE_FIELD(DDukePlayer, frag_ps)
DEFINE_FIELD(DDukePlayer, transporter_hold)
DEFINE_FIELD(DDukePlayer, last_full_weapon)
DEFINE_FIELD(DDukePlayer, footprintshade)
DEFINE_FIELD(DDukePlayer, boot_amount)
DEFINE_FIELD(DDukePlayer, on_warping_sector)
DEFINE_FIELD(DDukePlayer, footprintcount)
DEFINE_FIELD(DDukePlayer, hbomb_on)
DEFINE_FIELD(DDukePlayer, jumping_toggle)
DEFINE_FIELD(DDukePlayer, rapid_fire_hold)
DEFINE_FIELD(DDukePlayer, on_ground)
DEFINE_FIELD(DDukePlayer, inven_icon)
DEFINE_FIELD(DDukePlayer, buttonpalette)
DEFINE_FIELD(DDukePlayer, jetpack_on)
DEFINE_FIELD(DDukePlayer, spritebridge)
DEFINE_FIELD(DDukePlayer, lastrandomspot)
DEFINE_FIELD(DDukePlayer, scuba_on)
DEFINE_FIELD(DDukePlayer, footprintpal)
DEFINE_FIELD(DDukePlayer, heat_on)
DEFINE_FIELD(DDukePlayer, holster_weapon)
DEFINE_FIELD(DDukePlayer, falling_counter)
DEFINE_FIELD(DDukePlayer, refresh_inventory)
DEFINE_FIELD(DDukePlayer, toggle_key_flag)
DEFINE_FIELD(DDukePlayer, knuckle_incs)
DEFINE_FIELD(DDukePlayer, walking_snd_toggle)
DEFINE_FIELD(DDukePlayer, palookup)
DEFINE_FIELD(DDukePlayer, quick_kick_msg)
DEFINE_FIELD(DDukePlayer, stairs)
DEFINE_FIELD(DDukePlayer, detonate_count)
//DEFINE_FIELD(DukePlayer, noise.X)
//DEFINE_FIELD(DukePlayer, noise.Y)
DEFINE_FIELD(DDukePlayer, noise_radius)
DEFINE_FIELD(DDukePlayer, drink_timer)
DEFINE_FIELD(DDukePlayer, eat_timer)
DEFINE_FIELD(DDukePlayer, SlotWin)
DEFINE_FIELD(DDukePlayer, recoil)
DEFINE_FIELD(DDukePlayer, detonate_time)
DEFINE_FIELD(DDukePlayer, yehaa_timer)
DEFINE_FIELD(DDukePlayer, drink_amt)
DEFINE_FIELD(DDukePlayer, eat)
DEFINE_FIELD(DDukePlayer, drunkang)
DEFINE_FIELD(DDukePlayer, eatang)
DEFINE_FIELD(DDukePlayer, shotgun_state)
DEFINE_FIELD(DDukePlayer, donoise)
DEFINE_FIELD(DDukePlayer, keys)
DEFINE_FIELD(DDukePlayer, drug_aspect)
DEFINE_FIELD(DDukePlayer, drug_timer)
DEFINE_FIELD(DDukePlayer, SeaSick)
DEFINE_FIELD(DDukePlayer, MamaEnd)
DEFINE_FIELD(DDukePlayer, moto_drink)
DEFINE_FIELD(DDukePlayer, TiltStatus)
DEFINE_FIELD(DDukePlayer, oTiltStatus)
DEFINE_FIELD(DDukePlayer, VBumpNow)
DEFINE_FIELD(DDukePlayer, VBumpTarget)
DEFINE_FIELD(DDukePlayer, TurbCount)
DEFINE_FIELD(DDukePlayer, drug_stat)
DEFINE_FIELD(DDukePlayer, DrugMode)
DEFINE_FIELD(DDukePlayer, lotag800kill)
DEFINE_FIELD(DDukePlayer, sea_sick_stat)
DEFINE_FIELD(DDukePlayer, hurt_delay2)
DEFINE_FIELD(DDukePlayer, nocheat)
DEFINE_FIELD(DDukePlayer, OnMotorcycle)
DEFINE_FIELD(DDukePlayer, OnBoat)
DEFINE_FIELD(DDukePlayer, moto_underwater)
DEFINE_FIELD(DDukePlayer, NotOnWater)
DEFINE_FIELD(DDukePlayer, MotoOnGround)
DEFINE_FIELD(DDukePlayer, moto_do_bump)
DEFINE_FIELD(DDukePlayer, moto_bump_fast)
DEFINE_FIELD(DDukePlayer, moto_on_oil)
DEFINE_FIELD(DDukePlayer, moto_on_mud)
DEFINE_FIELD(DDukePlayer, MotoSpeed)
DEFINE_FIELD(DDukePlayer, holoduke_on)
DEFINE_FIELD(DDukePlayer, actorsqu)
DEFINE_FIELD(DDukePlayer, wackedbyactor)
DEFINE_FIELD(DDukePlayer, on_crane)
DEFINE_FIELD(DDukePlayer, somethingonplayer)
DEFINE_FIELD(DDukePlayer, access_spritenum)
DEFINE_FIELD(DDukePlayer, dummyplayersprite)
DEFINE_FIELD(DDukePlayer, newOwner)
DEFINE_FIELD(DDukePlayer, fric)
DEFINE_ACTION_FUNCTION(_DukePlayer, IsFrozen)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
ACTION_RETURN_BOOL(self->GetActor()->spr.pal == 1 && self->last_extra < 2);
}
DEFINE_ACTION_FUNCTION(_DukePlayer, GetGameVar)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_STRING(name);
PARAM_INT(def);
ACTION_RETURN_INT(GetGameVar(name, def, self->GetActor(), self->GetPlayerNum()).safeValue());
}
void dukeplayer_backuppos(DukePlayer* self)
void dukeplayer_backuppos(DDukePlayer* self)
{
self->backuppos();
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, backuppos, dukeplayer_backuppos)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
dukeplayer_backuppos(self);
return 0;
}
void dukeplayer_backupxyz(DukePlayer* self)
void dukeplayer_backupxyz(DDukePlayer* self)
{
self->GetActor()->backuppos();
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, backupxyz, dukeplayer_backupxyz)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
dukeplayer_backupxyz(self);
return 0;
}
void dukeplayer_setpos(DukePlayer* self, double x, double y, double z)
void dukeplayer_setpos(DDukePlayer* self, double x, double y, double z)
{
self->GetActor()->spr.pos = { x, y, z + self->GetActor()->viewzoffset };
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, setpos, dukeplayer_setpos)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_FLOAT(x);
PARAM_FLOAT(y);
PARAM_FLOAT(z);
@ -1181,14 +1181,14 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, setpos, dukeplayer_setpos)
return 0;
}
void dukeplayer_addpos(DukePlayer* self, double x, double y, double z)
void dukeplayer_addpos(DDukePlayer* self, double x, double y, double z)
{
self->GetActor()->spr.pos += { x, y, z };
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, addpos, dukeplayer_addpos)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_FLOAT(x);
PARAM_FLOAT(y);
PARAM_FLOAT(z);
@ -1196,31 +1196,31 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, addpos, dukeplayer_addpos)
return 0;
}
void dukeplayer_centerview(DukePlayer* self)
void dukeplayer_centerview(DDukePlayer* self)
{
self->cmd.ucmd.actions |= SB_CENTERVIEW;
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, centerview, dukeplayer_centerview)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
self->cmd.ucmd.actions |= SB_CENTERVIEW;
return 0;
}
inline int DukePlayer_PlayerInput(DukePlayer* pl, int bit)
inline int DukePlayer_PlayerInput(DDukePlayer* pl, int bit)
{
return (!!((pl->cmd.ucmd.actions) & ESyncBits::FromInt(bit)));
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, playerinput, DukePlayer_PlayerInput)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_INT(bit);
ACTION_RETURN_INT(DukePlayer_PlayerInput(self, bit));
}
void dukeplayer_settargetangle(DukePlayer* self, double a, int backup)
void dukeplayer_settargetangle(DDukePlayer* self, double a, int backup)
{
self->GetActor()->spr.Angles.Yaw = DAngle::fromDeg(a);
if (backup) self->GetActor()->PrevAngles.Yaw = self->GetActor()->spr.Angles.Yaw;
@ -1228,32 +1228,32 @@ void dukeplayer_settargetangle(DukePlayer* self, double a, int backup)
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, settargetangle, dukeplayer_settargetangle)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_FLOAT(a);
PARAM_BOOL(bak);
dukeplayer_settargetangle(self, a, bak);
return 0;
}
double dukeplayer_angle(DukePlayer* self)
double dukeplayer_angle(DDukePlayer* self)
{
return self->GetActor()->spr.Angles.Yaw.Degrees();
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, angle, dukeplayer_angle)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
ACTION_RETURN_FLOAT(dukeplayer_angle(self));
}
void dukeplayer_addpitch(DukePlayer* self, double a)
void dukeplayer_addpitch(DDukePlayer* self, double a)
{
self->GetActor()->spr.Angles.Pitch += DAngle::fromDeg(a);
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, addpitch, dukeplayer_addpitch)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_FLOAT(a);
dukeplayer_addpitch(self, a);
return 0;
@ -1261,27 +1261,27 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, addpitch, dukeplayer_addpitch)
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, clearcameras, clearcameras)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
clearcameras(self);
return 0;
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, quickkill, quickkill)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
quickkill(self);
return 0;
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, CheckWeapRec, CheckWeapRec)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_POINTER(ac, DDukeActor);
PARAM_BOOL(test);
ACTION_RETURN_INT(CheckWeapRec(self, ac, test));
}
void DukePlayer_addammo(DukePlayer* p, int ammo, int amount)
void DukePlayer_addammo(DDukePlayer* p, int ammo, int amount)
{
if ((unsigned)ammo >= MAX_WEAPONS) ThrowAbortException(X_ARRAY_OUT_OF_BOUNDS, "Ammo number out of range");
addammo(ammo, p, amount);
@ -1289,14 +1289,14 @@ void DukePlayer_addammo(DukePlayer* p, int ammo, int amount)
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, addammo, DukePlayer_addammo)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_INT(type);
PARAM_INT(amount);
DukePlayer_addammo(self, type, amount);
return 0;
}
void DukePlayer_addweapon(DukePlayer* p, int wpn, int switchit)
void DukePlayer_addweapon(DDukePlayer* p, int wpn, int switchit)
{
if ((unsigned)wpn >= MAX_WEAPONS) ThrowAbortException(X_ARRAY_OUT_OF_BOUNDS, "Weapon number out of range");
fi.addweapon(p, wpn, switchit);
@ -1304,7 +1304,7 @@ void DukePlayer_addweapon(DukePlayer* p, int wpn, int switchit)
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, addweapon, DukePlayer_addweapon)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_INT(type);
PARAM_INT(switchit);
DukePlayer_addweapon(self, type, switchit);
@ -1314,57 +1314,57 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, addweapon, DukePlayer_addweapon)
DEFINE_ACTION_FUNCTION(_DukePlayer, hitablockingwall)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
walltype* pwal;
hitawall(self, &pwal);
ACTION_RETURN_BOOL(pwal && pwal->overtexture.isValid());
}
inline double DukePlayer_GetPitchwithView(DukePlayer* pl)
inline double DukePlayer_GetPitchwithView(DDukePlayer* pl)
{
return pl->Angles.getPitchWithView().Degrees();
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, GetPitchwithView, DukePlayer_GetPitchwithView)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
ACTION_RETURN_FLOAT(DukePlayer_GetPitchwithView(self));
}
inline void DukePlayer_setbobpos(DukePlayer* pl)
inline void DukePlayer_setbobpos(DDukePlayer* pl)
{
return pl->setbobpos();
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, setbobpos, DukePlayer_setbobpos)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
self->setbobpos();
return 0;
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, StartMotorcycle, OnMotorcycle)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
OnMotorcycle(self);
return 0;
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, StartBoat, OnBoat)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
OnBoat(self);
return 0;
}
void pl_checkhitswitch(DukePlayer* p, walltype* wal, DDukeActor* act)
void pl_checkhitswitch(DDukePlayer* p, walltype* wal, DDukeActor* act)
{
checkhitswitch(p->GetPlayerNum(), wal, act);
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, checkhitswitch, pl_checkhitswitch)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_POINTER(wal, walltype);
PARAM_POINTER(act, DDukeActor);
pl_checkhitswitch(self, wal, act);
@ -1373,7 +1373,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, checkhitswitch, pl_checkhitswitch)
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, playerkick, playerkick)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_POINTER(act, DDukeActor);
playerkick(self, act);
return 0;
@ -1381,7 +1381,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, playerkick, playerkick)
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, playerstomp, playerstomp)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_POINTER(act, DDukeActor);
playerstomp(self, act);
return 0;
@ -1389,7 +1389,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, playerstomp, playerstomp)
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, playerreset, playerreset)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_POINTER(act, DDukeActor);
playerreset(self, act);
return 0;
@ -1397,7 +1397,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, playerreset, playerreset)
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, addphealth, addphealth)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_INT(amt);
PARAM_INT(big);
addphealth(self, amt, big);
@ -1406,30 +1406,30 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, addphealth, addphealth)
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, wackplayer, wackplayer)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
wackplayer(self);
return 0;
}
static void duke_checkweapons(DukePlayer* p)
static void duke_checkweapons(DDukePlayer* p)
{
fi.checkweapons(p);
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, checkweapons, duke_checkweapons)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
duke_checkweapons(self);
return 0;
}
static void msg(DukePlayer* p, int num)
static void msg(DDukePlayer* p, int num)
{
FTA(num, p);
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, FTA, msg)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_INT(num);
FTA(num, self);
return 0;
@ -1437,7 +1437,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, FTA, msg)
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, playercheckinventory, playercheckinventory)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_POINTER(act, DDukeActor);
PARAM_INT(num);
PARAM_INT(amt);
@ -1446,7 +1446,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, playercheckinventory, playercheckinve
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, playeraddinventory, playeraddinventory)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_POINTER(act, DDukeActor);
PARAM_INT(num);
PARAM_INT(amt);
@ -1456,7 +1456,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, playeraddinventory, playeraddinventor
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, playeraddweapon, playeraddweapon)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_INT(num);
PARAM_INT(amt);
ACTION_RETURN_BOOL(playeraddweapon(self, num, amt));
@ -1464,7 +1464,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, playeraddweapon, playeraddweapon)
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, playeraddammo, playeraddammo)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_INT(num);
PARAM_INT(amt);
ACTION_RETURN_BOOL(playeraddammo(self, num, amt));
@ -1472,14 +1472,14 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, playeraddammo, playeraddammo)
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, forceplayerangle, forceplayerangle)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
forceplayerangle(self);
return 0;
}
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, playereat, playereat)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_INT(amt);
PARAM_BOOL(big);
ACTION_RETURN_BOOL(playereat(self, amt, big));
@ -1487,7 +1487,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, playereat, playereat)
DEFINE_ACTION_FUNCTION_NATIVE(_DukePlayer, playerdrink, playerdrink)
{
PARAM_SELF_STRUCT_PROLOGUE(DukePlayer);
PARAM_SELF_STRUCT_PROLOGUE(DDukePlayer);
PARAM_INT(amt);
playerdrink(self, amt);
return 0;
@ -1609,7 +1609,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukeLevel, operateactivators, operateactivators)
{
PARAM_PROLOGUE;
PARAM_INT(lotag);
PARAM_POINTER(p, DukePlayer);
PARAM_POINTER(p, DDukePlayer);
operateactivators(lotag, p);
return 0;
}

View file

@ -138,7 +138,7 @@ void SetNewWeaponIfBetter(int nPlayer, int nWeapon);
void SelectNewWeapon(int nPlayer);
void CheckClip(int nPlayer);
void MoveWeapons(int nPlayer);
void DrawWeapons(ExhumedPlayer* const pPlayer, double interpfrac);
void DrawWeapons(DExhumedPlayer* const pPlayer, double interpfrac);
// items

View file

@ -58,6 +58,14 @@ IMPLEMENT_POINTERS_START(DExhumedActor)
IMPLEMENT_POINTER(pTarget)
IMPLEMENT_POINTERS_END
IMPLEMENT_CLASS(DExhumedPlayer, false, true)
IMPLEMENT_POINTERS_START(DExhumedPlayer)
IMPLEMENT_POINTER(pTarget)
IMPLEMENT_POINTER(pDoppleSprite)
IMPLEMENT_POINTER(pPlayerFloorSprite)
IMPLEMENT_POINTER(pPlayerGrenade)
IMPLEMENT_POINTERS_END
size_t MarkMove();
size_t MarkBullets();
size_t MarkItems();
@ -419,8 +427,8 @@ void GameInterface::app_init()
// Initialise player array.
for (unsigned i = 0; i < MAXPLAYERS; i++)
{
PlayerArray[i] = new ExhumedPlayer;
*getPlayer(i) = {};
PlayerArray[i] = Create<DExhumedPlayer>(i);
GC::WriteBarrier(PlayerArray[i]);
}
GC::AddMarkerFunc(markgcroots);

View file

@ -902,7 +902,7 @@ loc_flag:
//
//---------------------------------------------------------------------------
void DrawWeapons(ExhumedPlayer* const pPlayer, double interpfrac)
void DrawWeapons(DExhumedPlayer* const pPlayer, double interpfrac)
{
const auto pPlayerActor = pPlayer->GetActor();
const int nWeapon = pPlayer->nCurrentWeapon;

View file

@ -83,18 +83,6 @@ int nCurStartSprite;
size_t MarkPlayers()
{
for (int i = 0; i < MAXPLAYERS; i++)
{
auto plr = getPlayer(i);
if (plr)
{
GC::Mark(plr->actor);
GC::Mark(plr->pDoppleSprite);
GC::Mark(plr->pPlayerFloorSprite);
GC::Mark(plr->pPlayerGrenade);
GC::Mark(plr->pTarget);
}
}
GC::MarkArray(nNetStartSprite, MAXPLAYERS);
return 6 * MAXPLAYERS;
}
@ -147,7 +135,7 @@ void InitPlayerKeys(int nPlayer)
void InitPlayerInventory(int nPlayer)
{
const auto pPlayer = getPlayer(nPlayer);
memset(pPlayer, 0, sizeof(ExhumedPlayer));
pPlayer->Clear();
ResetPlayerWeapons(nPlayer);
@ -712,7 +700,7 @@ static DExhumedActor* feebtag(const DVector3& pos, sectortype* pSector, int nMag
//
//---------------------------------------------------------------------------
static void doPickupNotification(ExhumedPlayer* const pPlayer, const int nItem, const int nSound = -1, const int tintRed = 0, const int tintGreen = 16)
static void doPickupNotification(DExhumedPlayer* const pPlayer, const int nItem, const int nSound = -1, const int tintRed = 0, const int tintGreen = 16)
{
if (pPlayer->pnum != nLocalPlayer)
return;
@ -758,7 +746,7 @@ static void doPickupDestroy(DExhumedActor* const pPickupActor, const int nItem)
//
//---------------------------------------------------------------------------
static void doPickupWeapon(ExhumedPlayer* pPlayer, DExhumedActor* pPickupActor, int nItem, int nWeapon, int nAmount, int nSound = kSound72)
static void doPickupWeapon(DExhumedPlayer* pPlayer, DExhumedActor* pPickupActor, int nItem, int nWeapon, int nAmount, int nSound = kSound72)
{
const int weapFlag = 1 << nWeapon;
@ -796,7 +784,7 @@ static void doPickupWeapon(ExhumedPlayer* pPlayer, DExhumedActor* pPickupActor,
//
//---------------------------------------------------------------------------
static void doPickupHealth(ExhumedPlayer* pPlayer, DExhumedActor* pPickupActor, int nItem, const int nAmount, int nSound)
static void doPickupHealth(DExhumedPlayer* pPlayer, DExhumedActor* pPickupActor, int nItem, const int nAmount, int nSound)
{
if (!pPickupActor->spr.hitag || nAmount > 0 && pPlayer->nHealth >= 800)
return;
@ -844,7 +832,7 @@ static void doPickupHealth(ExhumedPlayer* pPlayer, DExhumedActor* pPickupActor,
//
//---------------------------------------------------------------------------
void doPlayerItemPickups(ExhumedPlayer* const pPlayer)
void doPlayerItemPickups(DExhumedPlayer* const pPlayer)
{
const auto pPlayerActor = pPlayer->GetActor();
const auto pPlayerSect = pPlayerActor->sector();
@ -1044,7 +1032,7 @@ void doPlayerItemPickups(ExhumedPlayer* const pPlayer)
//
//---------------------------------------------------------------------------
void updatePlayerTarget(ExhumedPlayer* const pPlayer)
void updatePlayerTarget(DExhumedPlayer* const pPlayer)
{
const auto pPlayerActor = pPlayer->GetActor();
const auto pRa = &Ra[pPlayer->pnum];
@ -1107,7 +1095,7 @@ void updatePlayerTarget(ExhumedPlayer* const pPlayer)
//
//---------------------------------------------------------------------------
static void updatePlayerVelocity(ExhumedPlayer* const pPlayer)
static void updatePlayerVelocity(DExhumedPlayer* const pPlayer)
{
const auto pPlayerActor = pPlayer->GetActor();
@ -1139,7 +1127,7 @@ static void updatePlayerVelocity(ExhumedPlayer* const pPlayer)
//
//---------------------------------------------------------------------------
static void updatePlayerInventory(ExhumedPlayer* const pPlayer)
static void updatePlayerInventory(DExhumedPlayer* const pPlayer)
{
if (const auto invDir = !!(pPlayer->cmd.ucmd.actions & SB_INVNEXT) - !!(pPlayer->cmd.ucmd.actions & SB_INVPREV))
{
@ -1181,7 +1169,7 @@ static void updatePlayerInventory(ExhumedPlayer* const pPlayer)
//
//---------------------------------------------------------------------------
static void updatePlayerWeapon(ExhumedPlayer* const pPlayer)
static void updatePlayerWeapon(DExhumedPlayer* const pPlayer)
{
const bool bIsFiring = pPlayer->cmd.ucmd.actions & SB_FIRE;
@ -1237,7 +1225,7 @@ unsigned GameInterface::getCrouchState()
//
//---------------------------------------------------------------------------
static void updatePlayerAction(ExhumedPlayer* const pPlayer)
static void updatePlayerAction(DExhumedPlayer* const pPlayer)
{
const auto pPlayerActor = pPlayer->GetActor();
const auto pInput = &pPlayer->cmd.ucmd;
@ -1356,7 +1344,7 @@ static void updatePlayerAction(ExhumedPlayer* const pPlayer)
//
//---------------------------------------------------------------------------
static void doPlayerCounters(ExhumedPlayer* const pPlayer)
static void doPlayerCounters(DExhumedPlayer* const pPlayer)
{
const auto pPlayerActor = pPlayer->GetActor();
const bool bConsolePlayer = pPlayer->pnum == nLocalPlayer;
@ -1437,7 +1425,7 @@ static void doPlayerCounters(ExhumedPlayer* const pPlayer)
//
//---------------------------------------------------------------------------
static void doPlayerUnderwater(ExhumedPlayer* const pPlayer, const bool oUnderwater)
static void doPlayerUnderwater(DExhumedPlayer* const pPlayer, const bool oUnderwater)
{
const auto pPlayerActor = pPlayer->GetActor();
const bool bUnderwater = pPlayer->pPlayerViewSect->Flag & kSectUnderwater;
@ -1527,7 +1515,7 @@ static void doPlayerUnderwater(ExhumedPlayer* const pPlayer, const bool oUnderwa
//
//---------------------------------------------------------------------------
static void doPlayerRamses(ExhumedPlayer* const pPlayer)
static void doPlayerRamses(DExhumedPlayer* const pPlayer)
{
setForcedSyncInput(pPlayer->pnum);
@ -1571,7 +1559,7 @@ static void doPlayerGravity(DExhumedActor* const pPlayerActor)
//
//---------------------------------------------------------------------------
static void doPlayerCameraEffects(ExhumedPlayer* const pPlayer, const double nDestVertPan)
static void doPlayerCameraEffects(DExhumedPlayer* const pPlayer, const double nDestVertPan)
{
const auto pPlayerActor = pPlayer->GetActor();
const auto nUnderwater = !!(pPlayerActor->sector()->Flag & kSectUnderwater);
@ -1613,7 +1601,7 @@ static void doPlayerCameraEffects(ExhumedPlayer* const pPlayer, const double nDe
//
//---------------------------------------------------------------------------
static void updatePlayerFloorActor(ExhumedPlayer* const pPlayer)
static void updatePlayerFloorActor(DExhumedPlayer* const pPlayer)
{
DExhumedActor* const pFloorActor = pPlayer->pPlayerFloorSprite;
@ -1635,7 +1623,7 @@ static void updatePlayerFloorActor(ExhumedPlayer* const pPlayer)
//
//---------------------------------------------------------------------------
static void updatePlayerDoppleActor(ExhumedPlayer* const pPlayer)
static void updatePlayerDoppleActor(DExhumedPlayer* const pPlayer)
{
const auto pPlayerActor = pPlayer->GetActor();
const auto pPlayerSect = pPlayerActor->sector();
@ -1660,7 +1648,7 @@ static void updatePlayerDoppleActor(ExhumedPlayer* const pPlayer)
//
//---------------------------------------------------------------------------
static void updatePlayerViewSector(ExhumedPlayer* const pPlayer, const Collision& nMove, const DVector3& spr_vel)
static void updatePlayerViewSector(DExhumedPlayer* const pPlayer, const Collision& nMove, const DVector3& spr_vel)
{
const auto pPlayerActor = pPlayer->GetActor();
const auto pPlayerSect = pPlayerActor->sector();
@ -1699,7 +1687,7 @@ static void updatePlayerViewSector(ExhumedPlayer* const pPlayer, const Collision
//
//---------------------------------------------------------------------------
static void doPlayerFloorDamage(ExhumedPlayer* const pPlayer, const double nStartVelZ)
static void doPlayerFloorDamage(DExhumedPlayer* const pPlayer, const double nStartVelZ)
{
const auto pPlayerActor = pPlayer->GetActor();
pPlayer->nThrust *= 0.5;
@ -1728,7 +1716,7 @@ static void doPlayerFloorDamage(ExhumedPlayer* const pPlayer, const double nStar
//
//---------------------------------------------------------------------------
static void doPlayerMovingBlocks(ExhumedPlayer* const pPlayer, const Collision& nMove, const DVector3& spr_vel, sectortype* const spr_sect)
static void doPlayerMovingBlocks(DExhumedPlayer* const pPlayer, const Collision& nMove, const DVector3& spr_vel, sectortype* const spr_sect)
{
const auto pPlayerActor = pPlayer->GetActor();
sectortype* sect;
@ -1786,7 +1774,7 @@ static void doPlayerMovingBlocks(ExhumedPlayer* const pPlayer, const Collision&
//
//---------------------------------------------------------------------------
static bool doPlayerInput(ExhumedPlayer* const pPlayer)
static bool doPlayerInput(DExhumedPlayer* const pPlayer)
{
// update the player/actor's velocity before anything.
updatePlayerVelocity(pPlayer);
@ -1878,7 +1866,7 @@ static bool doPlayerInput(ExhumedPlayer* const pPlayer)
//
//---------------------------------------------------------------------------
static void doPlayerRunlistSignals(ExhumedPlayer* const pPlayer, sectortype* const pStartSect)
static void doPlayerRunlistSignals(DExhumedPlayer* const pPlayer, sectortype* const pStartSect)
{
const auto pPlayerActor = pPlayer->GetActor();
const auto pPlayerSect = pPlayerActor->sector();
@ -1917,7 +1905,7 @@ static void doPlayerRunlistSignals(ExhumedPlayer* const pPlayer, sectortype* con
//
//---------------------------------------------------------------------------
static bool doPlayerDeathRestart(ExhumedPlayer* const pPlayer)
static bool doPlayerDeathRestart(DExhumedPlayer* const pPlayer)
{
if (!(pPlayer->cmd.ucmd.actions & SB_OPEN) || pPlayer->GetActor()->nAction < 16)
return true;
@ -1963,7 +1951,7 @@ static bool doPlayerDeathRestart(ExhumedPlayer* const pPlayer)
//
//---------------------------------------------------------------------------
static void doPlayerActionSequence(ExhumedPlayer* const pPlayer)
static void doPlayerActionSequence(DExhumedPlayer* const pPlayer)
{
const auto pPlayerActor = pPlayer->GetActor();
@ -2018,7 +2006,7 @@ static void doPlayerActionSequence(ExhumedPlayer* const pPlayer)
//
//---------------------------------------------------------------------------
static void doPlayerDeathPitch(ExhumedPlayer* const pPlayer)
static void doPlayerDeathPitch(DExhumedPlayer* const pPlayer)
{
const auto pPlayerActor = pPlayer->GetActor();
pPlayer->nThrust.Zero();
@ -2107,7 +2095,7 @@ void AIPlayer::Tick(RunListEvent* ev)
//
//---------------------------------------------------------------------------
FSerializer& Serialize(FSerializer& arc, const char* keyname, ExhumedPlayer& w, ExhumedPlayer* def)
FSerializer& Serialize(FSerializer& arc, const char* keyname, DExhumedPlayer& w, DExhumedPlayer* def)
{
if (arc.BeginObject(keyname))
{
@ -2199,29 +2187,29 @@ void SerializePlayer(FSerializer& arc)
//
//---------------------------------------------------------------------------
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, nHealth);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, nLives);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, nDouble);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, nInvisible);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, nTorch);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, actor);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, bIsMummified);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, invincibility);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, nAir);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, nMaskAmount);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, keys);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, nMagic);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, nItem);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, items);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, nAmmo); // TODO - kMaxWeapons?
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, nPlayerWeapons);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, nCurrentWeapon);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, nWeapFrame);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, bIsFiring);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, nNextWeapon);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, nState);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, nLastWeapon);
DEFINE_FIELD_X(ExhumedPlayer, ExhumedPlayer, nRun);
DEFINE_FIELD(DExhumedPlayer, actor)
DEFINE_FIELD(DExhumedPlayer, nHealth);
DEFINE_FIELD(DExhumedPlayer, nLives);
DEFINE_FIELD(DExhumedPlayer, nDouble);
DEFINE_FIELD(DExhumedPlayer, nInvisible);
DEFINE_FIELD(DExhumedPlayer, nTorch);
DEFINE_FIELD(DExhumedPlayer, bIsMummified);
DEFINE_FIELD(DExhumedPlayer, invincibility);
DEFINE_FIELD(DExhumedPlayer, nAir);
DEFINE_FIELD(DExhumedPlayer, nMaskAmount);
DEFINE_FIELD(DExhumedPlayer, keys);
DEFINE_FIELD(DExhumedPlayer, nMagic);
DEFINE_FIELD(DExhumedPlayer, nItem);
DEFINE_FIELD(DExhumedPlayer, items);
DEFINE_FIELD(DExhumedPlayer, nAmmo); // TODO - kMaxWeapons?
DEFINE_FIELD(DExhumedPlayer, nPlayerWeapons);
DEFINE_FIELD(DExhumedPlayer, nCurrentWeapon);
DEFINE_FIELD(DExhumedPlayer, nWeapFrame);
DEFINE_FIELD(DExhumedPlayer, bIsFiring);
DEFINE_FIELD(DExhumedPlayer, nNextWeapon);
DEFINE_FIELD(DExhumedPlayer, nState);
DEFINE_FIELD(DExhumedPlayer, nLastWeapon);
DEFINE_FIELD(DExhumedPlayer, nRun);
DEFINE_ACTION_FUNCTION(_Exhumed, GetViewPlayer)
{
@ -2240,14 +2228,13 @@ DEFINE_ACTION_FUNCTION(_Exhumed, GetPlayerClip)
DEFINE_ACTION_FUNCTION(_ExhumedPlayer, IsUnderwater)
{
PARAM_SELF_STRUCT_PROLOGUE(ExhumedPlayer);
auto nLocalPlayer = self - (ExhumedPlayer*)PlayerArray;
ACTION_RETURN_BOOL(getPlayer((int)nLocalPlayer)->pPlayerViewSect->Flag & kSectUnderwater);
PARAM_SELF_STRUCT_PROLOGUE(DExhumedPlayer);
ACTION_RETURN_BOOL(self->pPlayerViewSect->Flag & kSectUnderwater);
}
DEFINE_ACTION_FUNCTION(_ExhumedPlayer, GetAngle)
{
PARAM_SELF_STRUCT_PROLOGUE(ExhumedPlayer);
PARAM_SELF_STRUCT_PROLOGUE(DExhumedPlayer);
ACTION_RETURN_INT(self->GetActor()->spr.Angles.Yaw.Buildang());
}

View file

@ -47,8 +47,20 @@ struct PlayerSave
DAngle nAngle;
};
struct ExhumedPlayer final : public CorePlayer
class DExhumedPlayer final : public DCorePlayer
{
DECLARE_CLASS(DExhumedPlayer, DCorePlayer)
HAS_OBJECT_POINTERS
DExhumedPlayer() = default;
public:
DExhumedPlayer(uint8_t p) : DCorePlayer(p) {}
void Clear()
{
Super::Clear();
// Quick'n dirty clear
memset(&nHealth, 0, sizeof(DExhumedPlayer) - myoffsetof(DExhumedPlayer, nHealth));
}
int16_t nHealth;
int16_t nLives;
int16_t nDouble;
@ -116,9 +128,9 @@ struct ExhumedPlayer final : public CorePlayer
extern int PlayerCount;
inline ExhumedPlayer* getPlayer(int index)
inline DExhumedPlayer* getPlayer(int index)
{
return static_cast<ExhumedPlayer*>(PlayerArray[index]);
return static_cast<DExhumedPlayer*>(PlayerArray[index]);
}
extern TObjPtr<DExhumedActor*> nNetStartSprite[kMaxPlayers];
@ -129,9 +141,9 @@ int GetPlayerFromActor(DExhumedActor* actor);
void SetPlayerMummified(int nPlayer, int bIsMummified);
int AddAmmo(int nPlayer, int nWeapon, int nAmmoAmount);
void ShootStaff(int nPlayer);
void updatePlayerTarget(ExhumedPlayer* const pPlayer);
void updatePlayerTarget(DExhumedPlayer* const pPlayer);
inline void doPlayerVertPanning(ExhumedPlayer* const pPlayer, const double nDestVertPan)
inline void doPlayerVertPanning(DExhumedPlayer* const pPlayer, const double nDestVertPan)
{
const auto nVertPan = (nDestVertPan - pPlayer->Angles.ViewAngles.Pitch.Tan() * 128) * 0.25;
pPlayer->Angles.ViewAngles.Pitch += maphoriz(abs(nVertPan) >= 4 ? Sgn(nVertPan) * 4. : nVertPan * 2.);

View file

@ -238,7 +238,7 @@ int CanHitPlayer(DSWActor* actor)
int DoActorPickClosePlayer(DSWActor* actor)
{
int pnum;
SWPlayer* pp;
DSWPlayer* pp;
// if actor can still see the player
bool found = false;
int i;
@ -362,7 +362,7 @@ TARGETACTOR:
DSWActor* GetPlayerSpriteNum(DSWActor* actor)
{
int pnum;
SWPlayer* pp;
DSWPlayer* pp;
TRAVERSE_CONNECT(pnum)
{

View file

@ -993,7 +993,7 @@ int DoBunnyQuickJump(DSWActor* actor)
{
if ((hitActor->spr.extra & SPRX_PLAYER_OR_ENEMY))
{
SWPlayer* pp = nullptr;
DSWPlayer* pp = nullptr;
if (RandomRange(1000) < 995 && hitActor->user.spal != PALETTE_PLAYER0) return false;

View file

@ -51,7 +51,7 @@ extern bool FAF_DebugView;
extern bool ToggleFlyMode;
const char *CheatKeyType;
void KeysCheat(SWPlayer* pp, const char *cheat_string);
void KeysCheat(DSWPlayer* pp, const char *cheat_string);
//---------------------------------------------------------------------------
//
@ -59,7 +59,7 @@ void KeysCheat(SWPlayer* pp, const char *cheat_string);
//
//---------------------------------------------------------------------------
static SWPlayer* checkCheat(cheatseq_t* c)
static DSWPlayer* checkCheat(cheatseq_t* c)
{
if (::CheckCheatmode(true, true)) return nullptr;
return getPlayer(screenpeek);
@ -142,7 +142,7 @@ bool PrevCheat(cheatseq_t* c)
bool MapCheat(cheatseq_t* c)
{
SWPlayer* pp;
DSWPlayer* pp;
if (!(pp=checkCheat(c))) return false;
gFullMap = !gFullMap;
// Need to do this differently. The code here was completely broken.
@ -158,7 +158,7 @@ bool MapCheat(cheatseq_t* c)
bool WarpCheat(cheatseq_t* c)
{
SWPlayer* pp;
DSWPlayer* pp;
if (!(pp = checkCheat(c))) return false;
int level_num;

View file

@ -97,7 +97,7 @@ bool GameInterface::CanSave()
bool GameInterface::StartGame(FNewGameStartup& gs)
{
SWPlayer* pp = getPlayer(screenpeek);
DSWPlayer* pp = getPlayer(screenpeek);
int handle = 0;
int zero = 0;

View file

@ -608,7 +608,7 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& viewpos, doub
{
int tSpriteNum;
static int ang = 0;
SWPlayer* pp = getPlayer(screenpeek);
DSWPlayer* pp = getPlayer(screenpeek);
int newshade=0;
const int DART_PIC = 2526;
@ -966,7 +966,7 @@ void post_analyzesprites(tspriteArray& tsprites)
//
//---------------------------------------------------------------------------
void PrintSpriteInfo(SWPlayer* pp)
void PrintSpriteInfo(DSWPlayer* pp)
{
const int Y_STEP = 7;
@ -1010,7 +1010,7 @@ void PrintSpriteInfo(SWPlayer* pp)
//
//---------------------------------------------------------------------------
static void DrawCrosshair(SWPlayer* pp, const double interpfrac)
static void DrawCrosshair(DSWPlayer* pp, const double interpfrac)
{
auto offsets = pp->Angles.getCrosshairOffsets(interpfrac);
::DrawCrosshair(pp->GetActor()->user.Health, offsets.first.X, offsets.first.Y + ((pp->Flags & PF_VIEW_FROM_OUTSIDE) ? 5 : 0), 2, offsets.second, shadeToLight(10));
@ -1111,7 +1111,7 @@ void PreDrawStackedWater(void)
}
void DoPlayerDiveMeter(SWPlayer* pp);
void DoPlayerDiveMeter(DSWPlayer* pp);
//---------------------------------------------------------------------------
//
@ -1212,10 +1212,14 @@ void RestorePortalState()
//
//---------------------------------------------------------------------------
void drawscreen(SWPlayer* pp, double interpfrac, bool sceneonly)
void drawscreen(DSWPlayer* pp, double interpfrac, bool sceneonly)
{
#if 0
// prediction player if prediction is on, else regular player
SWPlayer* camerapp = (PredictionOn && CommEnabled && pp == getPlayer(myconnectindex)) ? ppp : pp;
DSWPlayer* camerapp = (PredictionOn && CommEnabled && pp == getPlayer(myconnectindex)) ? ppp : pp;
#else
DSWPlayer* camerapp = pp;
#endif
PreDraw();
PreUpdatePanel(interpfrac);

View file

@ -97,7 +97,6 @@ IMPLEMENT_CLASS(DSWActor, false, true)
IMPLEMENT_POINTERS_START(DSWActor)
IMPLEMENT_POINTER(ownerActor)
IMPLEMENT_POINTER(user.lowActor)
IMPLEMENT_POINTER(user.lowActor)
IMPLEMENT_POINTER(user.highActor)
IMPLEMENT_POINTER(user.targetActor)
IMPLEMENT_POINTER(user.flameActor)
@ -105,6 +104,17 @@ IMPLEMENT_POINTER(user.attachActor)
IMPLEMENT_POINTER(user.WpnGoalActor)
IMPLEMENT_POINTERS_END
IMPLEMENT_CLASS(DSWPlayer, false, true)
IMPLEMENT_POINTERS_START(DSWPlayer)
IMPLEMENT_POINTER(remoteActor)
IMPLEMENT_POINTER(lowActor)
IMPLEMENT_POINTER(highActor)
IMPLEMENT_POINTER(PlayerUnderActor)
IMPLEMENT_POINTER(KillerActor)
IMPLEMENT_POINTER(HitBy)
IMPLEMENT_POINTER(last_camera_act)
IMPLEMENT_POINTERS_END
void MarkSOInterp();
extern int FinishTimer;
@ -118,21 +128,6 @@ void markgcroots()
GC::MarkArray(GenericQueue, MAX_GENERIC_QUEUE);
GC::MarkArray(LoWangsQueue, MAX_LOWANGS_QUEUE);
GC::MarkArray(BossSpriteNum, 3);
for (int i = 0; i < MAXPLAYERS; i++)
{
auto plr = getPlayer(i);
if (plr)
{
GC::Mark(plr->actor);
GC::Mark(plr->lowActor);
GC::Mark(plr->highActor);
GC::Mark(plr->remoteActor);
GC::Mark(plr->PlayerUnderActor);
GC::Mark(plr->KillerActor);
GC::Mark(plr->HitBy);
GC::Mark(plr->last_camera_act);
}
}
for (auto& so : SectorObject)
{
GC::Mark(so.controller);
@ -152,7 +147,7 @@ void markgcroots()
}
void pClearSpriteList(SWPlayer* pp);
void pClearSpriteList(DSWPlayer* pp);
int GameVersion = 20;
@ -257,8 +252,8 @@ void GameInterface::app_init()
// Initialise player array.
for (unsigned i = 0; i < MAXPLAYERS; i++)
{
PlayerArray[i] = new SWPlayer;
*getPlayer(i) = {};
PlayerArray[i] = Create<DSWPlayer>(i);
GC::WriteBarrier(PlayerArray[i]);
}
// these are frequently checked markers.
@ -425,7 +420,7 @@ void InitLevel(MapRecord *maprec)
// don't jack with the playerreadyflag
int ready_bak = getPlayer(i)->playerreadyflag;
int ver_bak = getPlayer(i)->PlayerVersion;
*getPlayer(i) = {};
getPlayer(i)->Clear();
getPlayer(i)->playerreadyflag = ready_bak;
getPlayer(i)->PlayerVersion = ver_bak;
INITLIST(&getPlayer(i)->PanelSpriteList);
@ -583,7 +578,7 @@ void TerminateLevel(void)
TRAVERSE_CONNECT(pnum)
{
SWPlayer* pp = getPlayer(pnum);
DSWPlayer* pp = getPlayer(pnum);
if (pp->Flags & PF_DEAD)
PlayerDeathReset(pp);

View file

@ -327,7 +327,7 @@ enum dam
// Forward declarations
struct STATE;
struct PANEL_STATE;
struct SWPlayer;
class DSWPlayer;
struct PERSONALITY;
struct ATTRIBUTE;
struct SECTOR_OBJECT;
@ -427,7 +427,7 @@ enum
struct DAMAGE_DATA
{
void (*Init)(SWPlayer*);
void (*Init)(DSWPlayer*);
int16_t damage_lo;
int16_t damage_hi;
unsigned int radius;
@ -444,24 +444,24 @@ extern DAMAGE_DATA DamageData[];
extern int WeaponHasNoAmmo, WeaponIsAmmo;
void InitWeaponFist(SWPlayer*);
void InitWeaponStar(SWPlayer*);
void InitWeaponShotgun(SWPlayer*);
void InitWeaponRocket(SWPlayer*);
void InitWeaponRail(SWPlayer*);
void InitWeaponMicro(SWPlayer*);
void InitWeaponUzi(SWPlayer*);
void InitWeaponSword(SWPlayer*);
void InitWeaponHothead(SWPlayer*);
void InitWeaponElectro(SWPlayer*);
void InitWeaponHeart(SWPlayer*);
void InitWeaponGrenade(SWPlayer*);
void InitWeaponMine(SWPlayer*);
void InitWeaponFist(DSWPlayer*);
void InitWeaponStar(DSWPlayer*);
void InitWeaponShotgun(DSWPlayer*);
void InitWeaponRocket(DSWPlayer*);
void InitWeaponRail(DSWPlayer*);
void InitWeaponMicro(DSWPlayer*);
void InitWeaponUzi(DSWPlayer*);
void InitWeaponSword(DSWPlayer*);
void InitWeaponHothead(DSWPlayer*);
void InitWeaponElectro(DSWPlayer*);
void InitWeaponHeart(DSWPlayer*);
void InitWeaponGrenade(DSWPlayer*);
void InitWeaponMine(DSWPlayer*);
void InitWeaponNapalm(SWPlayer*);
void InitWeaponRing(SWPlayer*);
void InitWeaponNapalm(DSWPlayer*);
void InitWeaponRing(DSWPlayer*);
extern void (*InitWeapon[MAX_WEAPONS]) (SWPlayer*);
extern void (*InitWeapon[MAX_WEAPONS]) (DSWPlayer*);
///////////////////////////////////////////////////////////////////////////////////////////
//
@ -525,7 +525,7 @@ enum PlayerDeathTypes
PLAYER_DEATH_FLIP, PLAYER_DEATH_CRUMBLE, PLAYER_DEATH_EXPLODE, PLAYER_DEATH_RIPPER, PLAYER_DEATH_SQUISH, PLAYER_DEATH_DROWN, MAX_PLAYER_DEATHS
};
typedef void (*PLAYER_ACTION_FUNCp)(SWPlayer*);
typedef void (*PLAYER_ACTION_FUNCp)(DSWPlayer*);
#include "inv.h"
@ -755,7 +755,7 @@ struct USER
// if a player's sprite points to player structure
SWPlayer* PlayerP;
DSWPlayer* PlayerP;
int16_t Sibling;
@ -1413,10 +1413,10 @@ enum
short SoundAngle(int x, int y);
//void PlaySound(int num, short angle, short vol);
int _PlaySound(FSoundID num, DSWActor* sprite, SWPlayer* player, const DVector3 *const pos, int flags, int channel, EChanFlags sndflags);
int _PlaySound(FSoundID num, DSWActor* sprite, DSWPlayer* player, const DVector3 *const pos, int flags, int channel, EChanFlags sndflags);
void InitAmbient(int num, DSWActor* actor);
inline void PlaySound(int num, SWPlayer* player, int flags, int channel = 8, EChanFlags sndflags = CHANF_NONE)
inline void PlaySound(int num, DSWPlayer* player, int flags, int channel = 8, EChanFlags sndflags = CHANF_NONE)
{
_PlaySound(soundEngine->FindSoundByResID(num), nullptr, player, nullptr, flags | v3df_follow, channel, sndflags);
}
@ -1429,20 +1429,20 @@ inline void PlaySound(int num, const DVector3 &pos, int flags, int channel = 8,
_PlaySound(soundEngine->FindSoundByResID(num), nullptr, nullptr, &pos, flags, channel, sndflags);
}
int _PlayerSound(int num, SWPlayer* pp);
inline int PlayerSound(int num, int flags, SWPlayer* pp) { return _PlayerSound(num, pp); }
void StopPlayerSound(SWPlayer* pp, int which = -1);
int _PlayerSound(int num, DSWPlayer* pp);
inline int PlayerSound(int num, int flags, DSWPlayer* pp) { return _PlayerSound(num, pp); }
void StopPlayerSound(DSWPlayer* pp, int which = -1);
bool SoundValidAndActive(DSWActor* spr, int channel);
struct BREAK_INFO;
int SpawnShrap(DSWActor*, DSWActor*, int = -1, BREAK_INFO* breakinfo = nullptr);
void PlayerUpdateHealth(SWPlayer* pp, short value);
void PlayerUpdateAmmo(SWPlayer* pp, short WeaponNum, short value);
void PlayerUpdateWeapon(SWPlayer* pp, short WeaponNum);
void PlayerUpdateKills(SWPlayer* pp, short value);
void RefreshInfoLine(SWPlayer* pp);
void PlayerUpdateHealth(DSWPlayer* pp, short value);
void PlayerUpdateAmmo(DSWPlayer* pp, short WeaponNum, short value);
void PlayerUpdateWeapon(DSWPlayer* pp, short WeaponNum);
void PlayerUpdateKills(DSWPlayer* pp, short value);
void RefreshInfoLine(DSWPlayer* pp);
void DoAnim(int numtics);
void AnimDelete(int animtype, int animindex, DSWActor*);
@ -1571,8 +1571,8 @@ extern int16_t StatDamageList[STAT_DAMAGE_LIST_SIZE];
//
///////////////////////////////////////////////////////////////
extern void SetFadeAmt(SWPlayer* pp, short damage, uint8_t startcolor);
extern void DoPaletteFlash(SWPlayer* pp);
extern void SetFadeAmt(DSWPlayer* pp, short damage, uint8_t startcolor);
extern void DoPaletteFlash(DSWPlayer* pp);
extern bool NightVision;
@ -1608,9 +1608,9 @@ void InitSetup(void); // setup.c
void LoadKVXFromScript(TilesetBuildInfo& info, const char *filename); // scrip2.c
void LoadCustomInfoFromScript(const char *filename); // scrip2.c
int PlayerInitChemBomb(SWPlayer* pp); // jweapon.c
int PlayerInitFlashBomb(SWPlayer* pp); // jweapon.c
int PlayerInitCaltrops(SWPlayer* pp); // jweapon.c
int PlayerInitChemBomb(DSWPlayer* pp); // jweapon.c
int PlayerInitFlashBomb(DSWPlayer* pp); // jweapon.c
int PlayerInitCaltrops(DSWPlayer* pp); // jweapon.c
int InitPhosphorus(DSWActor*); // jweapon.c
void SpawnFloorSplash(DSWActor*); // jweapon.c
@ -1676,9 +1676,20 @@ END_SW_NS
BEGIN_SW_NS
struct SWPlayer final : public CorePlayer
class DSWPlayer final : public DCorePlayer
{
DSWActor* actor; // this may not be a TObjPtr!
DECLARE_CLASS(DSWPlayer, DCorePlayer)
HAS_OBJECT_POINTERS
DSWPlayer() = default;
public:
void Clear()
{
Super::Clear();
// Quick'n dirty clear
memset(&lowActor, 0, sizeof(DSWPlayer) - myoffsetof(DSWPlayer, lowActor));
}
DSWPlayer(uint8_t p) : DCorePlayer(p) {}
TObjPtr<DSWActor*> lowActor, highActor;
TObjPtr<DSWActor*> remoteActor;
TObjPtr<DSWActor*> PlayerUnderActor;
@ -1854,9 +1865,9 @@ struct SWPlayer final : public CorePlayer
}
};
inline SWPlayer* getPlayer(int index)
inline DSWPlayer* getPlayer(int index)
{
return static_cast<SWPlayer*>(PlayerArray[index]);
return static_cast<DSWPlayer*>(PlayerArray[index]);
}
@ -1917,7 +1928,7 @@ inline bool SectorIsUnderwaterArea(sectortype* sect)
return sect && sect->extra & (SECTFX_UNDERWATER | SECTFX_UNDERWATER2);
}
inline bool PlayerFacingRange(SWPlayer* pp, DSWActor* a, DAngle range)
inline bool PlayerFacingRange(DSWPlayer* pp, DSWActor* a, DAngle range)
{
return absangle((a->spr.pos.XY() - pp->GetActor()->spr.pos.XY()).Angle(), pp->GetActor()->spr.Angles.Yaw) < range;
}
@ -2072,7 +2083,7 @@ inline bool SpriteInUnderwaterArea(DSWActor* a)
// just determine if the player is moving
inline bool PLAYER_MOVING(SWPlayer* pp)
inline bool PLAYER_MOVING(DSWPlayer* pp)
{
return !pp->vect.isZero();
}

View file

@ -551,7 +551,7 @@ int DoHornetDeath(DSWActor* actor)
int DoCheckSwarm(DSWActor* actor)
{
double dist, pdist;
SWPlayer* pp;
DSWPlayer* pp;
if (!MoveSkip8) return 0; // Don't over check

View file

@ -70,7 +70,7 @@ enum
//
//---------------------------------------------------------------------------
void processWeapon(SWPlayer* const pp)
void processWeapon(DSWPlayer* const pp)
{
DSWActor* plActor = pp->GetActor();
if (plActor == nullptr) return;

View file

@ -44,28 +44,28 @@ BEGIN_SW_NS
extern short NormalVisibility;
void PlayerUpdateInventory(SWPlayer* pp, short InventoryNum);
void InventoryUse(SWPlayer* pp);
void InventoryStop(SWPlayer* pp, short InventoryNum);
void PlayerUpdateInventory(DSWPlayer* pp, short InventoryNum);
void InventoryUse(DSWPlayer* pp);
void InventoryStop(DSWPlayer* pp, short InventoryNum);
void UseInventoryRepairKit(SWPlayer* pp);
void UseInventoryMedkit(SWPlayer* pp);
void UseInventoryRepairKit(SWPlayer* pp);
void UseInventoryCloak(SWPlayer* pp);
void UseInventoryEnvironSuit(SWPlayer* pp);
void UseInventoryNightVision(SWPlayer* pp);
void UseInventoryChemBomb(SWPlayer* pp);
void UseInventoryFlashBomb(SWPlayer* pp);
void UseInventoryCaltrops(SWPlayer* pp);
void UseInventoryRepairKit(DSWPlayer* pp);
void UseInventoryMedkit(DSWPlayer* pp);
void UseInventoryRepairKit(DSWPlayer* pp);
void UseInventoryCloak(DSWPlayer* pp);
void UseInventoryEnvironSuit(DSWPlayer* pp);
void UseInventoryNightVision(DSWPlayer* pp);
void UseInventoryChemBomb(DSWPlayer* pp);
void UseInventoryFlashBomb(DSWPlayer* pp);
void UseInventoryCaltrops(DSWPlayer* pp);
void StopInventoryRepairKit(SWPlayer* pp, short);
void StopInventoryMedkit(SWPlayer* pp, short);
void StopInventoryRepairKit(SWPlayer* pp, short);
void StopInventoryCloak(SWPlayer* pp, short);
void StopInventoryEnvironSuit(SWPlayer* pp, short);
void StopInventoryNightVision(SWPlayer* pp, short);
void StopInventoryRepairKit(DSWPlayer* pp, short);
void StopInventoryMedkit(DSWPlayer* pp, short);
void StopInventoryRepairKit(DSWPlayer* pp, short);
void StopInventoryCloak(DSWPlayer* pp, short);
void StopInventoryEnvironSuit(DSWPlayer* pp, short);
void StopInventoryNightVision(DSWPlayer* pp, short);
extern PANEL_STATE ps_PanelEnvironSuit[];
@ -96,14 +96,14 @@ void PanelInvTestSuicide(PANEL_SPRITE* psp)
}
}
void KillPanelInv(SWPlayer* pp, short InventoryNum)
void KillPanelInv(DSWPlayer* pp, short InventoryNum)
{
ASSERT(InventoryNum < MAX_INVENTORY);
pp->InventoryTics[InventoryNum] = 0;
}
void KillAllPanelInv(SWPlayer* pp)
void KillAllPanelInv(DSWPlayer* pp)
{
for (int i = 0; i < MAX_INVENTORY; i++)
{
@ -117,7 +117,7 @@ void KillAllPanelInv(SWPlayer* pp)
//
//////////////////////////////////////////////////////////////////////
void AutoPickInventory(SWPlayer* pp)
void AutoPickInventory(DSWPlayer* pp)
{
int i;
@ -149,7 +149,7 @@ void AutoPickInventory(SWPlayer* pp)
//
//---------------------------------------------------------------------------
void UseInventoryMedkit(SWPlayer* pp)
void UseInventoryMedkit(DSWPlayer* pp)
{
short diff;
short inv = INVENTORY_MEDKIT;
@ -196,7 +196,7 @@ void UseInventoryMedkit(SWPlayer* pp)
// CHEMICAL WARFARE CANISTERS
//
//////////////////////////////////////////////////////////////////////
void UseInventoryChemBomb(SWPlayer* pp)
void UseInventoryChemBomb(DSWPlayer* pp)
{
short inv = INVENTORY_CHEMBOMB;
@ -219,7 +219,7 @@ void UseInventoryChemBomb(SWPlayer* pp)
// FLASH BOMBS
//
//////////////////////////////////////////////////////////////////////
void UseInventoryFlashBomb(SWPlayer* pp)
void UseInventoryFlashBomb(DSWPlayer* pp)
{
short inv = INVENTORY_FLASHBOMB;
@ -242,7 +242,7 @@ void UseInventoryFlashBomb(SWPlayer* pp)
// CALTROPS
//
//////////////////////////////////////////////////////////////////////
void UseInventoryCaltrops(SWPlayer* pp)
void UseInventoryCaltrops(DSWPlayer* pp)
{
short inv = INVENTORY_CALTROPS;
@ -266,7 +266,7 @@ void UseInventoryCaltrops(SWPlayer* pp)
//
//////////////////////////////////////////////////////////////////////
void UseInventoryRepairKit(SWPlayer* pp)
void UseInventoryRepairKit(DSWPlayer* pp)
{
short inv = INVENTORY_REPAIR_KIT;
@ -294,7 +294,7 @@ void UseInventoryRepairKit(SWPlayer* pp)
//
//////////////////////////////////////////////////////////////////////
void UseInventoryCloak(SWPlayer* pp)
void UseInventoryCloak(DSWPlayer* pp)
{
DSWActor* plActor = pp->GetActor();
@ -319,7 +319,7 @@ void UseInventoryCloak(SWPlayer* pp)
PlayerSound(DIGI_IAMSHADOW, v3df_follow|v3df_dontpan,pp);
}
void StopInventoryCloak(SWPlayer* pp, short InventoryNum)
void StopInventoryCloak(DSWPlayer* pp, short InventoryNum)
{
DSWActor* plActor = pp->GetActor();
@ -347,7 +347,7 @@ void StopInventoryCloak(SWPlayer* pp, short InventoryNum)
//
//////////////////////////////////////////////////////////////////////
void DoPlayerNightVisionPalette(SWPlayer* pp)
void DoPlayerNightVisionPalette(DSWPlayer* pp)
{
if (pp != getPlayer(screenpeek)) return;
@ -370,7 +370,7 @@ void DoPlayerNightVisionPalette(SWPlayer* pp)
}
}
void UseInventoryNightVision(SWPlayer* pp)
void UseInventoryNightVision(DSWPlayer* pp)
{
if (pp->InventoryActive[pp->InventoryNum])
{
@ -387,7 +387,7 @@ void UseInventoryNightVision(SWPlayer* pp)
PlaySound(DIGI_NIGHTON, pp, v3df_dontpan|v3df_follow);
}
void StopInventoryNightVision(SWPlayer* pp, short InventoryNum)
void StopInventoryNightVision(DSWPlayer* pp, short InventoryNum)
{
pp->InventoryActive[InventoryNum] = false;
@ -414,7 +414,7 @@ void StopInventoryNightVision(SWPlayer* pp, short InventoryNum)
//
//////////////////////////////////////////////////////////////////////
void InventoryKeys(SWPlayer* pp)
void InventoryKeys(DSWPlayer* pp)
{
// scroll SPELLs left
if (pp->cmd.ucmd.actions & SB_INVPREV)
@ -507,7 +507,7 @@ void InventoryKeys(SWPlayer* pp)
//
//---------------------------------------------------------------------------
void InventoryTimer(SWPlayer* pp)
void InventoryTimer(DSWPlayer* pp)
{
// called every time through loop
short inv = 0;
@ -591,7 +591,7 @@ void InventoryTimer(SWPlayer* pp)
//
//---------------------------------------------------------------------------
void InventoryUse(SWPlayer* pp)
void InventoryUse(DSWPlayer* pp)
{
INVENTORY_DATA* id = &InventoryData[pp->InventoryNum];
@ -599,7 +599,7 @@ void InventoryUse(SWPlayer* pp)
(*id->Init)(pp);
}
void InventoryStop(SWPlayer* pp, short InventoryNum)
void InventoryStop(DSWPlayer* pp, short InventoryNum)
{
INVENTORY_DATA* id = &InventoryData[InventoryNum];
@ -613,7 +613,7 @@ void InventoryStop(SWPlayer* pp, short InventoryNum)
//
/////////////////////////////////////////////////////////////////
void PlayerUpdateInventory(SWPlayer* pp, short InventoryNum)
void PlayerUpdateInventory(DSWPlayer* pp, short InventoryNum)
{
pp->InventoryNum = InventoryNum;

View file

@ -39,8 +39,8 @@ enum InventoryNames
struct INVENTORY_DATA
{
const char* Name;
void (*Init)(SWPlayer*);
void (*Stop)(SWPlayer*, short);
void (*Init)(DSWPlayer*);
void (*Stop)(DSWPlayer*, short);
short DecPerSec;
short MaxInv;
int Scale;
@ -56,7 +56,7 @@ enum EInvFlags
INVF_COUNT = 4
};
void PlayerUpdateInventory(SWPlayer* pp, short InventoryNum);
void InventoryKeys(SWPlayer* pp);
void UseInventoryRepairKit(SWPlayer* pp);
void InventoryTimer(SWPlayer* pp);
void PlayerUpdateInventory(DSWPlayer* pp, short InventoryNum);
void InventoryKeys(DSWPlayer* pp);
void UseInventoryRepairKit(DSWPlayer* pp);
void InventoryTimer(DSWPlayer* pp);

View file

@ -376,7 +376,7 @@ void drawroomstotile(const DVector3& pos, DAngle ang, DAngle horiz, sectortype*
void JS_ProcessEchoSpot()
{
SWPlayer* pp = getPlayer(screenpeek);
DSWPlayer* pp = getPlayer(screenpeek);
int16_t reverb;
bool reverb_set = false;
@ -417,7 +417,7 @@ short camplayerview = 1; // Don't show yourself!
// Hack job alert!
// Mirrors and cameras are maintained in the same data structure, but for hardware rendering they cannot be interleaved.
// So this function replicates JS_DrawMirrors to only process the camera textures but not change any global state.
void JS_DrawCameras(SWPlayer* pp, const DVector3& campos, double smoothratio)
void JS_DrawCameras(DSWPlayer* pp, const DVector3& campos, double smoothratio)
{
int cnt;
double dist;
@ -557,7 +557,7 @@ void JS_DrawCameras(SWPlayer* pp, const DVector3& campos, double smoothratio)
{
if (dist < MAXCAMDIST)
{
SWPlayer* cp = getPlayer(camplayerview);
DSWPlayer* cp = getPlayer(camplayerview);
if (TEST_BOOL11(camactor) && numplayers > 1)
{
@ -577,11 +577,11 @@ void JS_DrawCameras(SWPlayer* pp, const DVector3& campos, double smoothratio)
// Workaround until the camera code can be refactored to process all camera textures that were visible last frame.
// Need to stash the parameters for later use. This is only used to find the nearest camera.
static SWPlayer* cam_pp;
static DSWPlayer* cam_pp;
DVector3 cam_pos;
static int oldstat;
void JS_CameraParms(SWPlayer* pp, const DVector3& tpos)
void JS_CameraParms(DSWPlayer* pp, const DVector3& tpos)
{
cam_pp = pp;
cam_pos = tpos;

View file

@ -64,7 +64,7 @@ extern bool mirrorinview;
extern short NormalVisibility;
void JAnalyzeSprites(tspritetype* tspr);
void JS_CameraParms(SWPlayer* pp, const DVector3& tpos);
void JS_CameraParms(DSWPlayer* pp, const DVector3& tpos);
void JS_InitMirrors(void);
void JS_ProcessEchoSpot(void);
void JS_SpriteSetup(void);

View file

@ -1231,7 +1231,7 @@ int DoRadiationCloud(DSWActor* actor)
// Inventory Chemical Bombs
//
//////////////////////////////////////////////
int PlayerInitChemBomb(SWPlayer* pp)
int PlayerInitChemBomb(DSWPlayer* pp)
{
DSWActor* plActor = pp->GetActor();
@ -1398,7 +1398,7 @@ int InitChemBomb(DSWActor* actor)
//
//---------------------------------------------------------------------------
int PlayerInitFlashBomb(SWPlayer* pp)
int PlayerInitFlashBomb(DSWPlayer* pp)
{
unsigned int stat;
@ -1473,7 +1473,7 @@ int InitFlashBomb(DSWActor* actor)
int i;
unsigned int stat;
short damage;
SWPlayer* pp = getPlayer(screenpeek);
DSWPlayer* pp = getPlayer(screenpeek);
PlaySound(DIGI_GASPOP, actor, v3df_dontpan | v3df_doppler);
@ -1605,7 +1605,7 @@ void SpawnFlashBombOnActor(DSWActor* actor)
//
//---------------------------------------------------------------------------
int PlayerInitCaltrops(SWPlayer* pp)
int PlayerInitCaltrops(DSWPlayer* pp)
{
DSWActor* plActor = pp->GetActor();

View file

@ -43,7 +43,7 @@ BEGIN_SW_NS
//
//---------------------------------------------------------------------------
Collision MultiClipMove(SWPlayer* pp, double zz, double floordist)
Collision MultiClipMove(DSWPlayer* pp, double zz, double floordist)
{
int i;
DVector3 opos[MAX_CLIPBOX], pos[MAX_CLIPBOX];
@ -122,7 +122,7 @@ Collision MultiClipMove(SWPlayer* pp, double zz, double floordist)
//
//---------------------------------------------------------------------------
int MultiClipTurn(SWPlayer* pp, DAngle new_ang, double zz, double floordist)
int MultiClipTurn(DSWPlayer* pp, DAngle new_ang, double zz, double floordist)
{
int i;
SECTOR_OBJECT* sop = pp->sop;
@ -192,7 +192,7 @@ int testquadinsect(int *point_num, DVector2 const * qp, sectortype* sect)
//
//---------------------------------------------------------------------------
int RectClipMove(SWPlayer* pp, DVector2* qpos)
int RectClipMove(DSWPlayer* pp, DVector2* qpos)
{
int i;
DVector2 xy[4];
@ -253,7 +253,7 @@ int RectClipMove(SWPlayer* pp, DVector2* qpos)
//
//---------------------------------------------------------------------------
short RectClipTurn(SWPlayer* pp, DAngle new_angl, DVector2* qpos, DVector2* opos)
short RectClipTurn(DSWPlayer* pp, DAngle new_angl, DVector2* qpos, DVector2* opos)
{
int i;
DVector2 xy[4];

View file

@ -27,9 +27,9 @@ BEGIN_SW_NS
#define RECT_CLIP 1
Collision MultiClipMove(SWPlayer* pp, double z, double floor_dist);
int MultiClipTurn(SWPlayer* pp, DAngle new_ang, double zz, double floordist);
int RectClipMove(SWPlayer* pp, DVector2* qpos);
Collision MultiClipMove(DSWPlayer* pp, double z, double floor_dist);
int MultiClipTurn(DSWPlayer* pp, DAngle new_ang, double zz, double floordist);
int RectClipMove(DSWPlayer* pp, DVector2* qpos);
//short RectClipTurn(PLAYER* pp, short new_ang, int z, int floor_dist, int *qx, int *qy);
short RectClipTurn(SWPlayer* pp, short new_ang, int *qx, int *qy, int *ox, int *oy);
short RectClipTurn(DSWPlayer* pp, short new_ang, int *qx, int *qy, int *ox, int *oy);
END_SW_NS

View file

@ -80,7 +80,7 @@ static int faderamp[32] =
// Set the amount of redness for damage
// the player just took
//////////////////////////////////////////
void SetFadeAmt(SWPlayer* pp, short damage, uint8_t startcolor)
void SetFadeAmt(DSWPlayer* pp, short damage, uint8_t startcolor)
{
const int FADE_DAMAGE_FACTOR = 3; // 100 health / 32 shade cycles = 3.125
@ -143,7 +143,7 @@ void SetFadeAmt(SWPlayer* pp, short damage, uint8_t startcolor)
//////////////////////////////////////////
// Do the screen reddness based on damage
//////////////////////////////////////////
void DoPaletteFlash(SWPlayer* pp)
void DoPaletteFlash(DSWPlayer* pp)
{
const int MAXFADETICS = 5;

View file

@ -25,7 +25,7 @@ DSWActor* WarpPlane(DVector3& pos, sectortype** sect, double testz = DBL_MAX);
void ProcessVisOn(void);
void VisViewChange(SWPlayer* pp, int* vis);
void VisViewChange(DSWPlayer* pp, int* vis);
void SpawnVis(DSWActor* Parent, sectortype* sect, const DVector3& pos, int amt);
enum TriggerType { TRIGGER_TYPE_REMOTE_SO };
@ -53,10 +53,10 @@ int DoActorFall(DSWActor* actor);
#define TEXT_INFO_YOFF (10)
inline constexpr int TEXT_INFO_LINE(int line) { return (TEXT_INFO_Y + ((line)*TEXT_INFO_YOFF)); }
void PutStringInfo(SWPlayer* pp, const char* string);
void PutStringInfo(DSWPlayer* pp, const char* string);
void DoSlidorMatch(SWPlayer* pp, short match, bool);
void DoSlidorMatch(DSWPlayer* pp, short match, bool);
bool TestSlidorMatchActive(short match);
void InterpSectorSprites(sectortype* sect, bool state);
@ -75,21 +75,21 @@ int DoActorSectorDamage(DSWActor* actor);
int DoScaleSprite(DSWActor* actor);
int DoActorStopFall(DSWActor* actor);
void InitPlayerSprite(SWPlayer* pp, const DVector3& spawnpos, const DAngle startang);
void InitPlayerSprite(DSWPlayer* pp, const DVector3& spawnpos, const DAngle startang);
void InitAllPlayerSprites(const DVector3& spawnpos, const DAngle startang);
void PlayerPanelSetup(void);
void PlayerDeathReset(SWPlayer* pp);
void SpawnPlayerUnderSprite(SWPlayer* pp);
void PlayerDeathReset(DSWPlayer* pp);
void SpawnPlayerUnderSprite(DSWPlayer* pp);
void DoQuakeMatch(short match);
void ProcessQuakeOn(void);
void ProcessQuakeSpot(void);
void QuakeViewChange(SWPlayer* pp, DVector3& tpos, DAngle& tang);
void DoQuake(SWPlayer* pp);
bool SetQuake(SWPlayer* pp, short tics, short amt);
void QuakeViewChange(DSWPlayer* pp, DVector3& tpos, DAngle& tang);
void DoQuake(DSWPlayer* pp);
bool SetQuake(DSWPlayer* pp, short tics, short amt);
int SetExpQuake(DSWActor*);
int SetGunQuake(DSWActor*);
int SetPlayerQuake(SWPlayer* mpp);
int SetPlayerQuake(DSWPlayer* mpp);
int SetNuclearQuake(DSWActor*);
int SetSumoQuake(DSWActor*);
int SetSumoFartQuake(DSWActor*);

View file

@ -60,7 +60,7 @@ uint8_t CommPlayers = 0;
void InitNetPlayerOptions(void)
{
// short pnum;
SWPlayer* pp = getPlayer(myconnectindex);
DSWPlayer* pp = getPlayer(myconnectindex);
strncpy(pp->PlayerName, playername, 31);

View file

@ -32,14 +32,14 @@ enum
MAXSYNCBYTES = 16
};
extern bool PredictionOn;
extern SWPlayer PredictPlayer;
extern SWPlayer* ppp;
extern DSWPlayer PredictPlayer;
extern DSWPlayer* ppp;
extern short predictangpos[];
extern int predictmovefifoplc;
extern bool Prediction;
void InitPrediction(SWPlayer* pp);
void DoPrediction(SWPlayer* ppp);
void InitPrediction(DSWPlayer* pp);
void DoPrediction(DSWPlayer* ppp);
void CorrectPrediction(int actualfifoplc);

View file

@ -2120,7 +2120,7 @@ void InitAllPlayerSprites(const DVector3& spawnpos, const DAngle startang)
//
//---------------------------------------------------------------------------
void PlayerLevelReset(SWPlayer* pp)
void PlayerLevelReset(DSWPlayer* pp)
{
DSWActor* actor = pp->GetActor();
@ -2163,7 +2163,7 @@ void PlayerLevelReset(SWPlayer* pp)
//
//---------------------------------------------------------------------------
void PlayerDeathReset(SWPlayer* pp)
void PlayerDeathReset(DSWPlayer* pp)
{
DSWActor* actor = pp->GetActor();
@ -2255,7 +2255,7 @@ void PlayerPanelSetup(void)
//
//---------------------------------------------------------------------------
void PlayerGameReset(SWPlayer* pp)
void PlayerGameReset(DSWPlayer* pp)
{
DSWActor* actor = pp->GetActor();
@ -2319,9 +2319,9 @@ extern ACTOR_ACTION_SET PlayerNinjaActionSet;
//
//---------------------------------------------------------------------------
void InitPlayerSprite(SWPlayer* pp, const DVector3& spawnpos, const DAngle startang)
void InitPlayerSprite(DSWPlayer* pp, const DVector3& spawnpos, const DAngle startang)
{
int pnum = int(pp - (SWPlayer*)PlayerArray);
int pnum = int(pp->pnum);
double fz,cz;
extern bool NewGame;
@ -2404,11 +2404,11 @@ void InitPlayerSprite(SWPlayer* pp, const DVector3& spawnpos, const DAngle start
//
//---------------------------------------------------------------------------
void SpawnPlayerUnderSprite(SWPlayer* pp)
void SpawnPlayerUnderSprite(DSWPlayer* pp)
{
DSWActor* plActor = pp->GetActor();
int pnum = int(pp - (SWPlayer*)PlayerArray);
int pnum = int(pp->pnum);
pp->PlayerUnderActor = SpawnActor(STAT_PLAYER_UNDER0 + pnum,
NINJA_RUN_R0, nullptr, pp->cursector, pp->GetActor()->getPosWithOffsetZ(), pp->GetActor()->spr.Angles.Yaw);

View file

@ -131,7 +131,7 @@ void GameInterface::SwitchCoopView()
}
else
{
SWPlayer* tp = getPlayer(screenpeek);
DSWPlayer* tp = getPlayer(screenpeek);
DoPlayerDivePalette(tp);
DoPlayerNightVisionPalette(tp);
}

View file

@ -46,17 +46,17 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
BEGIN_SW_NS
int InitSwordAttack(SWPlayer* pp);
int InitSwordAttack(DSWPlayer* pp);
PANEL_SPRITE* InitWeaponUziSecondaryReload(PANEL_SPRITE*);
PANEL_SPRITE* InitWeaponUzi2(PANEL_SPRITE*);
int InitShotgun(SWPlayer* pp);
int InitRail(SWPlayer* pp);
int InitMicro(SWPlayer* pp);
int InitRocket(SWPlayer* pp);
int InitNuke(SWPlayer* pp);
int InitGrenade(SWPlayer* pp);
int InitMine(SWPlayer* pp);
int InitFistAttack(SWPlayer* pp);
int InitShotgun(DSWPlayer* pp);
int InitRail(DSWPlayer* pp);
int InitMicro(DSWPlayer* pp);
int InitRocket(DSWPlayer* pp);
int InitNuke(DSWPlayer* pp);
int InitGrenade(DSWPlayer* pp);
int InitMine(DSWPlayer* pp);
int InitFistAttack(DSWPlayer* pp);
struct PANEL_SHRAP
{
@ -67,7 +67,7 @@ struct PANEL_SHRAP
void PanelInvTestSuicide(PANEL_SPRITE* psp);
void InsertPanelSprite(SWPlayer* pp, PANEL_SPRITE* psp);
void InsertPanelSprite(DSWPlayer* pp, PANEL_SPRITE* psp);
void pKillSprite(PANEL_SPRITE* psp);
void pWeaponBob(PANEL_SPRITE* psp, short condition);
void pSuicide(PANEL_SPRITE* psp);
@ -92,8 +92,8 @@ uint8_t UziRecoilYadj = 0;
extern short screenpeek;
pANIMATOR pNullAnimator;
int InitStar(SWPlayer*);
int ChangeWeapon(SWPlayer*);
int InitStar(DSWPlayer*);
int ChangeWeapon(DSWPlayer*);
int NullAnimator(DSWActor*)
{
@ -117,7 +117,7 @@ inline int pspheight(PANEL_SPRITE* psp)
//
//---------------------------------------------------------------------------
PANEL_SPRITE* pFindMatchingSprite(SWPlayer* pp, int x, int y, short pri)
PANEL_SPRITE* pFindMatchingSprite(DSWPlayer* pp, int x, int y, short pri)
{
PANEL_SPRITE* next;
@ -143,7 +143,7 @@ PANEL_SPRITE* pFindMatchingSprite(SWPlayer* pp, int x, int y, short pri)
//
//---------------------------------------------------------------------------
PANEL_SPRITE* pFindMatchingSpriteID(SWPlayer* pp, short id, int x, int y, short pri)
PANEL_SPRITE* pFindMatchingSpriteID(DSWPlayer* pp, short id, int x, int y, short pri)
{
PANEL_SPRITE* next;
@ -169,7 +169,7 @@ PANEL_SPRITE* pFindMatchingSpriteID(SWPlayer* pp, short id, int x, int y, short
//
//---------------------------------------------------------------------------
bool pKillScreenSpiteIDs(SWPlayer* pp, short id)
bool pKillScreenSpiteIDs(DSWPlayer* pp, short id)
{
PANEL_SPRITE* next;
bool found = false;
@ -213,7 +213,7 @@ void pToggleCrosshair(void)
//
//---------------------------------------------------------------------------
void DoPlayerChooseYell(SWPlayer* pp)
void DoPlayerChooseYell(DSWPlayer* pp)
{
int choose_snd = 0;
@ -257,7 +257,7 @@ void ArmorCalc(int damage_amt, int *armor_damage, int *player_damage)
//
//---------------------------------------------------------------------------
void PlayerUpdateHealth(SWPlayer* pp, short value)
void PlayerUpdateHealth(DSWPlayer* pp, short value)
{
DSWActor* plActor = pp->GetActor();
short x,y;
@ -367,7 +367,7 @@ void PlayerUpdateHealth(SWPlayer* pp, short value)
//
//---------------------------------------------------------------------------
void PlayerUpdateAmmo(SWPlayer* pp, short UpdateWeaponNum, short value)
void PlayerUpdateAmmo(DSWPlayer* pp, short UpdateWeaponNum, short value)
{
short x,y;
short WeaponNum;
@ -411,7 +411,7 @@ void PlayerUpdateAmmo(SWPlayer* pp, short UpdateWeaponNum, short value)
//
//---------------------------------------------------------------------------
void PlayerUpdateWeapon(SWPlayer* pp, short WeaponNum)
void PlayerUpdateWeapon(DSWPlayer* pp, short WeaponNum)
{
DSWActor* plActor = pp->GetActor();
@ -428,7 +428,7 @@ void PlayerUpdateWeapon(SWPlayer* pp, short WeaponNum)
//
//---------------------------------------------------------------------------
void PlayerUpdateKills(SWPlayer* pp, short value)
void PlayerUpdateKills(DSWPlayer* pp, short value)
{
if (Prediction)
return;
@ -440,7 +440,7 @@ void PlayerUpdateKills(SWPlayer* pp, short value)
if (gNet.MultiGameType == MULTI_GAME_COMMBAT && gNet.TeamPlay)
{
short pnum;
SWPlayer* opp;
DSWPlayer* opp;
TRAVERSE_CONNECT(pnum)
{
@ -463,7 +463,7 @@ void PlayerUpdateKills(SWPlayer* pp, short value)
//
//---------------------------------------------------------------------------
void PlayerUpdateArmor(SWPlayer* pp, short value)
void PlayerUpdateArmor(DSWPlayer* pp, short value)
{
if (Prediction)
return;
@ -486,7 +486,7 @@ void PlayerUpdateArmor(SWPlayer* pp, short value)
//
//---------------------------------------------------------------------------
int WeaponOperate(SWPlayer* pp)
int WeaponOperate(DSWPlayer* pp)
{
short weapon;
DSWActor* plActor = pp->GetActor();
@ -710,7 +710,7 @@ int WeaponOperate(SWPlayer* pp)
//
//---------------------------------------------------------------------------
bool WeaponOK(SWPlayer* pp)
bool WeaponOK(DSWPlayer* pp)
{
short min_ammo, WeaponNum, FindWeaponNum;
static const uint8_t wpn_order[] = {2,3,4,5,6,7,8,9,1,0};
@ -990,7 +990,7 @@ void SpecialUziRetractFunc(PANEL_SPRITE* psp)
//
//---------------------------------------------------------------------------
void RetractCurWpn(SWPlayer* pp)
void RetractCurWpn(DSWPlayer* pp)
{
// Retract old weapon
if (pp->CurWpn)
@ -1033,7 +1033,7 @@ void RetractCurWpn(SWPlayer* pp)
//
//---------------------------------------------------------------------------
void InitWeaponSword(SWPlayer* pp)
void InitWeaponSword(DSWPlayer* pp)
{
PANEL_SPRITE* psp;
short rnd_num;
@ -1485,7 +1485,7 @@ void pStarRestTest(PANEL_SPRITE* psp)
//
//---------------------------------------------------------------------------
void InitWeaponStar(SWPlayer* pp)
void InitWeaponStar(DSWPlayer* pp)
{
PANEL_SPRITE* psp = nullptr;
@ -2093,7 +2093,7 @@ void pUziReloadRetract(PANEL_SPRITE* nclip)
void pUziDoneReload(PANEL_SPRITE* psp)
{
SWPlayer* pp = psp->PlayerP;
DSWPlayer* pp = psp->PlayerP;
if (psp->flags & (PANF_PRIMARY) && pp->WpnUziType == 3)
@ -2180,7 +2180,7 @@ void pUziClip(PANEL_SPRITE* oclip)
//
//---------------------------------------------------------------------------
void InitWeaponUzi(SWPlayer* pp)
void InitWeaponUzi(DSWPlayer* pp)
{
PANEL_SPRITE* psp = nullptr;
@ -2269,7 +2269,7 @@ void InitWeaponUzi(SWPlayer* pp)
PANEL_SPRITE* InitWeaponUzi2(PANEL_SPRITE* uzi_orig)
{
PANEL_SPRITE* New;
SWPlayer* pp = uzi_orig->PlayerP;
DSWPlayer* pp = uzi_orig->PlayerP;
// There is already a second uzi, or it's retracting
@ -2310,7 +2310,7 @@ PANEL_SPRITE* InitWeaponUzi2(PANEL_SPRITE* uzi_orig)
PANEL_SPRITE* InitWeaponUziSecondaryReload(PANEL_SPRITE* uzi_orig)
{
PANEL_SPRITE* New;
SWPlayer* pp = uzi_orig->PlayerP;
DSWPlayer* pp = uzi_orig->PlayerP;
New = pSpawnSprite(pp, ps_PresentUzi, PRI_MID, 160 - UZI_XOFF, UZI_YOFF);
New->pos.Y += pspheight(New);
@ -2567,7 +2567,7 @@ void pUziAction(PANEL_SPRITE* psp)
void pUziFire(PANEL_SPRITE* psp)
{
SWPlayer* pp = psp->PlayerP;
DSWPlayer* pp = psp->PlayerP;
if (!WeaponOK(psp->PlayerP))
return;
@ -2698,7 +2698,7 @@ PANEL_STATE ps_Uzi2Shell[] =
void SpawnUziShell(PANEL_SPRITE* psp)
{
SWPlayer* pp = psp->PlayerP;
DSWPlayer* pp = psp->PlayerP;
if (psp->State && (psp->State->flags & psf_Xflip))
{
@ -2773,7 +2773,7 @@ PANEL_STATE ps_ShotgunShell[] =
void SpawnShotgunShell(PANEL_SPRITE* psp)
{
SWPlayer* pp = psp->PlayerP;
DSWPlayer* pp = psp->PlayerP;
SpawnShell(pp->GetActor(),-4);
}
@ -2920,7 +2920,7 @@ PANEL_STATE ps_RetractShotgun[] =
//
//---------------------------------------------------------------------------
void InitWeaponShotgun(SWPlayer* pp)
void InitWeaponShotgun(DSWPlayer* pp)
{
PANEL_SPRITE* psp = nullptr;
@ -3468,7 +3468,7 @@ PANEL_STATE ps_RetractRail[] =
//
//---------------------------------------------------------------------------
void InitWeaponRail(SWPlayer* pp)
void InitWeaponRail(DSWPlayer* pp)
{
PANEL_SPRITE* psp = nullptr;
@ -3971,7 +3971,7 @@ void pHotHeadOverlays(PANEL_SPRITE* psp, short mode)
#define HOTHEAD_XOFF (200 + HOTHEAD_BOB_X_AMT + 6)
#define HOTHEAD_YOFF 200
void InitWeaponHothead(SWPlayer* pp)
void InitWeaponHothead(DSWPlayer* pp)
{
PANEL_SPRITE* psp = nullptr;
@ -4272,7 +4272,7 @@ PANEL_STATE ps_OnFire[] =
//
//---------------------------------------------------------------------------
void SpawnOnFire(SWPlayer* pp)
void SpawnOnFire(DSWPlayer* pp)
{
PANEL_SPRITE* fire;
int x = 50;
@ -4451,7 +4451,7 @@ void pMicroSetRecoil(PANEL_SPRITE* psp)
//
//---------------------------------------------------------------------------
void InitWeaponMicro(SWPlayer* pp)
void InitWeaponMicro(DSWPlayer* pp)
{
PANEL_SPRITE* psp;
@ -4565,7 +4565,7 @@ void pMicroRecoilUp(PANEL_SPRITE* psp)
void pMicroPresent(PANEL_SPRITE* psp)
{
SWPlayer* pp = psp->PlayerP;
DSWPlayer* pp = psp->PlayerP;
if (psp->PlayerP->Flags & (PF_WEAPON_RETRACT))
return;
@ -4743,7 +4743,7 @@ PANEL_STATE ps_MicroNukeFlash[] =
void pMicroRest(PANEL_SPRITE* psp)
{
SWPlayer* pp = psp->PlayerP;
DSWPlayer* pp = psp->PlayerP;
bool force = !!(psp->flags & PANF_UNHIDE_SHOOT);
if (pWeaponHideKeys(psp, ps_MicroHide))
@ -4877,7 +4877,7 @@ void pMicroRetract(PANEL_SPRITE* psp)
void pNukeAction(PANEL_SPRITE* psp)
{
SWPlayer* pp = psp->PlayerP;
DSWPlayer* pp = psp->PlayerP;
#if 0 // Code commented out as it's causing interpolation issues when initialising a nuke.
psp->backupy();
@ -4904,7 +4904,7 @@ void pNukeAction(PANEL_SPRITE* psp)
void pMicroStandBy(PANEL_SPRITE* psp)
{
SWPlayer* pp = psp->PlayerP;
DSWPlayer* pp = psp->PlayerP;
pMicroOverlays(psp);
PlaySound(DIGI_NUKESTDBY, pp, v3df_follow|v3df_dontpan, CHAN_WEAPON);
@ -4912,14 +4912,14 @@ void pMicroStandBy(PANEL_SPRITE* psp)
void pMicroCount(PANEL_SPRITE* psp)
{
SWPlayer* pp = psp->PlayerP;
DSWPlayer* pp = psp->PlayerP;
PlaySound(DIGI_NUKECDOWN, pp, v3df_follow|v3df_dontpan, CHAN_WEAPON);
}
void pMicroReady(PANEL_SPRITE* psp)
{
SWPlayer* pp = psp->PlayerP;
DSWPlayer* pp = psp->PlayerP;
PlaySound(DIGI_NUKEREADY, pp, v3df_follow|v3df_dontpan, CHAN_WEAPON);
pp->NukeInitialized = true;
@ -4997,7 +4997,7 @@ PANEL_STATE ps_RetractHeart[] =
//
//---------------------------------------------------------------------------
void InitWeaponHeart(SWPlayer* pp)
void InitWeaponHeart(DSWPlayer* pp)
{
PANEL_SPRITE* psp;
@ -5188,7 +5188,7 @@ void pHeartActionBlood(PANEL_SPRITE* psp)
SpawnHeartBlood(psp);
}
void InitHeartAttack(SWPlayer* pp);
void InitHeartAttack(DSWPlayer* pp);
//---------------------------------------------------------------------------
//
@ -5198,7 +5198,7 @@ void InitHeartAttack(SWPlayer* pp);
void pHeartAttack(PANEL_SPRITE* psp)
{
SWPlayer* pp = psp->PlayerP;
DSWPlayer* pp = psp->PlayerP;
// CTW MODIFICATION
//int InitHeartAttack(PLAYER* pp);
// CTW MODIFICATION END
@ -5270,7 +5270,7 @@ PANEL_STATE ps_HeartBloodSmall[] =
void SpawnHeartBlood(PANEL_SPRITE* psp)
{
SWPlayer* pp = psp->PlayerP;
DSWPlayer* pp = psp->PlayerP;
PANEL_SPRITE* blood;
PANEL_SHRAP* hsp;
@ -5315,7 +5315,7 @@ void SpawnHeartBlood(PANEL_SPRITE* psp)
void SpawnSmallHeartBlood(PANEL_SPRITE* psp)
{
SWPlayer* pp = psp->PlayerP;
DSWPlayer* pp = psp->PlayerP;
PANEL_SPRITE* blood;
PANEL_SHRAP* hsp;
@ -5553,7 +5553,7 @@ void pGrenadePresentSetup(PANEL_SPRITE* psp)
//
//---------------------------------------------------------------------------
void InitWeaponGrenade(SWPlayer* pp)
void InitWeaponGrenade(DSWPlayer* pp)
{
PANEL_SPRITE* psp;
@ -5857,7 +5857,7 @@ PANEL_STATE ps_RetractMine[] =
//#define MINE_XOFF (160+20)
#define MINE_XOFF (160+50)
void InitWeaponMine(SWPlayer* pp)
void InitWeaponMine(DSWPlayer* pp)
{
PANEL_SPRITE* psp;
@ -5911,7 +5911,7 @@ void InitWeaponMine(SWPlayer* pp)
void pMineUpSound(PANEL_SPRITE* psp)
{
SWPlayer* pp = psp->PlayerP;
DSWPlayer* pp = psp->PlayerP;
PlaySound(DIGI_MINE_UP, pp, v3df_follow);
}
@ -6190,7 +6190,7 @@ PANEL_STATE ps_ChopsRetract[] =
//
//---------------------------------------------------------------------------
void InitChops(SWPlayer* pp)
void InitChops(DSWPlayer* pp)
{
PANEL_SPRITE* psp;
@ -6339,7 +6339,7 @@ void pChopsWait(PANEL_SPRITE* psp)
//
//---------------------------------------------------------------------------
void ChopsSetRetract(SWPlayer* pp)
void ChopsSetRetract(DSWPlayer* pp)
{
if (pp == nullptr || pp->Chops == nullptr)
return;
@ -6615,7 +6615,7 @@ PANEL_STATE ps_RetractFist[] =
//
//---------------------------------------------------------------------------
void InitWeaponFist(SWPlayer* pp)
void InitWeaponFist(DSWPlayer* pp)
{
PANEL_SPRITE* psp;
short rnd_num;
@ -7066,7 +7066,7 @@ void pFistBlock(PANEL_SPRITE* psp)
void pWeaponForceRest(SWPlayer* pp)
void pWeaponForceRest(DSWPlayer* pp)
{
pSetState(pp->CurWpn, pp->CurWpn->RestState);
}
@ -7171,7 +7171,7 @@ bool pWeaponHideKeys(PANEL_SPRITE* psp, PANEL_STATE* state)
//
//---------------------------------------------------------------------------
void InsertPanelSprite(SWPlayer* pp, PANEL_SPRITE* psp)
void InsertPanelSprite(DSWPlayer* pp, PANEL_SPRITE* psp)
{
PANEL_SPRITE* cur,* nxt;
@ -7219,7 +7219,7 @@ void InsertPanelSprite(SWPlayer* pp, PANEL_SPRITE* psp)
//
//---------------------------------------------------------------------------
PANEL_SPRITE* pSpawnSprite(SWPlayer* pp, PANEL_STATE* state, uint8_t priority, double x, double y)
PANEL_SPRITE* pSpawnSprite(DSWPlayer* pp, PANEL_STATE* state, uint8_t priority, double x, double y)
{
unsigned i;
PANEL_SPRITE* psp;
@ -7287,7 +7287,7 @@ void pKillSprite(PANEL_SPRITE* psp)
//
//---------------------------------------------------------------------------
void pClearSpriteList(SWPlayer* pp)
void pClearSpriteList(DSWPlayer* pp)
{
PANEL_SPRITE* psp = nullptr, * next_psp = nullptr;
auto l = &pp->PanelSpriteList;
@ -7363,7 +7363,7 @@ void pWeaponBob(PANEL_SPRITE* psp, short condition)
//////////////////////////////////////////////////////////////////////////////////////////
bool DrawBeforeView = false;
void pDisplaySprites(SWPlayer* pp, double interpfrac)
void pDisplaySprites(DSWPlayer* pp, double interpfrac)
{
DSWActor* plActor = pp->GetActor();
PANEL_SPRITE* next=nullptr;
@ -7656,7 +7656,7 @@ void pDisplaySprites(SWPlayer* pp, double interpfrac)
//
//---------------------------------------------------------------------------
void pSpriteControl(SWPlayer* pp)
void pSpriteControl(DSWPlayer* pp)
{
PANEL_SPRITE* next=nullptr;

View file

@ -109,7 +109,7 @@ struct PANEL_SPRITE
PANEL_SPRITE* Next, * Prev;
PANEL_SPRITE* sibling;
PANEL_STATE* State, *RetractState, *PresentState, *ActionState, *RestState;
SWPlayer* PlayerP;
DSWPlayer* PlayerP;
DVector2 pos, opos, bobpos;
PANEL_SPRITE_OVERLAY over[8];
@ -177,16 +177,16 @@ enum
};
PANEL_SPRITE* pSpawnSprite(SWPlayer* pp, PANEL_STATE* state, uint8_t priority, double x, double y);
PANEL_SPRITE* pSpawnSprite(DSWPlayer* pp, PANEL_STATE* state, uint8_t priority, double x, double y);
void pSetSuicide(PANEL_SPRITE* psp);
bool pKillScreenSpiteIDs(SWPlayer* pp, short id);
bool pKillScreenSpiteIDs(DSWPlayer* pp, short id);
void PreUpdatePanel(double interpfrac);
void UpdatePanel(double interpfrac);
void PlayerUpdateArmor(SWPlayer* pp,short value);
void PlayerUpdateArmor(DSWPlayer* pp,short value);
void pToggleCrosshair(void);
void pKillSprite(PANEL_SPRITE* psp);
void InitChops(SWPlayer* pp);
void ChopsSetRetract(SWPlayer* pp);
void InitChops(DSWPlayer* pp);
void ChopsSetRetract(DSWPlayer* pp);
END_SW_NS

Some files were not shown because too many files have changed in this diff Show more