[Scummvm-cvs-logs] CVS: scummvm/sword2 console.cpp,1.35,1.36 console.h,1.14,1.15 debug.cpp,1.31,1.32 logic.cpp,1.33,1.34 maketext.cpp,1.30,1.31 mem_view.cpp,1.21,1.22 resman.cpp,1.72,1.73 startup.cpp,1.35,1.36
Torbj?rn Andersson
eriktorbjorn at users.sourceforge.net
Wed Nov 19 10:42:03 CET 2003
Update of /cvsroot/scummvm/scummvm/sword2
In directory sc8-pr-cvs1:/tmp/cvs-serv23410
Modified Files:
console.cpp console.h debug.cpp logic.cpp maketext.cpp
mem_view.cpp resman.cpp startup.cpp
Log Message:
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.)
Index: console.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/console.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- console.cpp 16 Nov 2003 14:18:27 -0000 1.35
+++ console.cpp 19 Nov 2003 18:40:52 -0000 1.36
@@ -112,13 +112,13 @@
}
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() {
Index: console.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/console.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- console.h 16 Nov 2003 14:18:27 -0000 1.14
+++ console.h 19 Nov 2003 18:40:52 -0000 1.15
@@ -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> {
Index: debug.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/debug.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- debug.cpp 16 Nov 2003 14:18:28 -0000 1.31
+++ debug.cpp 19 Nov 2003 18:40:52 -0000 1.32
@@ -343,13 +343,13 @@
// 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
Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/logic.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- logic.cpp 16 Nov 2003 14:18:28 -0000 1.33
+++ logic.cpp 19 Nov 2003 18:40:52 -0000 1.34
@@ -22,9 +22,11 @@
#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.
Index: maketext.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/maketext.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- maketext.cpp 16 Nov 2003 14:18:28 -0000 1.30
+++ maketext.cpp 19 Nov 2003 18:40:52 -0000 1.31
@@ -71,7 +71,7 @@
// 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 @@
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'
Index: mem_view.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/mem_view.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- mem_view.cpp 16 Nov 2003 14:18:28 -0000 1.21
+++ mem_view.cpp 19 Nov 2003 18:40:52 -0000 1.22
@@ -20,6 +20,8 @@
#include "common/stdafx.h"
#include "sword2/sword2.h"
+#define Debug_Printf _vm->_debugger->DebugPrintf
+
namespace Sword2 {
void MemoryManager::displayMemory(void) {
Index: resman.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/resman.cpp,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- resman.cpp 16 Nov 2003 14:18:28 -0000 1.72
+++ resman.cpp 19 Nov 2003 18:40:52 -0000 1.73
@@ -22,6 +22,8 @@
#include "sword2/sword2.h"
#include "sword2/defs.h"
+#define Debug_Printf _vm->_debugger->DebugPrintf
+
namespace Sword2 {
// ---------------------------------------------------------------------------
Index: startup.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/startup.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- startup.cpp 18 Nov 2003 08:17:36 -0000 1.35
+++ startup.cpp 19 Nov 2003 18:40:53 -0000 1.36
@@ -21,6 +21,8 @@
#include "common/file.h"
#include "sword2/sword2.h"
+#define Debug_Printf _vm->_debugger->DebugPrintf
+
namespace Sword2 {
uint32 Logic::initStartMenu(void) {
More information about the Scummvm-git-logs
mailing list