aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-25 18:36:14 -0400
committerPaul Gilbert2016-08-25 18:36:14 -0400
commit63ffcf0a0deb05c77bdcc18d1f39d9384de5111a (patch)
treed5ce941407b97c6e3d8c22950c0917a5f99c22d0
parent9de67538650b81610145bb47810ba2d9b641b3f1 (diff)
downloadscummvm-rg350-63ffcf0a0deb05c77bdcc18d1f39d9384de5111a.tar.gz
scummvm-rg350-63ffcf0a0deb05c77bdcc18d1f39d9384de5111a.tar.bz2
scummvm-rg350-63ffcf0a0deb05c77bdcc18d1f39d9384de5111a.zip
TITANIC: Add loading of bedhead data
-rw-r--r--engines/titanic/game/sgt/bedhead.cpp39
-rw-r--r--engines/titanic/game/sgt/bedhead.h2
2 files changed, 25 insertions, 16 deletions
diff --git a/engines/titanic/game/sgt/bedhead.cpp b/engines/titanic/game/sgt/bedhead.cpp
index 45031bd6b3..f911a83ae3 100644
--- a/engines/titanic/game/sgt/bedhead.cpp
+++ b/engines/titanic/game/sgt/bedhead.cpp
@@ -21,6 +21,7 @@
*/
#include "titanic/game/sgt/bedhead.h"
+#include "titanic/titanic.h"
namespace Titanic {
@@ -30,41 +31,49 @@ BEGIN_MESSAGE_MAP(CBedhead, CSGTStateRoom)
END_MESSAGE_MAP()
void BedheadEntry::load(Common::SeekableReadStream *s) {
- // TODO
+ _name1 = readStringFromStream(s);
+ _name2 = readStringFromStream(s);
+ _name3 = readStringFromStream(s);
+ _name4 = readStringFromStream(s);
+ _startFrame = s->readUint32LE();
+ _endFrame = s->readUint32LE();
}
/*------------------------------------------------------------------------*/
-void BedheadEntries::load(Common::SeekableReadStream *s) {
- resize(s->readUint32LE());
- for (uint idx = 0; idx < size(); ++idx)
+void BedheadEntries::load(Common::SeekableReadStream *s, int count) {
+ resize(count);
+ for (uint idx = 0; idx < count; ++idx)
(*this)[idx].load(s);
}
/*------------------------------------------------------------------------*/
void TurnOnEntries::load(Common::SeekableReadStream *s) {
- _closed.load(s);
- _restingTV.load(s);
- _restingUV.load(s);
- _closedWrong.load(s);
+ _closed.load(s, 4);
+ _restingTV.load(s, 2);
+ _restingUV.load(s, 2);
+ _closedWrong.load(s, 2);
}
/*------------------------------------------------------------------------*/
void TurnOffEntries::load(Common::SeekableReadStream *s) {
- _open.load(s);
- _restingUTV.load(s);
- _restingV.load(s);
- _restingG.load(s);
- _openWrong.load(s);
- _restingDWrong.load(s);
+ _open.load(s, 3);
+ _restingUTV.load(s, 1);
+ _restingV.load(s, 1);
+ _restingG.load(s, 3);
+ _openWrong.load(s, 1);
+ _restingDWrong.load(s, 1);
}
/*------------------------------------------------------------------------*/
CBedhead::CBedhead() : CSGTStateRoom() {
- // TODO: Load data for turn on/off methods
+ Common::SeekableReadStream *s = g_vm->_filesManager->getResource("DATA/BEDHEAD");
+ _on.load(s);
+ _off.load(s);
+ delete s;
}
void CBedhead::save(SimpleFile *file, int indent) {
diff --git a/engines/titanic/game/sgt/bedhead.h b/engines/titanic/game/sgt/bedhead.h
index 53c61e19d8..7784cb8caf 100644
--- a/engines/titanic/game/sgt/bedhead.h
+++ b/engines/titanic/game/sgt/bedhead.h
@@ -40,7 +40,7 @@ struct BedheadEntry {
};
class BedheadEntries : public Common::Array<BedheadEntry> {
public:
- void load(Common::SeekableReadStream *s);
+ void load(Common::SeekableReadStream *s, int count);
};
struct TurnOnEntries {