From ec8efcadea377382b6e3c0b965468d9835ac8237 Mon Sep 17 00:00:00 2001 From: Overhaul Date: Sun, 22 Jul 2007 19:33:36 +0000 Subject: [PATCH] Added a missing header SGP_DEBUG is now exclusively for outputting huge amounts of debug info, made consistent in DEBUG.cpp Fix for slow bullets and other anims git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1099 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- MainMenuScreen.cpp | 1 + Standard Gaming Platform/DEBUG.cpp | 20 ++++++++++++++------ Standard Gaming Platform/sgp.cpp | 4 ++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/MainMenuScreen.cpp b/MainMenuScreen.cpp index 1329dc3e..b0527c03 100644 --- a/MainMenuScreen.cpp +++ b/MainMenuScreen.cpp @@ -32,6 +32,7 @@ #include "Multi Language Graphic Utils.h" #include "Encrypted File.h" #include "ja2 splash.h" + #include "GameVersion.h" #endif #define MAINMENU_TEXT_FILE "LoadScreens\\MainMenu.edt" diff --git a/Standard Gaming Platform/DEBUG.cpp b/Standard Gaming Platform/DEBUG.cpp index 73530c6b..5b25beea 100644 --- a/Standard Gaming Platform/DEBUG.cpp +++ b/Standard Gaming Platform/DEBUG.cpp @@ -16,7 +16,7 @@ // Because we're in a library, define SGP_DEBUG here - the client may not always // use the code to write text, because the header switches on the define -#define SGP_DEBUG +//#define SGP_DEBUG //#undef _DEBUG // WDS: Note: To compile with VS2005 in release mode you might have to not define SGP_DEBUG and @@ -487,9 +487,16 @@ void _DebugMessage(UINT8 *pString, UINT32 uiLineNum, UINT8 *pSourceFile) } #endif } +#else +BOOLEAN DbgInitialize(void) { return true; }; +void DbgShutdown(void) {}; +#endif +#if defined ( _DEBUG ) || defined ( FORCE_ASSERTS_ON ) + + ////////////////////////////////////////////////////////////////////// // This func is used by Assert() void _Null(void) @@ -504,7 +511,7 @@ void _FailMessage( STR8 pString, UINT32 uiLineNum, STR8 pSourceFile ) CHAR8 ubOutputString[512]; #ifndef _NO_DEBUG_TXT MSG Message; - FILE *DebugFile; +// FILE *DebugFile; #endif BOOLEAN fDone = FALSE; //Build the output strings @@ -520,6 +527,7 @@ void _FailMessage( STR8 pString, UINT32 uiLineNum, STR8 pSourceFile ) //Record to file if required #ifndef _NO_DEBUG_TXT +#if 0 if (gfRecordToFile) { if ((DebugFile = fopen( gpcDebugLogFileName, "a+t" )) != NULL) @@ -528,7 +536,10 @@ void _FailMessage( STR8 pString, UINT32 uiLineNum, STR8 pSourceFile ) fclose( DebugFile ); } } - +#endif + // 0verhaul: Replacement for the above. More consistent. + DbgMessage( TOPIC_GAME, DBG_LEVEL_1, ubOutputString); + #if 0 if( !FontObjs[0] ) { //Font manager hasn't yet been initialized so use the windows error system @@ -613,9 +624,6 @@ void _FailMessage(STR8 pString, UINT32 uiLineNum, STR8 pSourceFile) #endif -#else -BOOLEAN DbgInitialize(void) { return true; }; -void DbgShutdown(void) {}; #endif // This is NOT a _DEBUG only function! It is also needed in diff --git a/Standard Gaming Platform/sgp.cpp b/Standard Gaming Platform/sgp.cpp index ba6c9f75..2edec67b 100644 --- a/Standard Gaming Platform/sgp.cpp +++ b/Standard Gaming Platform/sgp.cpp @@ -848,8 +848,8 @@ int PASCAL HandledWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR p FastDebugMsg("Running Game"); - // 0verhaul: Roughly 60 frames per second. The original "low cpu" code did 30, but that is really slow - SetTimer( ghWindow, uiTimer, 16, NULL); + // 0verhaul: Use the smallest available timer to make sure all animation updates happen at the speed they're supposed to + SetTimer( ghWindow, uiTimer, 1, NULL); // At this point the SGP is set up, which means all I/O, Memory, tools, etc... are available. All we need to do is // attend to the gaming mechanics themselves