From 162e53a6d9c56d521ad6eaab0b47a2e0554c77ae Mon Sep 17 00:00:00 2001 From: Taylor Richards Date: Sun, 8 Mar 2015 23:29:57 -0400 Subject: [PATCH] use SDL hint for timer resolution (not needed; do it anyway) --- src/freespace2/freespace.cpp | 7 ------- src/io/timer.cpp | 4 +++- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/freespace2/freespace.cpp b/src/freespace2/freespace.cpp index c97fac8..7ffbd3d 100644 --- a/src/freespace2/freespace.cpp +++ b/src/freespace2/freespace.cpp @@ -2557,9 +2557,6 @@ void game_init() // Game_music_paused = 0; Game_paused = 0; -#ifndef PLAT_UNIX - timeBeginPeriod(1); -#endif nprintf(("General", "Ships.tbl is : %s\n", Game_ships_tbl_valid ? "VALID" : "INVALID!!!!")); nprintf(("General", "Weapons.tbl is : %s\n", Game_weapons_tbl_valid ? "VALID" : "INVALID!!!!")); @@ -6863,10 +6860,6 @@ void game_launch_launcher_on_exit() // void game_shutdown(void) { -#ifndef PLAT_UNIX - timeEndPeriod(1); -#endif - // don't ever flip a page on the standalone! if(!(Game_mode & GM_STANDALONE_SERVER)){ gr_reset_clip(); diff --git a/src/io/timer.cpp b/src/io/timer.cpp index 096748c..5614f3b 100644 --- a/src/io/timer.cpp +++ b/src/io/timer.cpp @@ -114,7 +114,9 @@ void timer_init() { if ( !Timer_inited ) { SDL_InitSubSystem(SDL_INIT_TIMER); - + + SDL_SetHint(SDL_HINT_TIMER_RESOLUTION, "1"); + Timer_inited = 1; atexit(timer_close); -- 2.39.2