ticrate fixes in native code

This commit is contained in:
Ricardo Luís Vaz Silva 2022-12-22 17:44:09 -03:00 committed by Rachael Alexanderson
parent a90bc82959
commit 9376c4deb4
4 changed files with 13 additions and 13 deletions

View file

@ -899,11 +899,6 @@ class DAutomap :public DAutomapBase
{
DECLARE_CLASS(DAutomap, DAutomapBase)
enum
{
F_PANINC = 140 / TICRATE, // how much the automap moves window per tic in frame-buffer coordinates moves 140 pixels at 320x200 in 1 second
};
//FLevelLocals *Level;
// scale on entry
// used by MTOF to scale from map-to-frame-buffer coords
@ -3202,13 +3197,13 @@ void DAutomap::Drawer (int bottom)
{
m_paninc.x = m_paninc.y = 0;
if (buttonMap.ButtonDown(Button_AM_PanLeft))
m_paninc.x -= FTOM(F_PANINC) * delta * TICRATE;
m_paninc.x -= FTOM(140 / TICRATE /*F_PANINC*/) * delta * TICRATE;
if (buttonMap.ButtonDown(Button_AM_PanRight))
m_paninc.x += FTOM(F_PANINC) * delta * TICRATE;
m_paninc.x += FTOM(140 / TICRATE /*F_PANINC*/) * delta * TICRATE;
if (buttonMap.ButtonDown(Button_AM_PanUp))
m_paninc.y += FTOM(F_PANINC) * delta * TICRATE;
m_paninc.y += FTOM(140 / TICRATE /*F_PANINC*/) * delta * TICRATE;
if (buttonMap.ButtonDown(Button_AM_PanDown))
m_paninc.y -= FTOM(F_PANINC) * delta * TICRATE;
m_paninc.y -= FTOM(140 / TICRATE /*F_PANINC*/) * delta * TICRATE;
}
// Change the zoom if necessary

View file

@ -37,6 +37,7 @@
#include <thread>
#include <assert.h>
#include "i_time.h"
#include "doomdef.h"
//==========================================================================
//
@ -49,7 +50,7 @@ static uint64_t FirstFrameStartTime;
static uint64_t CurrentFrameStartTime;
static uint64_t FreezeTime;
static double lastinputtime;
int GameTicRate = 35; // make sure it is not 0, even if the client doesn't set it.
int GameTicRate = DEFAULT_TICRATE; // make sure it is not 0, even if the client doesn't set it.
double TimeScale = 1.0;

View file

@ -1336,7 +1336,7 @@ void D_DoStrifeAdvanceDemo ()
case 1:
// [RH] Strife fades to black and then to the Rogue logo, but
// I think it looks better if it doesn't fade.
pagetic = 10 * TICRATE/35;
pagetic = 10;
pagename = ""; // PANEL0, but strife0.wad doesn't have it, so don't use it.
PageBlank = true;
S_Sound (CHAN_VOICE, CHANF_UI, "bishop/active", 1, ATTN_NORM);
@ -3706,7 +3706,7 @@ CCMD(debug_SetTicRate)
int GameMain()
{
int ret = 0;
GameTicRate = TICRATE;
//GameTicRate = DEFAULT_TICRATE;
I_InitTime();
ConsoleCallbacks cb = {

View file

@ -58,7 +58,11 @@ typedef enum
#endif
// State updates, number of tics / second.
constexpr int TICRATE = 35;
constexpr int DEFAULT_TICRATE = 35;
extern int GameTicRate;
#define TICRATE GameTicRate
// Global constants that were defines.
enum