diff options
author | Bastien Bouclet | 2017-02-04 15:25:37 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2017-07-03 08:50:10 +0200 |
commit | 7609ec0de81d7be4ed6d0e3e6e0303f42d54ad52 (patch) | |
tree | 5fe3029941eab2f65ab99584732eab2c17dab5cb | |
parent | f334e6e38ae4bc65d398fa174a8be892cb403063 (diff) | |
download | scummvm-rg350-7609ec0de81d7be4ed6d0e3e6e0303f42d54ad52.tar.gz scummvm-rg350-7609ec0de81d7be4ed6d0e3e6e0303f42d54ad52.tar.bz2 scummvm-rg350-7609ec0de81d7be4ed6d0e3e6e0303f42d54ad52.zip |
MOHAWK: Use explicit bitmap names for the dome sliders
-rw-r--r-- | engines/mohawk/riven_stacks/bspit.cpp | 2 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/domespit.cpp | 15 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/domespit.h | 5 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/gspit.cpp | 2 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/jspit.cpp | 2 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/pspit.cpp | 2 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/tspit.cpp | 2 |
7 files changed, 20 insertions, 10 deletions
diff --git a/engines/mohawk/riven_stacks/bspit.cpp b/engines/mohawk/riven_stacks/bspit.cpp index acc24f24be..7a8ac69abf 100644 --- a/engines/mohawk/riven_stacks/bspit.cpp +++ b/engines/mohawk/riven_stacks/bspit.cpp @@ -33,7 +33,7 @@ namespace Mohawk { namespace RivenStacks { BSpit::BSpit(MohawkEngine_Riven *vm) : - DomeSpit(vm, kStackBspit) { + DomeSpit(vm, kStackBspit, "bSliders.190", "bSliderBG.190") { REGISTER_COMMAND(BSpit, xblabopenbook); REGISTER_COMMAND(BSpit, xblabbookprevpage); diff --git a/engines/mohawk/riven_stacks/domespit.cpp b/engines/mohawk/riven_stacks/domespit.cpp index 71a82ab343..6a1d26bf11 100644 --- a/engines/mohawk/riven_stacks/domespit.cpp +++ b/engines/mohawk/riven_stacks/domespit.cpp @@ -35,8 +35,10 @@ namespace RivenStacks { static const uint32 kDomeSliderDefaultState = 0x01F00000; static const uint32 kDomeSliderSlotCount = 25; -DomeSpit::DomeSpit(MohawkEngine_Riven *vm, uint16 id) : - RivenStack(vm, id) { +DomeSpit::DomeSpit(MohawkEngine_Riven *vm, uint16 id, const char *sliderBmpName, const char *sliderBgBmpName) : + RivenStack(vm, id), + _sliderBmpName(sliderBmpName), + _sliderBgBmpName(sliderBgBmpName) { _sliderState = kDomeSliderDefaultState; } @@ -204,7 +206,8 @@ void DomeSpit::drawDomeSliders(uint16 startHotspot) { dstAreaRect.translate(-2, 0); // Find out bitmap id - uint16 bitmapId = _vm->findResourceID(ID_TBMP, "*sliders*"); + uint16 bitmapId = _vm->findResourceID(ID_TBMP, buildCardResourceName(_sliderBmpName)); + uint16 bgBitmapId = _vm->findResourceID(ID_TBMP, buildCardResourceName(_sliderBgBmpName)); for (uint16 i = 0; i < kDomeSliderSlotCount; i++) { RivenHotspot *hotspot = _vm->getCard()->getHotspotByBlstId(startHotspot + i); @@ -217,12 +220,16 @@ void DomeSpit::drawDomeSliders(uint16 startHotspot) { if (_sliderState & (1 << (24 - i))) _vm->_gfx->drawImageRect(bitmapId, srcRect, dstRect); else - _vm->_gfx->drawImageRect(bitmapId + 1, srcRect, dstRect); + _vm->_gfx->drawImageRect(bgBitmapId, srcRect, dstRect); } _vm->_gfx->updateScreen(); } +Common::String DomeSpit::buildCardResourceName(const Common::String &name) const { + return Common::String::format("%d_%s", _vm->getCard()->getId(), name.c_str()); +} + void DomeSpit::setDomeSliderState(uint32 sliderState) { _sliderState = sliderState; } diff --git a/engines/mohawk/riven_stacks/domespit.h b/engines/mohawk/riven_stacks/domespit.h index 7ca513c743..98cf37c5dc 100644 --- a/engines/mohawk/riven_stacks/domespit.h +++ b/engines/mohawk/riven_stacks/domespit.h @@ -30,7 +30,7 @@ namespace RivenStacks { class DomeSpit : public RivenStack { public: - DomeSpit(MohawkEngine_Riven *vm, uint16 id); + DomeSpit(MohawkEngine_Riven *vm, uint16 id, const char *sliderBmpName, const char *sliderBgBmpName); uint32 getDomeSliderState() const; void setDomeSliderState(uint32 sliderState); @@ -43,8 +43,11 @@ protected: void checkSliderCursorChange(uint16 startHotspot); void dragDomeSlider(uint16 soundId, uint16 startHotspot); void drawDomeSliders(uint16 startHotspot); + Common::String buildCardResourceName(const Common::String &name) const; uint32 _sliderState; + Common::String _sliderBmpName; + Common::String _sliderBgBmpName; }; } // End of namespace RivenStacks diff --git a/engines/mohawk/riven_stacks/gspit.cpp b/engines/mohawk/riven_stacks/gspit.cpp index a53d0a1b85..836dd272fc 100644 --- a/engines/mohawk/riven_stacks/gspit.cpp +++ b/engines/mohawk/riven_stacks/gspit.cpp @@ -33,7 +33,7 @@ namespace Mohawk { namespace RivenStacks { GSpit::GSpit(MohawkEngine_Riven *vm) : - DomeSpit(vm, kStackGspit) { + DomeSpit(vm, kStackGspit, "gsliders.190", "gsliderbg.190") { REGISTER_COMMAND(GSpit, xgresetpins); REGISTER_COMMAND(GSpit, xgrotatepins); diff --git a/engines/mohawk/riven_stacks/jspit.cpp b/engines/mohawk/riven_stacks/jspit.cpp index 5ac65b347e..7dc5210e46 100644 --- a/engines/mohawk/riven_stacks/jspit.cpp +++ b/engines/mohawk/riven_stacks/jspit.cpp @@ -33,7 +33,7 @@ namespace Mohawk { namespace RivenStacks { JSpit::JSpit(MohawkEngine_Riven *vm) : - DomeSpit(vm, kStackJspit) { + DomeSpit(vm, kStackJspit, "jsliders.190", "jsliderbg.190") { REGISTER_COMMAND(JSpit, xreseticons); REGISTER_COMMAND(JSpit, xicon); diff --git a/engines/mohawk/riven_stacks/pspit.cpp b/engines/mohawk/riven_stacks/pspit.cpp index 4c80849d86..e2bfec0f95 100644 --- a/engines/mohawk/riven_stacks/pspit.cpp +++ b/engines/mohawk/riven_stacks/pspit.cpp @@ -31,7 +31,7 @@ namespace Mohawk { namespace RivenStacks { PSpit::PSpit(MohawkEngine_Riven *vm) : - DomeSpit(vm, kStackPspit) { + DomeSpit(vm, kStackPspit, "psliders.25", "psliderbg.25") { REGISTER_COMMAND(PSpit, xpisland990_elevcombo); REGISTER_COMMAND(PSpit, xpscpbtn); diff --git a/engines/mohawk/riven_stacks/tspit.cpp b/engines/mohawk/riven_stacks/tspit.cpp index e4d51791bb..1903a897c6 100644 --- a/engines/mohawk/riven_stacks/tspit.cpp +++ b/engines/mohawk/riven_stacks/tspit.cpp @@ -34,7 +34,7 @@ namespace Mohawk { namespace RivenStacks { TSpit::TSpit(MohawkEngine_Riven *vm) : - DomeSpit(vm, kStackTspit) { + DomeSpit(vm, kStackTspit, "tsliders.190", "tsliderbg.190") { REGISTER_COMMAND(TSpit, xtexterior300_telescopedown); REGISTER_COMMAND(TSpit, xtexterior300_telescopeup); |