aboutsummaryrefslogtreecommitdiff
path: root/sword2/function.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-11-08 15:47:51 +0000
committerTorbjörn Andersson2003-11-08 15:47:51 +0000
commit688c80b0620ae5765355a4048864bb3de84ebf74 (patch)
tree497d8efc73b08f5a4d58c45c52b7a6bafa1975ff /sword2/function.cpp
parentb04ddef7506bfa08527da9e79040c583fb765b2e (diff)
downloadscummvm-rg350-688c80b0620ae5765355a4048864bb3de84ebf74.tar.gz
scummvm-rg350-688c80b0620ae5765355a4048864bb3de84ebf74.tar.bz2
scummvm-rg350-688c80b0620ae5765355a4048864bb3de84ebf74.zip
Moved more stuff into classes, changed some static allocation to dynamic,
and removed some of the references to global variables. At this point I believe everything in the main game engine has been moved into classes - not necessarily the correct ones, but still... However, there is some stuff in the driver directory that need to be taken care of as well. svn-id: r11207
Diffstat (limited to 'sword2/function.cpp')
-rw-r--r--sword2/function.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/sword2/function.cpp b/sword2/function.cpp
index c4699398ce..681ac8d469 100644
--- a/sword2/function.cpp
+++ b/sword2/function.cpp
@@ -139,7 +139,7 @@ int32 Logic::fnRandom(int32 *params) {
// params: 0 min
// 1 max
- RESULT = g_sword2->_rnd.getRandomNumberRng(params[0], params[1]);
+ RESULT = _vm->_rnd.getRandomNumberRng(params[0], params[1]);
return IR_CONT;
}
@@ -204,7 +204,7 @@ int32 Logic::fnPassGraph(int32 *params) {
// params: 0 pointer to a graphic structure (might not need this?)
- memcpy(&g_sword2->_engineGraph, (uint8 *) params[0], sizeof(Object_graphic));
+ memcpy(&_vm->_engineGraph, (uint8 *) params[0], sizeof(Object_graphic));
// makes no odds
return IR_CONT;
@@ -220,7 +220,7 @@ int32 Logic::fnPassMega(int32 *params) {
// params: 0 pointer to a mega structure
- memcpy(&g_sword2->_engineMega, (uint8 *) params[0], sizeof(Object_mega));
+ memcpy(&_vm->_engineMega, (uint8 *) params[0], sizeof(Object_mega));
// makes no odds
return IR_CONT;
@@ -337,9 +337,9 @@ int32 Logic::fnDisplayMsg(int32 *params) {
// +2 to skip the encoded text number in the first 2 chars; 3 is
// duration in seconds
- g_sword2->displayMsg(g_sword2->fetchTextLine(res_man->openResource(text_res), local_text) + 2, 3);
+ _vm->displayMsg(_vm->fetchTextLine(res_man->openResource(text_res), local_text) + 2, 3);
res_man->closeResource(text_res);
- g_sword2->removeMsg();
+ _vm->removeMsg();
return IR_CONT;
}
@@ -372,7 +372,7 @@ int32 Logic::fnResetGlobals(int32 *params) {
// - this is taken from fnInitBackground
// switch on scrolling (2 means first time on screen)
- g_sword2->_thisScreen.scroll_flag = 2;
+ _vm->_thisScreen.scroll_flag = 2;
return IR_CONT;
}
@@ -444,19 +444,15 @@ int32 Logic::fnPlayCredits(int32 *params) {
g_display->setPalette(0, 256, oldPal, RDPAL_FADE);
g_display->fadeUp();
g_display->updateDisplay();
- g_sword2->buildDisplay();
+ _vm->buildDisplay();
g_display->waitForFade();
g_sound->muteFx(false);
g_sound->muteSpeech(false);
}
- // FIXME: This probably isn't the correct way of shutting down ScummVM
- // Anyway, I don't know if we ever call this from the demo.
-
- if (g_sword2->_features & GF_DEMO) {
- Close_game(); // close engine systems down
- exit(0); // quit the game
+ if (_vm->_features & GF_DEMO) {
+ _vm->closeGame();
}
return IR_CONT;