diff options
Diffstat (limited to 'engines/sword1')
-rw-r--r-- | engines/sword1/animation.cpp | 2 | ||||
-rw-r--r-- | engines/sword1/console.cpp | 1 | ||||
-rw-r--r-- | engines/sword1/control.cpp | 4 | ||||
-rw-r--r-- | engines/sword1/resman.cpp | 9 | ||||
-rw-r--r-- | engines/sword1/sound.cpp | 3 | ||||
-rw-r--r-- | engines/sword1/sound.h | 3 | ||||
-rw-r--r-- | engines/sword1/sword1.cpp | 2 |
7 files changed, 12 insertions, 12 deletions
diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp index ff3c897dba..206bd68b07 100644 --- a/engines/sword1/animation.cpp +++ b/engines/sword1/animation.cpp @@ -98,7 +98,7 @@ static const char *const sequenceListPSX[20] = { /////////////////////////////////////////////////////////////////////////////// MoviePlayer::MoviePlayer(SwordEngine *vm, Text *textMan, ResMan *resMan, OSystem *system, Video::VideoDecoder *decoder, DecoderType decoderType) - : _vm(vm), _textMan(textMan), _resMan(resMan), _system(system) { + : _vm(vm), _textMan(textMan), _resMan(resMan), _system(system), _textX(0), _textY(0), _textWidth(0), _textHeight(0), _textColor(1) { _decoderType = decoderType; _decoder = decoder; diff --git a/engines/sword1/console.cpp b/engines/sword1/console.cpp index 603efd308e..4c55f8d990 100644 --- a/engines/sword1/console.cpp +++ b/engines/sword1/console.cpp @@ -26,6 +26,7 @@ namespace Sword1 { SwordConsole::SwordConsole(SwordEngine *vm) : GUI::Debugger(), _vm(vm) { + assert(_vm); } SwordConsole::~SwordConsole() { diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp index 7cd85dff54..80d8edc1dd 100644 --- a/engines/sword1/control.cpp +++ b/engines/sword1/control.cpp @@ -856,10 +856,8 @@ bool Control::savegamesExist() { void Control::checkForOldSaveGames() { Common::InSaveFile *inf = _saveFileMan->openForLoading("SAVEGAME.INF"); - if (!inf) { - delete inf; + if (!inf) return; - } GUI::MessageDialog dialog0( _("ScummVM found that you have old savefiles for Broken Sword 1 that should be converted.\n" diff --git a/engines/sword1/resman.cpp b/engines/sword1/resman.cpp index 878ba8eceb..7222965c9d 100644 --- a/engines/sword1/resman.cpp +++ b/engines/sword1/resman.cpp @@ -227,7 +227,10 @@ Header *ResMan::lockScript(uint32 scrID) { #else openScriptResourceLittleEndian(scrID); #endif - return (Header *)resHandle(scrID)->data; + MemHandle *handle = resHandle(scrID); + if (!handle) + error("Script resource handle %d not found", scrID); + return (Header *)handle->data; } void ResMan::unlockScript(uint32 scrID) { @@ -343,8 +346,8 @@ MemHandle *ResMan::resHandle(uint32 id) { uint8 cluster = (uint8)((id >> 24) - 1); uint8 group = (uint8)(id >> 16); - // There is a know case of reading beyond array boundaries when trying to use - // portuguese subtitles (cluster file 2, group 6) with a version that do not + // There is a known case of reading beyond array boundaries when trying to use + // portuguese subtitles (cluster file 2, group 6) with a version that does not // contain subtitles for this languages (i.e. has only 6 languages and not 7). if (cluster >= _prj.noClu || group >= _prj.clu[cluster].noGrp) return NULL; diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp index 61bf5257ab..268da74508 100644 --- a/engines/sword1/sound.cpp +++ b/engines/sword1/sound.cpp @@ -45,9 +45,8 @@ namespace Sword1 { #define SOUND_SPEECH_ID 1 #define SPEECH_FLAGS (Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN) -Sound::Sound(const char *searchPath, Audio::Mixer *mixer, ResMan *pResMan) +Sound::Sound(Audio::Mixer *mixer, ResMan *pResMan) : _rnd("sword1sound") { - strcpy(_filePath, searchPath); _mixer = mixer; _resMan = pResMan; _bigEndianSpeech = false; diff --git a/engines/sword1/sound.h b/engines/sword1/sound.h index 4e1ac7ba34..b52d89f390 100644 --- a/engines/sword1/sound.h +++ b/engines/sword1/sound.h @@ -80,7 +80,7 @@ enum CowMode { class Sound { public: - Sound(const char *searchPath, Audio::Mixer *mixer, ResMan *pResMan); + Sound(Audio::Mixer *mixer, ResMan *pResMan); ~Sound(); void setSpeechVol(uint8 volL, uint8 volR) { _speechVolL = volL; _speechVolR = volR; } void setSfxVol(uint8 volL, uint8 volR) { _sfxVolL = volL; _sfxVolR = volR; } @@ -125,7 +125,6 @@ private: Audio::Mixer *_mixer; ResMan *_resMan; bool _bigEndianSpeech; - char _filePath[100]; static const char _musicList[270]; static const uint16 _roomsFixedFx[TOTAL_ROOMS][TOTAL_FX_PER_ROOM]; static const FxDef _fxList[312]; diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp index fa593b8df4..2d5452778d 100644 --- a/engines/sword1/sword1.cpp +++ b/engines/sword1/sword1.cpp @@ -104,7 +104,7 @@ Common::Error SwordEngine::init() { _mouse = new Mouse(_system, _resMan, _objectMan); _screen = new Screen(_system, _resMan, _objectMan); _music = new Music(_mixer); - _sound = new Sound("", _mixer, _resMan); + _sound = new Sound(_mixer, _resMan); _menu = new Menu(_screen, _mouse); _logic = new Logic(this, _objectMan, _resMan, _screen, _mouse, _sound, _music, _menu, _system, _mixer); _mouse->useLogicAndMenu(_logic, _menu); |