- Set up initial implementation of CorePlayer struct and make game-side player structs inherit from it.

This commit is contained in:
Mitchell Richters 2023-10-02 11:28:09 +11:00
parent 6a7eabd23f
commit 6beec5eed2
5 changed files with 18 additions and 20 deletions

10
source/core/coreplayer.h Normal file
View file

@ -0,0 +1,10 @@
#pragma once
#include "packet.h"
#include "gameinput.h"
struct CorePlayer
{
InputPacket input;
PlayerAngles Angles;
};

View file

@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "dude.h"
#include "levels.h"
#include "qav.h"
#include "gameinput.h"
#include "coreplayer.h"
BEGIN_BLD_NS
@ -78,12 +78,10 @@ struct POSTURE
extern POSTURE gPostureDefaults[kModeMax][kPostureMax];
struct BloodPlayer
struct BloodPlayer final : public CorePlayer
{
DBloodActor* actor;
DUDEINFO* pDudeInfo;
InputPacket input;
PlayerAngles Angles;
uint8_t newWeapon;
int weaponQav;
int qavCallback;

View file

@ -3,7 +3,7 @@
#include "names.h"
#include "packet.h"
#include "d_net.h"
#include "gameinput.h"
#include "coreplayer.h"
#include "texturemanager.h"
BEGIN_DUKE_NS
@ -224,16 +224,13 @@ struct player_orig
sectortype* os;
};
struct DukePlayer
struct DukePlayer final : public CorePlayer
{
DVector3 vel;
DVector2 bobpos;
DVector2 fric;
DVector2 Exit;
// player's horizon and angle structs.
PlayerAngles Angles;
uint16_t frags[MAXPLAYERS];
bool gotweapon[MAX_WEAPONS];
@ -348,9 +345,6 @@ struct DukePlayer
TArray<GameVarValue> uservars;
// input stuff.
InputPacket input;
DDukeActor* actor;
int GetPlayerNum();

View file

@ -19,7 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#pragma once
#include "gamecontrol.h"
#include "gameinput.h"
#include "coreplayer.h"
BEGIN_PS_NS
@ -47,7 +47,7 @@ struct PlayerSave
DAngle nAngle;
};
struct ExhumedPlayer
struct ExhumedPlayer final : public CorePlayer
{
DExhumedActor* actor;
int16_t nHealth;
@ -73,8 +73,6 @@ struct ExhumedPlayer
int16_t nLastWeapon;
int16_t nRun;
InputPacket input;
PlayerAngles Angles;
sectortype* pPlayerPushSect;
sectortype* pPlayerViewSect;

View file

@ -45,7 +45,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "gamecontrol.h"
#include "gamestruct.h"
#include "packet.h"
#include "gameinput.h"
#include "coreplayer.h"
#include "serialize_obj.h"
#include "texturemanager.h"
#include "states.h"
@ -1676,7 +1676,7 @@ END_SW_NS
BEGIN_SW_NS
struct SWPlayer
struct SWPlayer final : public CorePlayer
{
DSWActor* actor; // this may not be a TObjPtr!
TObjPtr<DSWActor*> lowActor, highActor;
@ -1725,7 +1725,6 @@ struct SWPlayer
bool insector() const { return cursector != nullptr; }
// variables that do not fit into sprite structure
PlayerAngles Angles;
double recoil_amt;
int16_t recoil_speed;
int16_t recoil_ndx;
@ -1747,7 +1746,6 @@ struct SWPlayer
double bob_z, obob_z;
//Multiplayer variables
InputPacket input;
InputPacket lastinput;
// must start out as 0