aboutsummaryrefslogtreecommitdiff
path: root/sword1/objectman.cpp
diff options
context:
space:
mode:
authorRobert Göffringmann2003-12-20 09:12:54 +0000
committerRobert Göffringmann2003-12-20 09:12:54 +0000
commit59654b17191b99c23486f6a41076b9ed05a1c38f (patch)
treef088012a40319619f80b8e81082779bb6512f737 /sword1/objectman.cpp
parentaceafcbb484f18aedda914bf321585a9c113016a (diff)
downloadscummvm-rg350-59654b17191b99c23486f6a41076b9ed05a1c38f.tar.gz
scummvm-rg350-59654b17191b99c23486f6a41076b9ed05a1c38f.tar.bz2
scummvm-rg350-59654b17191b99c23486f6a41076b9ed05a1c38f.zip
added SwordControl (the control panel). Not yet finished.
svn-id: r11775
Diffstat (limited to 'sword1/objectman.cpp')
-rw-r--r--sword1/objectman.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/sword1/objectman.cpp b/sword1/objectman.cpp
index a2f0881c9e..2673cbb493 100644
--- a/sword1/objectman.cpp
+++ b/sword1/objectman.cpp
@@ -29,9 +29,14 @@
ObjectMan::ObjectMan(ResMan *pResourceMan) {
_resMan = pResourceMan;
+}
+
+void ObjectMan::initialize(void) {
for (uint16 cnt = 0; cnt < TOTAL_SECTIONS; cnt++)
- _liveList[cnt] = 0;
-
+ _liveList[cnt] = 0; // we don't need to close the files here. When this routine is
+ // called, the memory was flushed() anyways, so these resources
+ // already *are* closed.
+
_liveList[128] = _liveList[129] = _liveList[130] = _liveList[131] = _liveList[133] =
_liveList[134] = _liveList[145] = _liveList[146] = _liveList[TEXT_sect] = 1;
@@ -41,7 +46,6 @@ ObjectMan::ObjectMan(ResMan *pResourceMan) {
else
_cptData[cnt] = NULL;
}
-
}
ObjectMan::~ObjectMan(void) {
@@ -131,3 +135,19 @@ void ObjectMan::closeSection(uint32 screen) {
if (_liveList[screen] == 0) // close the section that PLAYER has just left, if it's empty now
_resMan->resClose(_objectList[screen]);
}
+
+void ObjectMan::loadLiveList(uint16 *src) {
+ for (uint16 cnt = 0; cnt < TOTAL_SECTIONS; cnt++) {
+ if (_liveList[cnt]) {
+ _resMan->resClose(_objectList[cnt]);
+ _cptData[cnt] = NULL;
+ }
+ _liveList[cnt] = src[cnt];
+ if (_liveList[cnt])
+ _cptData[cnt] = ((uint8*)_resMan->cptResOpen(_objectList[cnt])) + sizeof(Header);
+ }
+}
+
+void ObjectMan::saveLiveList(uint16 *dest) {
+ memcpy(dest, _liveList, TOTAL_SECTIONS * sizeof(uint16));
+}