Skip to content

Commit

Permalink
SHERLOCK: Syntactic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed May 18, 2015
1 parent c24d0de commit 844d801
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 15 deletions.
8 changes: 4 additions & 4 deletions engines/sherlock/animation.cpp
Expand Up @@ -140,7 +140,7 @@ bool Animation::play(const Common::String &filename, int minDelay, int fade,
* Load the prologue name array
*/
void Animation::setPrologueNames(const char *const *names, int count) {
for (int idx = 0; idx < count; ++idx, names++) {
for (int idx = 0; idx < count; ++idx, ++names) {
_prologueNames.push_back(*names);
}
}
Expand All @@ -161,7 +161,7 @@ void Animation::setPrologueFrames(const int *frames, int count, int maxFrames) {
* Load the title name array
*/
void Animation::setTitleNames(const char *const *names, int count) {
for (int idx = 0; idx < count; ++idx, names++) {
for (int idx = 0; idx < count; ++idx, ++names) {
_titleNames.push_back(*names);
}
}
Expand All @@ -185,14 +185,14 @@ const int *Animation::checkForSoundFrames(const Common::String &filename) {
const int *frames = &NO_FRAMES;

if (_vm->_soundOverride.empty()) {
for (Common::Array<const char *>::size_type idx = 0; idx < _prologueNames.size(); ++idx) {
for (uint idx = 0; idx < _prologueNames.size(); ++idx) {
if (filename.equalsIgnoreCase(_prologueNames[idx])) {
frames = &_prologueFrames[idx][0];
break;
}
}
} else {
for (Common::Array<const char *>::size_type idx = 0; idx < _titleNames.size(); ++idx) {
for (uint idx = 0; idx < _titleNames.size(); ++idx) {
if (filename.equalsIgnoreCase(_titleNames[idx])) {
frames = &_titleFrames[idx][0];
break;
Expand Down
2 changes: 1 addition & 1 deletion engines/sherlock/detection.cpp
Expand Up @@ -144,7 +144,7 @@ bool Sherlock::SherlockEngine::hasFeature(EngineFeature f) const {
/**
* Returns whether the version is a demo
*/
bool Sherlock::SherlockEngine::getIsDemo() const {
bool Sherlock::SherlockEngine::isDemo() const {
return _gameDescription->desc.flags & ADGF_DEMO;
}

Expand Down
2 changes: 1 addition & 1 deletion engines/sherlock/detection_tables.h
Expand Up @@ -32,7 +32,7 @@ static const SherlockGameDescription gameDescriptions[] = {
AD_ENTRY1s("talk.lib", "ad0c4d6865edf15da4e9204c08815875", 238928),
Common::EN_ANY,
Common::kPlatformDOS,
ADGF_UNSTABLE | ADGF_NO_FLAGS,
ADGF_UNSTABLE,
GUIO2(GUIO_NOSPEECH, GAMEOPTION_ORIGINAL_SAVES)
},
GType_SerratedScalpel,
Expand Down
3 changes: 2 additions & 1 deletion engines/sherlock/inventory.cpp
Expand Up @@ -136,7 +136,8 @@ int Inventory::findInv(const Common::String &name) {
return idx;
}

return 1;
// Couldn't find the desired item
error("Couldn't find inventory item - %s", name.c_str());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion engines/sherlock/map.cpp
Expand Up @@ -69,7 +69,7 @@ Map::Map(SherlockEngine *vm) : _vm(vm), _topLine(SHERLOCK_SCREEN_WIDTH, 12) {
for (int idx = 0; idx < MAX_HOLMES_SEQUENCE; ++idx)
Common::fill(&_sequences[idx][0], &_sequences[idx][MAX_FRAME], 0);

if (!_vm->getIsDemo())
if (!_vm->isDemo())
loadData();
}

Expand Down
6 changes: 3 additions & 3 deletions engines/sherlock/scalpel/scalpel.cpp
Expand Up @@ -250,7 +250,7 @@ void ScalpelEngine::initialize() {
_flags[3] = true; // Turn on Alley
_flags[39] = true; // Turn on Baker Street

if (!getIsDemo()) {
if (!isDemo()) {
// Load the map co-ordinates for each scene and sequence data
_map->loadPoints(NUM_PLACES, &MAP_X[0], &MAP_Y[0], &MAP_TRANSLATE[0]);
_map->loadSequences(3, &MAP_SEQUENCES[0][0]);
Expand All @@ -269,7 +269,7 @@ void ScalpelEngine::initialize() {
_animation->setTitleFrames(&TITLE_FRAMES[0][0], 7, 9);

// Starting scene
if (getIsDemo() && _interactiveFl)
if (isDemo() && _interactiveFl)
_scene->_goToScene = 3;
else
_scene->_goToScene = 4;
Expand All @@ -279,7 +279,7 @@ void ScalpelEngine::initialize() {
* Show the opening sequence
*/
void ScalpelEngine::showOpening() {
if (getIsDemo() && _interactiveFl)
if (isDemo() && _interactiveFl)
return;

if (!showCityCutscene())
Expand Down
2 changes: 1 addition & 1 deletion engines/sherlock/scene.cpp
Expand Up @@ -495,7 +495,7 @@ bool Scene::loadScene(const Common::String &filename) {
_walkedInScene = false;
saves._justLoaded = false;

if (!_vm->getIsDemo()) {
if (!_vm->isDemo()) {
// Reset the previous map location and position on overhead map
map._oldCharPoint = _currentScene;
map._overPos.x = map[_currentScene].x * 100 - 600;
Expand Down
2 changes: 1 addition & 1 deletion engines/sherlock/sherlock.cpp
Expand Up @@ -81,7 +81,7 @@ void SherlockEngine::initialize() {
Object::setVm(this);
Sprite::setVm(this);

if (getIsDemo()) {
if (isDemo()) {
Common::File f;
// The interactive demo doesn't have an intro thus doesn't include TITLE.SND
// At the opposite, the non-interactive demo is only the intro.
Expand Down
2 changes: 1 addition & 1 deletion engines/sherlock/sherlock.h
Expand Up @@ -117,7 +117,7 @@ class SherlockEngine : public Engine {
virtual Common::Error loadGameState(int slot);
virtual Common::Error saveGameState(int slot, const Common::String &desc);
virtual void syncSoundSettings();
virtual bool getIsDemo() const;
virtual bool isDemo() const;

GameType getGameID() const;
Common::Language getLanguage() const;
Expand Down
2 changes: 1 addition & 1 deletion engines/sherlock/sound.cpp
Expand Up @@ -49,7 +49,7 @@ Sound::Sound(SherlockEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer) {
_vm->_res->addToCache("MUSIC.LIB");
_vm->_res->addToCache("SND.SND");

if (!_vm->getIsDemo()) {
if (!_vm->isDemo()) {
_vm->_res->addToCache("TITLE.SND");
_vm->_res->addToCache("EPILOGUE.SND");
}
Expand Down

0 comments on commit 844d801

Please sign in to comment.