diff options
author | Strangerke | 2015-05-18 23:23:37 +0200 |
---|---|---|
committer | Strangerke | 2015-05-18 23:23:37 +0200 |
commit | 0aebac9174f935e535b8e133efde43bd94be5b27 (patch) | |
tree | 6c22cb2a4741af814b1014d8a213f1a30555b53c | |
parent | c4513607473ed6889445b08ea4f77165df126854 (diff) | |
download | scummvm-rg350-0aebac9174f935e535b8e133efde43bd94be5b27.tar.gz scummvm-rg350-0aebac9174f935e535b8e133efde43bd94be5b27.tar.bz2 scummvm-rg350-0aebac9174f935e535b8e133efde43bd94be5b27.zip |
SHERLOCK: Fix some issues pointed by LordHoto
-rw-r--r-- | engines/sherlock/objects.h | 1 | ||||
-rw-r--r-- | engines/sherlock/scene.cpp | 10 | ||||
-rw-r--r-- | engines/sherlock/scene.h | 4 | ||||
-rw-r--r-- | engines/sherlock/screen.cpp | 5 | ||||
-rw-r--r-- | engines/sherlock/sherlock.h | 4 | ||||
-rw-r--r-- | engines/sherlock/sound.cpp | 2 | ||||
-rw-r--r-- | engines/sherlock/talk.cpp | 2 |
7 files changed, 12 insertions, 16 deletions
diff --git a/engines/sherlock/objects.h b/engines/sherlock/objects.h index 4068973e58..7a1ef1aebe 100644 --- a/engines/sherlock/objects.h +++ b/engines/sherlock/objects.h @@ -164,6 +164,7 @@ struct UseType { void load(Common::SeekableReadStream &s); }; +enum { TURNON_OBJ = 0x20, TURNOFF_OBJ = 0x40 }; class Object { private: static SherlockEngine *_vm; diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp index 8a906e9335..fa5c5f439c 100644 --- a/engines/sherlock/scene.cpp +++ b/engines/sherlock/scene.cpp @@ -43,7 +43,7 @@ void BgFileHeader::load(Common::SeekableReadStream &s) { /** * Load the data for the object */ -void BgfileheaderInfo::load(Common::SeekableReadStream &s) { +void BgFileHeaderInfo::load(Common::SeekableReadStream &s) { _filesize = s.readUint32LE(); _maxFrames = s.readByte(); @@ -176,7 +176,7 @@ void Scene::selectScene() { _restoreFlag = true; events.clearEvents(); - // If there were any scripst waiting to be run, but were interrupt by a running + // If there were any scripts waiting to be run, but were interrupt by a running // canimation (probably the last scene's exit canim), clear the _scriptMoreFlag if (talk._scriptMoreFlag == 3) talk._scriptMoreFlag = 0; @@ -265,7 +265,7 @@ bool Scene::loadScene(const Common::String &filename) { _invGraphicItems = bgHeader._numImages + 1; // Read in the shapes header info - Common::Array<BgfileheaderInfo> bgInfo; + Common::Array<BgFileHeaderInfo> bgInfo; bgInfo.resize(bgHeader._numStructs); for (uint idx = 0; idx < bgInfo.size(); ++idx) @@ -461,13 +461,13 @@ bool Scene::loadScene(const Common::String &filename) { // Check for TURNON objects for (uint idx = 0; idx < _bgShapes.size(); ++idx) { - if (_bgShapes[idx]._type == HIDDEN && (_bgShapes[idx]._flags & 0x20)) + if (_bgShapes[idx]._type == HIDDEN && (_bgShapes[idx]._flags & TURNON_OBJ)) _bgShapes[idx].toggleHidden(); } // Check for TURNOFF objects for (uint idx = 0; idx < _bgShapes.size(); ++idx) { - if (_bgShapes[idx]._type != HIDDEN && (_bgShapes[idx]._flags & 0x40) && + if (_bgShapes[idx]._type != HIDDEN && (_bgShapes[idx]._flags & TURNOFF_OBJ) && _bgShapes[idx]._type != INVALID) _bgShapes[idx].toggleHidden(); if (_bgShapes[idx]._type == HIDE_SHAPE) diff --git a/engines/sherlock/scene.h b/engines/sherlock/scene.h index 665f5d28e4..78d41299e6 100644 --- a/engines/sherlock/scene.h +++ b/engines/sherlock/scene.h @@ -49,7 +49,7 @@ struct BgFileHeader { void load(Common::SeekableReadStream &s); }; -struct BgfileheaderInfo { +struct BgFileHeaderInfo { int _filesize; // How long images are int _maxFrames; // How many unique frames in object Common::String _filename; // Filename of object @@ -83,7 +83,7 @@ struct SceneSound { void load(Common::SeekableReadStream &s); }; -class ObjectArray: public Common::Array<Object> { +class ObjectArray : public Common::Array<Object> { public: int indexOf(const Object &obj) const; }; diff --git a/engines/sherlock/screen.cpp b/engines/sherlock/screen.cpp index e98d9a51a9..d9ec1d745d 100644 --- a/engines/sherlock/screen.cpp +++ b/engines/sherlock/screen.cpp @@ -116,8 +116,7 @@ int Screen::equalizePalette(const byte palette[PALETTE_SIZE]) { // For any palette component that doesn't already match the given destination // palette, change by 1 towards the reference palette component for (int idx = 0; idx < PALETTE_SIZE; ++idx) { - if (tempPalette[idx] > palette[idx]) - { + if (tempPalette[idx] > palette[idx]) { tempPalette[idx] = MAX((int)palette[idx], (int)tempPalette[idx] - 4); ++total; } else if (tempPalette[idx] < palette[idx]) { @@ -216,7 +215,7 @@ void Screen::randomTransition() { for (int idx = 0; idx <= 65535 && !_vm->shouldQuit(); ++idx) { _transitionSeed = _transitionSeed * TRANSITION_MULTIPLIER + 1; - int offset = _transitionSeed & 65535; + int offset = _transitionSeed & 0xFFFF; if (offset < (SHERLOCK_SCREEN_WIDTH * SHERLOCK_SCREEN_HEIGHT)) *((byte *)getPixels() + offset) = *((const byte *)_backBuffer->getPixels() + offset); diff --git a/engines/sherlock/sherlock.h b/engines/sherlock/sherlock.h index bd6d4a4c8e..68c8e8daca 100644 --- a/engines/sherlock/sherlock.h +++ b/engines/sherlock/sherlock.h @@ -50,10 +50,6 @@ namespace Sherlock { enum { - kFileTypeHash -}; - -enum { kDebugScript = 1 << 0 }; diff --git a/engines/sherlock/sound.cpp b/engines/sherlock/sound.cpp index 5199fe7dc4..c79e179c1c 100644 --- a/engines/sherlock/sound.cpp +++ b/engines/sherlock/sound.cpp @@ -89,7 +89,7 @@ static uint8 creativeADPCM_AdjustMap[64] = { 240, 0, 0, 0, 0, 0, 0, 0 }; -byte Sound::decodeSample(byte sample, byte& reference, int16& scale) { +byte Sound::decodeSample(byte sample, byte &reference, int16 &scale) { int16 samp = sample + scale; int16 ref = 0; diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp index b38b432e37..dfcf9b912d 100644 --- a/engines/sherlock/talk.cpp +++ b/engines/sherlock/talk.cpp @@ -672,7 +672,7 @@ void Talk::drawInterface() { } /** - * Display a list of statements in a window at the bottom of the scren that the + * Display a list of statements in a window at the bottom of the screen that the * player can select from. */ bool Talk::displayTalk(bool slamIt) { |