Skip to content

Commit

Permalink
ticrate fixes in native code
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoLuis0 authored and madame-rachelle committed Dec 22, 2022
1 parent a90bc82 commit 9376c4d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
13 changes: 4 additions & 9 deletions src/am_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/common/utility/i_time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <thread>
#include <assert.h>
#include "i_time.h"
#include "doomdef.h"

//==========================================================================
//
Expand All @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/d_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -3706,7 +3706,7 @@ CCMD(debug_SetTicRate)
int GameMain()
{
int ret = 0;
GameTicRate = TICRATE;
//GameTicRate = DEFAULT_TICRATE;
I_InitTime();

ConsoleCallbacks cb = {
Expand Down
6 changes: 5 additions & 1 deletion src/doomdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9376c4d

Please sign in to comment.