mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 21:41:03 +00:00
ticrate fixes in native code
This commit is contained in:
parent
a90bc82959
commit
9376c4deb4
4 changed files with 13 additions and 13 deletions
|
@ -899,11 +899,6 @@ class DAutomap :public DAutomapBase
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(DAutomap, 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;
|
//FLevelLocals *Level;
|
||||||
// scale on entry
|
// scale on entry
|
||||||
// used by MTOF to scale from map-to-frame-buffer coords
|
// 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;
|
m_paninc.x = m_paninc.y = 0;
|
||||||
if (buttonMap.ButtonDown(Button_AM_PanLeft))
|
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))
|
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))
|
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))
|
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
|
// Change the zoom if necessary
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "i_time.h"
|
#include "i_time.h"
|
||||||
|
#include "doomdef.h"
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
|
@ -49,7 +50,7 @@ static uint64_t FirstFrameStartTime;
|
||||||
static uint64_t CurrentFrameStartTime;
|
static uint64_t CurrentFrameStartTime;
|
||||||
static uint64_t FreezeTime;
|
static uint64_t FreezeTime;
|
||||||
static double lastinputtime;
|
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;
|
double TimeScale = 1.0;
|
||||||
|
|
||||||
|
|
|
@ -1336,7 +1336,7 @@ void D_DoStrifeAdvanceDemo ()
|
||||||
case 1:
|
case 1:
|
||||||
// [RH] Strife fades to black and then to the Rogue logo, but
|
// [RH] Strife fades to black and then to the Rogue logo, but
|
||||||
// I think it looks better if it doesn't fade.
|
// 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.
|
pagename = ""; // PANEL0, but strife0.wad doesn't have it, so don't use it.
|
||||||
PageBlank = true;
|
PageBlank = true;
|
||||||
S_Sound (CHAN_VOICE, CHANF_UI, "bishop/active", 1, ATTN_NORM);
|
S_Sound (CHAN_VOICE, CHANF_UI, "bishop/active", 1, ATTN_NORM);
|
||||||
|
@ -3706,7 +3706,7 @@ CCMD(debug_SetTicRate)
|
||||||
int GameMain()
|
int GameMain()
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
GameTicRate = TICRATE;
|
//GameTicRate = DEFAULT_TICRATE;
|
||||||
I_InitTime();
|
I_InitTime();
|
||||||
|
|
||||||
ConsoleCallbacks cb = {
|
ConsoleCallbacks cb = {
|
||||||
|
|
|
@ -58,7 +58,11 @@ typedef enum
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// State updates, number of tics / second.
|
// 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.
|
// Global constants that were defines.
|
||||||
enum
|
enum
|
||||||
|
|
Loading…
Reference in a new issue