summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authoraura <nw@moneybot.cc>2026-03-05 01:23:13 +0100
committeraura <nw@moneybot.cc>2026-03-05 01:23:13 +0100
commit7a37b56baed0cce79c228e9e1969917aa8db24dc (patch)
treefab9407b2c6250f981a39e6e24faadf3c82e08b2 /src/game.cpp
parent73045b6642348c8d2fd8b45cae305bbf0344d444 (diff)
giga improvement
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 2179255..b0071d0 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -18,6 +18,8 @@
#include "render/gl_batch.h"
#include "util.h"
+CVAR* g_timescale = var_new( "g_timescale", .5f );
+
static void game_realtime_resize_repaint( void* userdata );
GAME_DATA* game_init( GL_DATA* gl ) {
@@ -198,7 +200,7 @@ void game_main_loop( GAME_DATA* game ) {
void game_on_tick( GAME_DATA* game ) {
U64 tick = u_tick();
- if( tick - game->state.last_tick > (U64)(TICK_INTERVAL * 10000) ) {
+ if( tick - game->state.last_tick > (U64)(TICK_INTERVAL * 10000) * (1.f / var_getf( g_timescale )) ) {
player_move( game, objl->pl );
game->state.last_tick = tick;
}