From bda11c640176d8610bf0c236e34fa693d339d03a Mon Sep 17 00:00:00 2001 From: drfrag Date: Sun, 29 Dec 2019 15:29:10 +0100 Subject: [PATCH] - Fixed compilation. # Conflicts: # src/win32/win32video.cpp --- src/d_main.cpp | 6 +++++- src/posix/cocoa/i_video.mm | 3 +-- src/posix/sdl/hardware.cpp | 3 +-- src/win32/hardware.cpp | 7 +------ src/win32/i_input.cpp | 12 ------------ src/win32/i_main.cpp | 13 ------------- src/win32/win32video.cpp | 7 +++---- 7 files changed, 11 insertions(+), 40 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index f522de245..199a77a05 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -132,6 +132,8 @@ void P_Shutdown(); void M_SaveDefaultsFinal(); void R_Shutdown(); void I_ShutdownInput(); +void StopFPSLimit(); +void I_DeleteRenderer(); const FIWADInfo *D_FindIWAD(TArray &wadfiles, const char *iwad, const char *basewad); @@ -2879,6 +2881,7 @@ int D_DoomMain() C_DeinitConsole(); R_DeinitColormaps(); R_Shutdown(); + I_DeleteRenderer(); I_ShutdownGraphics(); I_ShutdownInput(); M_SaveDefaultsFinal(); @@ -2913,7 +2916,8 @@ void D_Cleanup() AM_ClearColorsets(); DeinitSWColorMaps(); FreeSBarInfoScript(); - + StopFPSLimit(); + // clean up game state ST_Clear(); D_ErrorCleanup (); diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index 8d1d9413f..4a5f7b784 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -1203,7 +1203,7 @@ void I_InitGraphics() } -static void I_DeleteRenderer() +void I_DeleteRenderer() { delete Renderer; Renderer = NULL; @@ -1220,7 +1220,6 @@ void I_CreateRenderer() Renderer = 1 == currentrenderer ? gl_CreateInterface() : new FSoftwareRenderer; - atterm(I_DeleteRenderer); } } diff --git a/src/posix/sdl/hardware.cpp b/src/posix/sdl/hardware.cpp index 2a3f6df91..e275dc89e 100644 --- a/src/posix/sdl/hardware.cpp +++ b/src/posix/sdl/hardware.cpp @@ -131,7 +131,7 @@ void I_InitGraphics () Video->SetWindowedScale (vid_winscale); } -static void I_DeleteRenderer() +void I_DeleteRenderer() { if (Renderer != NULL) delete Renderer; } @@ -143,7 +143,6 @@ void I_CreateRenderer() { if (currentrenderer==1) Renderer = gl_CreateInterface(); else Renderer = new FSoftwareRenderer; - atterm(I_DeleteRenderer); } } diff --git a/src/win32/hardware.cpp b/src/win32/hardware.cpp index a7d4dfae3..25f5f19ad 100644 --- a/src/win32/hardware.cpp +++ b/src/win32/hardware.cpp @@ -37,10 +37,6 @@ #include "hardware.h" #include "win32iface.h" -#include "i_video.h" -#include "i_system.h" -#include "c_console.h" -#include "c_cvars.h" #include "c_dispatch.h" #include "v_text.h" #include "doomstat.h" @@ -193,7 +189,7 @@ void I_InitGraphics () Video->SetWindowedScale (vid_winscale); } -static void I_DeleteRenderer() +void I_DeleteRenderer() { if (Renderer != NULL) delete Renderer; } @@ -216,7 +212,6 @@ void I_CreateRenderer() { if (currentrenderer==1) Renderer = gl_CreateInterface(); else Renderer = new FSoftwareRenderer; - atterm(I_DeleteRenderer); } } diff --git a/src/win32/i_input.cpp b/src/win32/i_input.cpp index 426591b5a..5347b125a 100644 --- a/src/win32/i_input.cpp +++ b/src/win32/i_input.cpp @@ -46,16 +46,10 @@ #define INITGUID #endif #include -#include #include #include #include -#include -#include -#include -#include - #ifdef _MSC_VER #pragma warning(disable:4244) #endif @@ -78,7 +72,6 @@ #include "c_dispatch.h" -#include "doomtype.h" #include "doomdef.h" #include "doomstat.h" #include "m_argv.h" @@ -89,14 +82,9 @@ #include "d_main.h" #include "d_gui.h" #include "c_console.h" -#include "c_cvars.h" -#include "i_system.h" #include "s_sound.h" -#include "m_misc.h" #include "gameconfigfile.h" #include "win32iface.h" -#include "templates.h" -#include "cmdlib.h" #include "d_event.h" #include "v_text.h" #include "version.h" diff --git a/src/win32/i_main.cpp b/src/win32/i_main.cpp index 9ae1a67e8..f3ec695ab 100644 --- a/src/win32/i_main.cpp +++ b/src/win32/i_main.cpp @@ -49,7 +49,6 @@ //#include #define NOTIFY_FOR_THIS_SESSION 0 -#include #ifdef _MSC_VER #include #include @@ -57,27 +56,17 @@ #endif #include "resource.h" -#include -#include -#include - #include "doomerrors.h" #include "hardware.h" -#include "doomtype.h" #include "m_argv.h" #include "d_main.h" #include "i_module.h" -#include "i_system.h" #include "c_console.h" #include "version.h" -#include "i_video.h" -#include "i_sound.h" #include "i_input.h" #include "w_wad.h" -#include "templates.h" #include "cmdlib.h" -#include "g_level.h" #include "doomstat.h" #include "r_utility.h" #include "g_levellocals.h" @@ -91,8 +80,6 @@ #include "optwin32.h" -#include - // MACROS ------------------------------------------------------------------ // The main window's title. diff --git a/src/win32/win32video.cpp b/src/win32/win32video.cpp index f3ae3c831..307af8b7b 100644 --- a/src/win32/win32video.cpp +++ b/src/win32/win32video.cpp @@ -60,7 +60,6 @@ #include "c_dispatch.h" #include "templates.h" #include "i_system.h" -#include "atterm.h" #include "i_video.h" #include "v_video.h" #include "v_pfx.h" @@ -90,7 +89,7 @@ void DoBlending (const PalEntry *from, PalEntry *to, int count, int r, int g, in // PRIVATE FUNCTION PROTOTYPES --------------------------------------------- -static void StopFPSLimit(); +void StopFPSLimit(); // EXTERNAL DATA DECLARATIONS ---------------------------------------------- @@ -809,7 +808,7 @@ void I_SetFPSLimit(int limit) return; } } - atterm(StopFPSLimit); + // Set timer event as close as we can to limit/sec, in milliseconds. UINT period = 1000 / limit; FPSLimitTimer = timeSetEvent(period, 0, (LPTIMECALLBACK)FPSLimitEvent, 0, TIME_PERIODIC | TIME_CALLBACK_EVENT_SET); @@ -832,7 +831,7 @@ void I_SetFPSLimit(int limit) // //========================================================================== -static void StopFPSLimit() +void StopFPSLimit() { I_SetFPSLimit(0); }