aboutsummaryrefslogtreecommitdiff
path: root/sword2/function.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-11-03 07:47:42 +0000
committerTorbjörn Andersson2003-11-03 07:47:42 +0000
commitb3b0118292df23a5d4bf0e9b32a56fb4ddfba1ea (patch)
treedf5851f12ebb885d05db421078980e122698243e /sword2/function.cpp
parent0ece8aab8b03e0aead5f18e33797ec85294bf158 (diff)
downloadscummvm-rg350-b3b0118292df23a5d4bf0e9b32a56fb4ddfba1ea.tar.gz
scummvm-rg350-b3b0118292df23a5d4bf0e9b32a56fb4ddfba1ea.tar.bz2
scummvm-rg350-b3b0118292df23a5d4bf0e9b32a56fb4ddfba1ea.zip
The resource and memory managers are now created dynamically.
Renamed the resource manager's open/close methods openResource() and closeResource() to avoid confusion. (It was I who originally shortened their names to open() and close(), but I've changed my mind now.) Moved more stuff into Sword2Engine. svn-id: r11088
Diffstat (limited to 'sword2/function.cpp')
-rw-r--r--sword2/function.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/sword2/function.cpp b/sword2/function.cpp
index 012a1da211..c4699398ce 100644
--- a/sword2/function.cpp
+++ b/sword2/function.cpp
@@ -99,8 +99,8 @@ int32 Logic::fnPreLoad(int32 *params) {
// params: 0 resource to preload
- res_man.open(params[0]);
- res_man.close(params[0]);
+ res_man->openResource(params[0]);
+ res_man->closeResource(params[0]);
return IR_CONT;
}
@@ -337,8 +337,8 @@ 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(FetchTextLine(res_man.open(text_res), local_text) + 2, 3);
- res_man.close(text_res);
+ g_sword2->displayMsg(g_sword2->fetchTextLine(res_man->openResource(text_res), local_text) + 2, 3);
+ res_man->closeResource(text_res);
g_sword2->removeMsg();
return IR_CONT;
@@ -353,20 +353,20 @@ int32 Logic::fnResetGlobals(int32 *params) {
int32 size;
uint32 *globals;
- size = res_man.fetchLen(1);
+ size = res_man->fetchLen(1);
size -= sizeof(_standardHeader);
debug(5, "globals size: %d", size);
- globals = (uint32 *) ((uint8 *) res_man.open(1) + sizeof(_standardHeader));
+ globals = (uint32 *) ((uint8 *) res_man->openResource(1) + sizeof(_standardHeader));
// blank each global variable
memset(globals, 0, size);
- res_man.close(1);
+ res_man->closeResource(1);
// all objects but george
- res_man.killAllObjects(false);
+ res_man->killAllObjects(false);
// FOR THE DEMO - FORCE THE SCROLLING TO BE RESET!
// - this is taken from fnInitBackground