From 17f1903833491d1e80cb2091a0a0bd7dfe4280de Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Fri, 5 Aug 2016 19:53:34 +0200 Subject: MOHAWK: Remove the RivenHotspot enabled field --- engines/mohawk/riven_card.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'engines/mohawk/riven_card.cpp') diff --git a/engines/mohawk/riven_card.cpp b/engines/mohawk/riven_card.cpp index 9f4635ffbd..32eb63c72b 100644 --- a/engines/mohawk/riven_card.cpp +++ b/engines/mohawk/riven_card.cpp @@ -202,7 +202,7 @@ RivenHotspot::RivenHotspot(MohawkEngine_Riven *vm, Common::ReadStream *stream) : } void RivenHotspot::loadFromStream(Common::ReadStream *stream) { - enabled = true; + _flags = kFlagEnabled; blstID = stream->readUint16BE(); name_resource = stream->readSint16BE(); @@ -218,7 +218,7 @@ void RivenHotspot::loadFromStream(Common::ReadStream *stream) { if (left >= right || top >= bottom) { warning("Invalid hotspot: (%d, %d, %d, %d)", left, top, right, bottom); left = top = right = bottom = 0; - enabled = 0; + enable(false); } rect = Common::Rect(left, top, right, bottom); @@ -227,7 +227,7 @@ void RivenHotspot::loadFromStream(Common::ReadStream *stream) { mouse_cursor = stream->readUint16BE(); index = stream->readUint16BE(); _u1 = stream->readSint16BE(); - zipModeHotspot = stream->readUint16BE(); + _flags |= stream->readUint16BE(); // Read in the scripts now _scripts = _vm->_scriptMan->readScripts(stream); @@ -242,4 +242,20 @@ void RivenHotspot::runScript(uint16 scriptType) { } } +bool RivenHotspot::isEnabled() const { + return (_flags & kFlagEnabled) != 0; +} + +void RivenHotspot::enable(bool e) { + if (e) { + _flags |= kFlagEnabled; + } else { + _flags &= ~kFlagEnabled; + } +} + +bool RivenHotspot::isZip() const { + return (_flags & kFlagZip) != 0; +} + } // End of namespace Mohawk -- cgit v1.2.3