From 099b3b3d8ff4729b5556f07f0e4476555ce7659c Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 6 Aug 2016 06:41:04 +0200 Subject: MOHAWK: Move the hotspot list to RivenCard Also replace all hardcoded accesses to the hotspot array with hotspot queries. --- engines/mohawk/riven_card.h | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'engines/mohawk/riven_card.h') diff --git a/engines/mohawk/riven_card.h b/engines/mohawk/riven_card.h index e7745fca1e..10b77275ab 100644 --- a/engines/mohawk/riven_card.h +++ b/engines/mohawk/riven_card.h @@ -31,6 +31,8 @@ namespace Mohawk { +class RivenHotspot; + /** * A game view * @@ -74,12 +76,30 @@ public: /** Get the card's sound description with the specified index */ SLSTRecord getSound(uint16 index) const; + /** Draw borders for all the hotspots in the card */ + void drawHotspotRects(); + + /** Enable the zip hotspots if they match to already visited locations */ + void initializeZipMode(); + + /** Get the hotspot containing the specified point */ + RivenHotspot *getHotspotContainingPoint(const Common::Point &point) const; + + /** Get the hotspot with the specified name */ + RivenHotspot *getHotspotByName(const Common::String &name) const; + + /** Get the hotspot with the specified BLST id */ + RivenHotspot *getHotspotByBlstId(const uint16 blstId) const; + + /** Get all the hotspots in the card. To be used for debugging features only */ + Common::Array getHotspots() const; + private: void loadCardResource(uint16 id); + void loadHotspots(uint16 id); void loadCardPictureList(uint16 id); void loadCardSoundList(uint16 id); - void initializeZipMode(); void defaultLoadScript(); MohawkEngine_Riven *_vm; @@ -90,6 +110,8 @@ private: uint16 _zipModePlace; RivenScriptList _scripts; + Common::Array _hotspots; + // Resource lists Common::Array _pictureList; Common::Array _soundList; @@ -132,7 +154,10 @@ public: /** Get the hotspot's name from the current stack's name list */ Common::String getName() const; - /** Get the hotspot's index in the view */ + /** Get the hotspot's name id */ + int16 getNameId() const; + + /** Get the hotspot's order in the view */ uint16 getIndex() const; /** Get the hotspot's enable list id */ -- cgit v1.2.3