aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-11-19 18:40:53 +0000
committerTorbjörn Andersson2003-11-19 18:40:53 +0000
commit083c3280775a0589763c109bf5241f617cc9df54 (patch)
tree835f4969f60ecbdfaffe632b1a98a164c3ea19d8 /sword2
parent80e335e0c453d52c7e167df485acdeb858eb7c3f (diff)
downloadscummvm-rg350-083c3280775a0589763c109bf5241f617cc9df54.tar.gz
scummvm-rg350-083c3280775a0589763c109bf5241f617cc9df54.tar.bz2
scummvm-rg350-083c3280775a0589763c109bf5241f617cc9df54.zip
Eliminated some more references to g_sword2. I think the only thing that
still uses it are the engine's global variables which, on the other hand, are used *everywhere*. I'll have to think some more about those. I guess I should take a closer look at how the other engines handle them. (That goes for a lot of things by the way.) svn-id: r11349
Diffstat (limited to 'sword2')
-rw-r--r--sword2/console.cpp6
-rw-r--r--sword2/console.h2
-rw-r--r--sword2/debug.cpp8
-rw-r--r--sword2/logic.cpp6
-rw-r--r--sword2/maketext.cpp4
-rw-r--r--sword2/mem_view.cpp2
-rw-r--r--sword2/resman.cpp2
-rw-r--r--sword2/startup.cpp2
8 files changed, 19 insertions, 13 deletions
diff --git a/sword2/console.cpp b/sword2/console.cpp
index 0533cf26d5..2648099bb0 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 cfc13c0f30..c35c251db6 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<Debugger> {
diff --git a/sword2/debug.cpp b/sword2/debug.cpp
index f8eb726403..e8351b54ea 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 9b65a76e53..3cf0818721 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 54329ba284..9b92e940ef 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 abf5379098..3a1bf166c0 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 09adf8b461..5fa8c9f9de 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 f4b19dbce8..6ce17fbcf8 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) {