- Exhumed: Unify game with single timer instead of getting forward/side velocity at 120Hz.

* Player movement is close, but not exactly as it was. Requires more work if it is to be considered.

# Conflicts:
#	source/exhumed/src/exhumed.cpp
#	source/exhumed/src/ps_input.h
This commit is contained in:
Mitchell Richters 2020-08-26 17:19:50 +10:00 committed by Christoph Oelckers
parent f90d953ab5
commit 0c300c181f
9 changed files with 4 additions and 64 deletions

View file

@ -60,7 +60,6 @@ enum {
kSectLava = 0x4000,
};
extern int ogameclock;
extern int initx;
extern int inity;
extern int initz;
@ -114,10 +113,6 @@ void GrabMap();
void UpdateMap();
void DrawMap();
// network
extern short nNetMoveFrames;
// random
void InitRandom();

View file

@ -30,7 +30,6 @@ BEGIN_PS_NS
void resettiming()
{
ogameclock = -1;
gameclock = 0;
lastTic = -1;
}

View file

@ -125,7 +125,6 @@ int nNetPlayerCount = 0;
short nClockVal;
short nRedTicks;
short bInMove;
short nAlarmTicks;
short nButtonColor;
short nEnergyChan;
@ -150,7 +149,6 @@ short nCodeIndex = 0;
//short nScreenWidth = 320;
//short nScreenHeight = 200;
int moveframes;
int flash;
int totalmoves;
@ -466,14 +464,11 @@ void GameMove(void)
// loc_120E9:
totalmoves++;
moveframes--;
}
void GameTicker()
{
bInMove = true;
int const currentTic = I_GetTime();
gameclock = I_GetBuildTime();
@ -483,12 +478,9 @@ void GameTicker()
}
else
{
while ((gameclock - ogameclock) >= 1 || !bInMove)
while (!EndLevel && currentTic - lastTic >= 1)
{
ogameclock = I_GetBuildTime();
if (!((int)ogameclock & 3) && moveframes < 4)
moveframes++;
lastTic = currentTic;
int lLocalButtons = GetLocalInput(); // shouldn't this be placed in localInput?
PlayerInterruptKeys();
@ -516,22 +508,14 @@ void GameTicker()
sPlayerInput[nLocalPlayer].horizon = PlayerList[nLocalPlayer].q16horiz;
while (!EndLevel && currentTic - lastTic >= 1)
{
lastTic = currentTic;
leveltime++;
GameMove();
}
}
if (nPlayerLives[nLocalPlayer] <= 0) {
startmainmenu();
}
}
bInMove = false;
}
int32_t r_maxfpsoffset = 0;
void ExitGame()
@ -740,7 +724,6 @@ static SavegameHelper sgh("exhumed",
SV(nEnergyChan),
SV(lCountDown),
SV(nEnergyTowers),
SV(moveframes),
SV(totalmoves),
SV(nCurBodyNum),
SV(nBodyTotal),

View file

@ -144,8 +144,6 @@ extern char sHollyStr[];
extern int selectedlevelnew;
extern int GameAction;
extern int moveframes;
extern int nNetPlayerCount;
extern int htimer;
@ -203,7 +201,6 @@ extern short nClockVal;
extern short bSlipMode;
extern int bVanilla;
extern short bInMove;
#define POWERSLAVE (g_gameType & GAMEFLAG_POWERSLAVE)
#define EXHUMED (g_gameType & GAMEFLAG_EXHUMED)

View file

@ -38,8 +38,6 @@ enum
kTagRamses = 61,
};
int ogameclock = 0;
int initx, inity, initz;
short inita, initsect;
@ -197,8 +195,6 @@ void InitLevel(int level)
totalmoves = 0;
GrabPalette();
ResetMoveFifo();
moveframes = 0;
bInMove = false;
nPlayerDAng = 0;
lPlayerXVel = 0;
lPlayerYVel = 0;
@ -228,12 +224,6 @@ void InitNewGame()
InitPlayerInventory(nPlayer);
}
nNetMoves = 0;
// PINK SECTION
UpdateInputs();
nNetMoves = 1;
}
void SetBelow(short nCurSector, short nBelowSector)

View file

@ -30,8 +30,6 @@ BEGIN_PS_NS
int WeaponToSend, BitsToSend;
int nNetMoves = 0;
short nInputStack = 0;
short bStackNode[kMaxPlayers];
@ -106,24 +104,6 @@ void SendInput()
}
short nNetMoveFrames = 0;
void UpdateInputs()
{
nNetMoveFrames = moveframes;
if (nNetPlayerCount)
{
//UpdateNetInputs();
nNetMoves++;
if (!nNetMoves) {
nNetMoves++;
}
}
}
void CheckKeys()
{
// go to 3rd person view?

View file

@ -47,8 +47,8 @@ struct PlayerSave
short nAngle;
};
fix16_t lPlayerXVel = 0;
fix16_t lPlayerYVel = 0;
int lPlayerXVel = 0;
int lPlayerYVel = 0;
fix16_t nPlayerDAng = 0;
short obobangle = 0, bobangle = 0;
short bPlayerPan = 0;

View file

@ -38,15 +38,12 @@ struct PlayerInput
void InitInput();
void UpdateInputs();
void ClearSpaceBar(short nPlayer);
int GetLocalInput();
extern PlayerInput sPlayerInput[];
extern InputPacket localInput;
extern int nNetMoves;
extern int lLocalCodes;
END_PS_NS

View file

@ -60,7 +60,6 @@ bool GameInterface::LoadGame(FSaveGameNode* sv)
pSky->yscale = 65536;
parallaxtype = 2;
g_visibility = 2048;
ogameclock = gameclock;
GameAction = 1000;
if (currentLevel->levelNumber > 15)