- lightened player.h a bit more.

This commit is contained in:
Christoph Oelckers 2020-07-06 23:50:14 +02:00
parent dca7e158bb
commit 43ff87f47f
12 changed files with 23 additions and 49 deletions

View file

@ -499,12 +499,20 @@ enum
EVENT_MAXEVENT = EVENT_NUMEVENTS - 1
};
enum
enum miscConstants
{
MAXSLEEPDIST = 16384,
SLEEPTIME = 1536,
ZOFFSET6 = (4 << 8),
FOURSLEIGHT = (1 << 8)
FOURSLEIGHT = (1 << 8),
MOVEFIFOSIZ =256,
HORIZ_MIN =-99,
HORIZ_MAX =299,
AUTO_AIM_ANGLE =48,
PHEIGHT_DUKE =(38<<8),
PHEIGHT_RR =(40<<8)
};
enum

View file

@ -252,6 +252,7 @@ void initactorflags_r()
TILE_HURTRAIL = HURTRAIL;
TILE_FLOORPLASMA = FLOORPLASMA;
PHEIGHT = PHEIGHT_RR;
}
END_DUKE_NS

View file

@ -28,25 +28,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "net.h"
#include "tarray.h"
#include "constants.h"
#include "types.h"
BEGIN_DUKE_NS
extern int32_t playerswhenstarted;
#define MOVEFIFOSIZ 256
#define HORIZ_MIN -99
#define HORIZ_MAX 299
#define AUTO_AIM_ANGLE 48
#define PHEIGHT_DUKE (38<<8)
#define PHEIGHT_RR (40<<8);
extern int32_t PHEIGHT;
#define WEAPON_POS_LOWER -9
#define WEAPON_POS_RAISE 10
#define WEAPON_POS_START 6
#define MAX_WEAPON_RECS 256
enum gamemode_t {
MODE_MENU = 0x00000001,
@ -55,19 +44,9 @@ enum gamemode_t {
MODE_EOL = 0x00000008,
MODE_TYPE = 0x00000010,
MODE_RESTART = 0x00000020,
MODE_SENDTOWHOM = 0x00000040,
};
typedef struct {
ESyncBits bits;
int16_t fvel, svel;
fix16_t q16avel, q16horz;
} input_t;
#pragma pack(push,1)
// KEEPINSYNC lunatic/_defs_game.lua
typedef struct
{
struct player_struct *ps;
@ -81,13 +60,11 @@ typedef struct
// NOTE: wchoice[HANDREMOTE_WEAPON .. MAX_WEAPONS-1] unused
uint8_t frags[MAXPLAYERS];
char playerreadyflag, playerquitflag, connected;
char user_name[32];
char syncval[SYNCFIFOSIZ][MAXSYNCBYTES];
double lastInputTicks;
} playerdata_t;
#pragma pack(pop)
# define PWEAPON(Player, Weapon, Wmember) (aplWeapon ## Wmember [Weapon][Player])

View file

@ -3109,8 +3109,7 @@ HORIZONLY:
if (p->horizoff > -5 && p->horizoff < 5) p->horizoff = 0;
}
if (p->horiz > 299) p->horiz = 299;
else if (p->horiz < -99) p->horiz = -99;
horiz = clamp(horiz, HORIZ_MIN, HORIZ_MAX);
#endif
//Shooting code/changes

View file

@ -4208,8 +4208,7 @@ HORIZONLY:
if (p->horizoff > -5 && p->horizoff < 5) p->horizoff = 0;
}
if (p->horiz > 299) p->horiz = 299;
else if (p->horiz < -99) p->horiz = -99;
horiz = clamp(horiz, HORIZ_MIN, HORIZ_MAX);
#endif
//Shooting code/changes

View file

@ -514,8 +514,7 @@ FAKEHORIZONLY:
myhoriz -= (myhardlanding<<4);
}
if (myhoriz > 299) myhoriz = 299;
else if (myhoriz < -99) myhoriz = -99;
myhoriz = clamp(myhoriz, HORIZ_MIN, HORIZ_MAX);
if(p->knee_incs > 0)
{

View file

@ -681,7 +681,6 @@ void enterlevel(char g)
displayrooms(myconnectindex,65536);
displayrest(screenpeek);
clearbufbyte(playerquitflag,MAXPLAYERS,0x01010101);
ps[myconnectindex].over_shoulder_on = 0;
clearfrags();

View file

@ -989,7 +989,6 @@ void loadlevel(const char *filename)
displayrest(screenpeek);
nextpage();
clearbufbyte(playerquitflag,MAXPLAYERS,0x01010101);
if (waitabort == 1)
gameexit(" ");
ps[myconnectindex].over_shoulder_on = 0;

View file

@ -608,8 +608,7 @@ void displayrooms(int snum, int smoothratio)
if (cposz > fz - (4 << 8)) cposz = fz - (4 << 8);
}
if (choriz > 299) choriz = 299;
else if (choriz < -99) choriz = -99;
choriz = clamp(choriz, HORIZ_MIN, HORIZ_MAX);
if (isRR() && sector[sect].lotag == 848)
{

View file

@ -34,6 +34,13 @@ struct ActorInfo
int aimoffset;
};
struct input_t // original name was input which is too generic for a type name.
{
fixed_t q16avel, q16horz; // These were expanded to 16.16 fixed point.
short fvel, svel;
ESyncBits bits;
};
struct player_orig
{
int ox, oy, oz;

View file

@ -354,8 +354,6 @@ inline int G_CheckPlayerColor(int color)
static void G_Startup(void)
{
int32_t i;
timerInit(TICRATE);
timerSetCallback(gameTimerHandler);
@ -398,11 +396,6 @@ static void G_Startup(void)
strncpy(boardfilename, startupMap, BMAX_PATH);
}
for (i=0; i<MAXPLAYERS; i++)
g_player[i].playerreadyflag = 0;
Net_GetPackets();
if (numplayers > 1)
Printf("Multiplayer initialized.\n");
@ -677,8 +670,6 @@ int GameInterface::app_main()
G_Startup(); // a bunch of stuff including compiling cons
g_player[0].playerquitflag = 1;
g_player[myconnectindex].ps->palette = BASEPAL;
for (int i=1, j=numplayers; j<ud.multimode; j++)

View file

@ -1431,10 +1431,6 @@ static void postloadplayer(int32_t savegamep)
if (savegamep)
everyothertime = 0;
//7
for (i=0; i<MAXPLAYERS; i++)
g_player[i].playerquitflag = 1;
// ----------
//7.5