aboutsummaryrefslogtreecommitdiff
path: root/sword2/logic.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/logic.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/logic.cpp')
-rw-r--r--sword2/logic.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/sword2/logic.cpp b/sword2/logic.cpp
index f7f8e41df2..51346af950 100644
--- a/sword2/logic.cpp
+++ b/sword2/logic.cpp
@@ -60,7 +60,7 @@ int Logic::processSession(void) {
// processing on the current list
while (_pc != 0xffffffff) {
- head = (_standardHeader*) res_man.open(run_list);
+ head = (_standardHeader*) res_man->openResource(run_list);
if (head->fileType != RUN_LIST)
error("Logic_engine %d not a run_list", run_list);
@@ -74,7 +74,7 @@ int Logic::processSession(void) {
// release the list again so it can float in memory - at this
// point not one thing should be locked
- res_man.close(run_list);
+ res_man->closeResource(run_list);
debug(5, "%d", ID);
@@ -84,7 +84,7 @@ int Logic::processSession(void) {
return 0;
}
- head = (_standardHeader*) res_man.open(ID);
+ head = (_standardHeader*) res_man->openResource(ID);
if (head->fileType != GAME_OBJECT)
error("Logic_engine %d not an object", ID);
@@ -130,7 +130,7 @@ int Logic::processSession(void) {
raw_data_ad = (char*) head;
- far_head = (_standardHeader*) res_man.open(script / SIZE);
+ far_head = (_standardHeader*) res_man->openResource(script / SIZE);
if (far_head->fileType != GAME_OBJECT && far_head->fileType != SCREEN_MANAGER)
error("Logic_engine %d not a far object (its a %d)", script / SIZE, far_head->fileType);
@@ -145,7 +145,7 @@ int Logic::processSession(void) {
ret = runScript(raw_script_ad, raw_data_ad, &_curObjectHub->script_pc[LEVEL]);
// close foreign object again
- res_man.close(script / SIZE);
+ res_man->closeResource(script / SIZE);
// reset to us for service script
raw_script_ad = raw_data_ad;
@@ -201,7 +201,7 @@ int Logic::processSession(void) {
// and that's it so close the object resource
- res_man.close(ID);
+ res_man->closeResource(ID);
}
// leaving a room so remove all ids that must reboot correctly
@@ -238,7 +238,7 @@ void Logic::expressChangeSession(uint32 sesh_id) {
router.clearWalkGridList();
// stops all fx & clears the queue
- Clear_fx_queue();
+ g_sword2->clearFxQueue();
// free all the route memory blocks from previous game
router.freeAllRouteMem();
@@ -339,17 +339,17 @@ void Logic::examineRunList(void) {
if (_currentRunList) {
// open and lock in place
- game_object_list = (uint32 *) (res_man.open(_currentRunList) + sizeof(_standardHeader));
+ game_object_list = (uint32 *) (res_man->openResource(_currentRunList) + sizeof(_standardHeader));
Debug_Printf("Runlist number %d\n", _currentRunList);
for (int i = 0; game_object_list[i]; i++) {
- file_header = (_standardHeader *) res_man.open(game_object_list[i]);
+ file_header = (_standardHeader *) res_man->openResource(game_object_list[i]);
Debug_Printf("%d %s\n", game_object_list[i], file_header->name);
- res_man.close(game_object_list[i]);
+ res_man->closeResource(game_object_list[i]);
}
- res_man.close(_currentRunList);
+ res_man->closeResource(_currentRunList);
} else
Debug_Printf("No run list set\n");
}
@@ -430,7 +430,7 @@ int32 Logic::fnAddToKillList(int32 *params) {
void Logic::processKillList(void) {
for (uint32 i = 0; i < _kills; i++)
- res_man.remove(_objectKillList[i]);
+ res_man->remove(_objectKillList[i]);
_kills = 0;
}