aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven_card.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2016-08-06 18:07:54 +0200
committerEugene Sandulenko2017-07-03 08:50:10 +0200
commit871516a9697db1914d703f0abb48a2f084452b0c (patch)
tree7fc231c0421ceeddcfd416e83710c0bec27ccb9c /engines/mohawk/riven_card.cpp
parentc1e0b8684b5d89fc5c10088a3222a8760e3b4ade (diff)
downloadscummvm-rg350-871516a9697db1914d703f0abb48a2f084452b0c.tar.gz
scummvm-rg350-871516a9697db1914d703f0abb48a2f084452b0c.tar.bz2
scummvm-rg350-871516a9697db1914d703f0abb48a2f084452b0c.zip
MOHAWK: Move the effect list to RivenCard
Diffstat (limited to 'engines/mohawk/riven_card.cpp')
-rw-r--r--engines/mohawk/riven_card.cpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/engines/mohawk/riven_card.cpp b/engines/mohawk/riven_card.cpp
index 158c72f080..cdf9cf1a3e 100644
--- a/engines/mohawk/riven_card.cpp
+++ b/engines/mohawk/riven_card.cpp
@@ -37,6 +37,7 @@ RivenCard::RivenCard(MohawkEngine_Riven *vm, uint16 id) :
loadCardPictureList(id);
loadCardSoundList(id);
loadCardHotspotEnableList(id);
+ loadCardWaterEffectList(id);
}
RivenCard::~RivenCard() {
@@ -269,7 +270,7 @@ RivenHotspot *RivenCard::getHotspotByBlstId(const uint16 blstId) const {
}
void RivenCard::loadCardHotspotEnableList(uint16 id) {
- Common::SeekableReadStream* blst = _vm->getResource(ID_BLST, id);
+ Common::SeekableReadStream *blst = _vm->getResource(ID_BLST, id);
uint16 recordCount = blst->readUint16BE();
_hotspotEnableList.resize(recordCount);
@@ -295,6 +296,36 @@ void RivenCard::activateHotspotEnableRecord(uint16 index) {
}
}
+void RivenCard::loadCardWaterEffectList(uint16 id) {
+ Common::SeekableReadStream *flst = _vm->getResource(ID_FLST, id);
+
+ uint16 recordCount = flst->readUint16BE();
+ _waterEffectList.resize(recordCount);
+
+ for (uint16 i = 0; i < recordCount; i++) {
+ WaterEffectRecord &record = _waterEffectList[i];
+ record.index = flst->readUint16BE();
+ record.sfxeId = flst->readUint16BE();
+ record.u0 = flst->readUint16BE();
+
+ if (record.u0 != 0) {
+ warning("FLST u0 non-zero");
+ }
+ }
+
+ delete flst;
+}
+
+void RivenCard::activateWaterEffect(uint16 index) {
+ for (uint16 i = 0; i < _waterEffectList.size(); i++) {
+ const WaterEffectRecord &record = _waterEffectList[i];
+ if (record.index == index) {
+ _vm->_gfx->scheduleWaterEffect(record.sfxeId);
+ break;
+ }
+ }
+}
+
RivenHotspot::RivenHotspot(MohawkEngine_Riven *vm, Common::ReadStream *stream) :
_vm(vm) {
loadFromStream(stream);