From dca374efcde85472676a67e2af3decfeee51589e Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 25 Mar 2016 18:19:39 +0100 Subject: [PATCH] GNAP: Change another variable to boolean --- engines/gnap/gamesys.cpp | 10 +++++----- engines/gnap/resource.cpp | 2 +- engines/gnap/resource.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/engines/gnap/gamesys.cpp b/engines/gnap/gamesys.cpp index d3e1195f4a3..88b5ea2e535 100644 --- a/engines/gnap/gamesys.cpp +++ b/engines/gnap/gamesys.cpp @@ -491,7 +491,7 @@ void GameSys::seqInsertGfx(int index, int duration) { (_backgroundImageValue3 - _backgroundImageValue1); gfxItem->_currFrame._rect.top = gfxItem->_currFrame._rect.bottom - scaleValue * (gfxItem->_currFrame._rect.bottom - gfxItem->_currFrame._rect.top) / 1000; gfxItem->_currFrame._rect.right = scaleValue * (gfxItem->_currFrame._rect.right - gfxItem->_currFrame._rect.left) / 1000 + gfxItem->_currFrame._rect.left; - gfxItem->_currFrame._isScaled = 1; + gfxItem->_currFrame._isScaled = true; } gfxItem->_currFrame._duration -= totalDuration; if (gfxItem->_currFrame._soundId != -1) @@ -772,7 +772,7 @@ void GameSys::seqDrawSpriteFrame(SpriteResource *spriteResource, SequenceFrame & const int x = clipRect.left, y = clipRect.top; - debug(1, "GameSys::seqDrawSpriteFrame() destX: %d; destY: %d; frame.isScaled: %d", x, y, frame._isScaled); + debug(1, "GameSys::seqDrawSpriteFrame() destX: %d; destY: %d; frame.isScaled: %d", x, y, frame._isScaled ? 1 : 0); // 32bit sprite drawing if (frame._isScaled) { @@ -1099,7 +1099,7 @@ void GameSys::fatUpdateFrame() { (_backgroundImageValue3 - _backgroundImageValue1); gfxItem->_currFrame._rect.top = gfxItem->_currFrame._rect.bottom - v17 * (gfxItem->_currFrame._rect.bottom - gfxItem->_currFrame._rect.top) / 1000; gfxItem->_currFrame._rect.right = v17 * (gfxItem->_currFrame._rect.right - gfxItem->_currFrame._rect.left) / 1000 + gfxItem->_currFrame._rect.left; - gfxItem->_currFrame._isScaled = 1; + gfxItem->_currFrame._isScaled = true; } gfxItem->_currFrame._duration -= duration; if (gfxItem->_currFrame._soundId != -1) @@ -1157,7 +1157,7 @@ void GameSys::fatUpdateFrame() { gfxItem->_prevFrame._soundId = -1; gfxItem->_prevFrame._unusedVal = -1; gfxItem->_currFrame._duration = 0; - gfxItem->_currFrame._isScaled = 0; + gfxItem->_currFrame._isScaled = false; gfxItem->_currFrame._rect = _newSpriteDrawItems[k]._rect; gfxItem->_currFrame._spriteId = _newSpriteDrawItems[k]._surface ? 0xCAFEBABE : -1;// TODO gfxItem->_currFrame._soundId = -1; @@ -1173,7 +1173,7 @@ void GameSys::fatUpdateFrame() { if (gfxItem->_sequenceId == -1 && !gfxItem->_animation && (gfxItem->_flags & 1) && gfxItem->_id == _grabSpriteId && gfxItem->_surface == _grabSpriteSurface1) { gfxItem->_currFrame._duration = 0; - gfxItem->_currFrame._isScaled = 0; + gfxItem->_currFrame._isScaled = false; gfxItem->_currFrame._rect = _grabSpriteRect; gfxItem->_currFrame._spriteId = _grabSpriteSurface2 ? 1 : -1;// TODO gfxItem->_currFrame._soundId = -1; diff --git a/engines/gnap/resource.cpp b/engines/gnap/resource.cpp index 17fe8f918ac..d83598b149a 100644 --- a/engines/gnap/resource.cpp +++ b/engines/gnap/resource.cpp @@ -28,7 +28,7 @@ namespace Gnap { void SequenceFrame::loadFromStream(Common::MemoryReadStream &stream) { _duration = stream.readUint16LE(); - _isScaled = stream.readUint16LE(); + _isScaled = (stream.readUint16LE() != 0); _rect.left = stream.readUint32LE(); _rect.top = stream.readUint32LE(); _rect.right = stream.readUint32LE(); diff --git a/engines/gnap/resource.h b/engines/gnap/resource.h index 20dd8d41922..52acdc56f30 100644 --- a/engines/gnap/resource.h +++ b/engines/gnap/resource.h @@ -47,7 +47,7 @@ enum { struct SequenceFrame { int16 _duration; - int16 _isScaled; + bool _isScaled; Common::Rect _rect; int32 _spriteId; int32 _soundId;