Skip to content

Commit

Permalink
Minor Classic DOOM Framerate interpolation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MadDeCoDeR committed Nov 5, 2024
1 parent e618c08 commit 91a611c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion doomclassic/doom/d_net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,8 @@ bool TryRunTics ( idUserCmdMgr * userCmdMgr )

int engineHz_denominator = com_engineHz_denominator / 100LL;
int engine_diff = engineHz_denominator - com_engineHz_latched;
if (InterpolateTics() || !engine_diff) {
::g->runTic = InterpolateTics(); //GK: Kepp it in memory just in case
if (::g->runTic || !engine_diff) {
if (::g->advancedemo) {
D_DoAdvanceDemo();
}
Expand Down
4 changes: 2 additions & 2 deletions doomclassic/doom/g_game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ void G_BuildTiccmd (ticcmd_t* cmd, idUserCmdMgr * userCmdMgr, int newTics )
::g->prevMouseTime = currentTime;
}
float estimatedFPS = roundf(1000.0f * (1.0f/frameTime));
float engineHz_denominator = com_engineHz_denominator / 100.0f;
//float engineHz_denominator = com_engineHz_denominator / 100.0f;
float accelerator = estimatedFPS / com_engineHz_latched;
//I_Printf("Estimated FPS: %f, Accelerator: %f\n", estimatedFPS, accelerator);
if (accelerator >= 1) {
Expand Down Expand Up @@ -405,7 +405,7 @@ void G_BuildTiccmd (ticcmd_t* cmd, idUserCmdMgr * userCmdMgr, int newTics )
// if( oldImpulseSequence != curTech5Command.impulseSequence ) {
//int engineHz_denominator = com_engineHz_denominator / 100;
cimpulse = G_PerformImpulse( curTech5Command.buttons, cmd );
if (cimpulse > 0 && circleWeaponPacifier >= ( engineHz_denominator / 2)) { //GK: Weapon change event happend
if (cimpulse > 0 && circleWeaponPacifier >= (estimatedFPS / 2)) { //GK: Weapon change event happend
circleWeaponPacifier = 0;
if (!::g->demorecording) {
/*cmd->buttons |= BT_CHANGE;
Expand Down
4 changes: 3 additions & 1 deletion doomclassic/doom/vars.h
Original file line number Diff line number Diff line change
Expand Up @@ -1138,4 +1138,6 @@ int accumulatedTimeDelta;
int accumulatedTimeDelta2;

//GK: Mouse Acceleration Fix
int prevMouseTime;
int prevMouseTime;

bool runTic;

0 comments on commit 91a611c

Please sign in to comment.