diff --git a/sword2/console.cpp b/sword2/console.cpp index 0533cf26d58..2648099bb04 100644 --- a/sword2/console.cpp +++ b/sword2/console.cpp @@ -112,13 +112,13 @@ Debugger::Debugger(Sword2Engine *vm) } void Debugger::varGet(int var) { - Debug_Printf("%d\n", VAR(var)); + DebugPrintf("%d\n", VAR(var)); } void Debugger::varSet(int var, int val) { - Debug_Printf("was %d, ", VAR(var)); + DebugPrintf("was %d, ", VAR(var)); VAR(var) = val; - Debug_Printf("now %d\n", VAR(var)); + DebugPrintf("now %d\n", VAR(var)); } void Debugger::preEnter() { diff --git a/sword2/console.h b/sword2/console.h index cfc13c0f30b..c35c251db69 100644 --- a/sword2/console.h +++ b/sword2/console.h @@ -24,8 +24,6 @@ #include "sword2/debug.h" #include "sword2/object.h" -#define Debug_Printf g_sword2->_debugger->DebugPrintf - namespace Sword2 { class Debugger : public Common::Debugger { diff --git a/sword2/debug.cpp b/sword2/debug.cpp index f8eb7264033..e8351b54ea8 100644 --- a/sword2/debug.cpp +++ b/sword2/debug.cpp @@ -343,13 +343,13 @@ void Debugger::printCurrentInfo(void) { // prints general stuff about the screen, etc. if (_vm->_thisScreen.background_layer_id) { - Debug_Printf("background layer id %d\n", _vm->_thisScreen.background_layer_id); - Debug_Printf("%d wide, %d high\n", _vm->_thisScreen.screen_wide, _vm->_thisScreen.screen_deep); - Debug_Printf("%d normal layers\n", _vm->_thisScreen.number_of_layers); + DebugPrintf("background layer id %d\n", _vm->_thisScreen.background_layer_id); + DebugPrintf("%d wide, %d high\n", _vm->_thisScreen.screen_wide, _vm->_thisScreen.screen_deep); + DebugPrintf("%d normal layers\n", _vm->_thisScreen.number_of_layers); _vm->_logic->examineRunList(); } else - Debug_Printf("No screen\n"); + DebugPrintf("No screen\n"); } } // End of namespace Sword2 diff --git a/sword2/logic.cpp b/sword2/logic.cpp index 9b65a76e535..3cf0818721e 100644 --- a/sword2/logic.cpp +++ b/sword2/logic.cpp @@ -22,10 +22,12 @@ #include "sword2/defs.h" #include "sword2/interpreter.h" -namespace Sword2 { - #define LEVEL (_curObjectHub->logic_level) +#define Debug_Printf _vm->_debugger->DebugPrintf + +namespace Sword2 { + /** * Do one cycle of the current session. */ diff --git a/sword2/maketext.cpp b/sword2/maketext.cpp index 54329ba284a..9b92e940ef0 100644 --- a/sword2/maketext.cpp +++ b/sword2/maketext.cpp @@ -71,7 +71,7 @@ mem* FontRenderer::makeTextSprite(uint8 *sentence, uint16 maxWidth, uint8 pen, u // set the global layout variables - if (fontRes == g_sword2->_speechFontId) { + if (fontRes == _vm->_speechFontId) { _lineSpacing = -6; // overlap lines by 6 pixels _charSpacing = -3; // overlap characters by 3 pixels } else if (fontRes == CONSOLE_FONT_ID) { @@ -328,7 +328,7 @@ _frameHeader* FontRenderer::findChar(uint8 ch, uint8 *charSet) { if (ch < FIRST_CHAR) ch = DUD; - return g_sword2->fetchFrameHeader(charSet, ch - FIRST_CHAR); + return _vm->fetchFrameHeader(charSet, ch - FIRST_CHAR); } // Copies a character sprite from 'charPtr' to the sprite buffer at 'spritePtr' diff --git a/sword2/mem_view.cpp b/sword2/mem_view.cpp index abf5379098a..3a1bf166c0c 100644 --- a/sword2/mem_view.cpp +++ b/sword2/mem_view.cpp @@ -20,6 +20,8 @@ #include "common/stdafx.h" #include "sword2/sword2.h" +#define Debug_Printf _vm->_debugger->DebugPrintf + namespace Sword2 { void MemoryManager::displayMemory(void) { diff --git a/sword2/resman.cpp b/sword2/resman.cpp index 09adf8b461d..5fa8c9f9de8 100644 --- a/sword2/resman.cpp +++ b/sword2/resman.cpp @@ -22,6 +22,8 @@ #include "sword2/sword2.h" #include "sword2/defs.h" +#define Debug_Printf _vm->_debugger->DebugPrintf + namespace Sword2 { // --------------------------------------------------------------------------- diff --git a/sword2/startup.cpp b/sword2/startup.cpp index f4b19dbce8f..6ce17fbcf89 100644 --- a/sword2/startup.cpp +++ b/sword2/startup.cpp @@ -21,6 +21,8 @@ #include "common/file.h" #include "sword2/sword2.h" +#define Debug_Printf _vm->_debugger->DebugPrintf + namespace Sword2 { uint32 Logic::initStartMenu(void) {