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
This commit is contained in:
Torbjörn Andersson 2003-11-19 18:40:53 +00:00
parent 80e335e0c4
commit 083c328077
8 changed files with 19 additions and 13 deletions

View File

@ -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() {

View File

@ -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> {

View File

@ -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

View File

@ -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.
*/

View File

@ -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'

View File

@ -20,6 +20,8 @@
#include "common/stdafx.h"
#include "sword2/sword2.h"
#define Debug_Printf _vm->_debugger->DebugPrintf
namespace Sword2 {
void MemoryManager::displayMemory(void) {

View File

@ -22,6 +22,8 @@
#include "sword2/sword2.h"
#include "sword2/defs.h"
#define Debug_Printf _vm->_debugger->DebugPrintf
namespace Sword2 {
// ---------------------------------------------------------------------------

View File

@ -21,6 +21,8 @@
#include "common/file.h"
#include "sword2/sword2.h"
#define Debug_Printf _vm->_debugger->DebugPrintf
namespace Sword2 {
uint32 Logic::initStartMenu(void) {