Skip to content

Commit

Permalink
COMPOSER: Fix reading rollover scripts for V1 buttons.
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzie committed Nov 4, 2011
1 parent 48d9c3d commit dbba1e0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions engines/composer/composer.cpp
Expand Up @@ -472,13 +472,14 @@ Button::Button(Common::SeekableReadStream *stream, uint16 id, uint gameType) {

_type = stream->readUint16LE();
_active = (_type & 0x8000) ? true : false;
bool hasRollover = (gameType == GType_ComposerV1) && (_type & 0x4000);
_type &= 0xfff;
debug(9, "button %d: type %d, active %d", id, _type, _active);

uint16 flags = 0;
uint16 size = 4;
if (gameType == GType_ComposerV1) {
flags = stream->readUint16LE();
stream->skip(2);

_zorder = 0;
_scriptId = stream->readUint16LE();
_scriptIdRollOn = 0;
Expand Down Expand Up @@ -515,7 +516,7 @@ Button::Button(Common::SeekableReadStream *stream, uint16 id, uint gameType) {
error("unknown button type %d", _type);
}

if (flags & 0x40) {
if (hasRollover) {
_scriptIdRollOn = stream->readUint16LE();
_scriptIdRollOff = stream->readUint16LE();
}
Expand Down

0 comments on commit dbba1e0

Please sign in to comment.