diff options
Diffstat (limited to 'engines/parallaction')
26 files changed, 107 insertions, 39 deletions
diff --git a/engines/parallaction/adlib.cpp b/engines/parallaction/adlib.cpp index 568ad190aa..a981a5553b 100644 --- a/engines/parallaction/adlib.cpp +++ b/engines/parallaction/adlib.cpp @@ -277,6 +277,15 @@ public: _channels[i].init(this, i); _isOpen = false; + + _opl = NULL; + memset(_voices, 0, sizeof(_voices)); + + _lastVoice = 0; + _percussionMask = 0; + + _adlibTimerProc = NULL; + _adlibTimerParam = NULL; } int open(); diff --git a/engines/parallaction/balloons.cpp b/engines/parallaction/balloons.cpp index 234abff59a..c0a516eb0f 100644 --- a/engines/parallaction/balloons.cpp +++ b/engines/parallaction/balloons.cpp @@ -55,7 +55,7 @@ protected: } public: - WrappedLineFormatter(Font *font) : _font(font) { } + WrappedLineFormatter(Font *font) : _font(font), _lines(0), _lineWidth(0) { } virtual ~WrappedLineFormatter() { } virtual void calc(const Common::String &text, uint16 maxwidth) { @@ -136,7 +136,7 @@ protected: } public: - StringExtent_NS(Font *font) : WrappedLineFormatter(font) { } + StringExtent_NS(Font *font) : WrappedLineFormatter(font), _width(0), _height(0) { } uint width() const { return _width; } uint height() const { return _height; } @@ -189,7 +189,8 @@ protected: } public: - StringWriter_NS(Parallaction_ns *vm, Font *font) : WrappedLineFormatter(font), _vm(vm) { } + StringWriter_NS(Parallaction_ns *vm, Font *font) : WrappedLineFormatter(font), _vm(vm), + _width(0), _height(0), _color(0), _surf(NULL) { } void write(const Common::String &text, uint maxWidth, byte color, Graphics::Surface *surf) { StringExtent_NS se(_font); @@ -464,7 +465,7 @@ protected: } public: - StringExtent_BR(Font *font) : WrappedLineFormatter(font) { } + StringExtent_BR(Font *font) : WrappedLineFormatter(font), _width(0), _height(0) { } uint width() const { return _width; } uint height() const { return _height; } @@ -480,7 +481,8 @@ class StringWriter_BR : public WrappedLineFormatter { Graphics::Surface *_surf; protected: - StringWriter_BR(Font *font, byte color) : WrappedLineFormatter(font) { + StringWriter_BR(Font *font, byte color) : WrappedLineFormatter(font), _width(0), _height(0), + _color(color), _x(0), _y(0), _surf(NULL) { } @@ -504,7 +506,8 @@ protected: } public: - StringWriter_BR(Font *font) : WrappedLineFormatter(font) { } + StringWriter_BR(Font *font) : WrappedLineFormatter(font), _width(0), _height(0), + _color(0), _x(0), _y(0), _surf(NULL) { } void write(const Common::String &text, uint maxWidth, byte color, Graphics::Surface *surf) { StringExtent_BR se(_font); diff --git a/engines/parallaction/debug.cpp b/engines/parallaction/debug.cpp index a7087c64d7..0bf2babb5b 100644 --- a/engines/parallaction/debug.cpp +++ b/engines/parallaction/debug.cpp @@ -32,6 +32,7 @@ namespace Parallaction { Debugger::Debugger(Parallaction *vm) : GUI::Debugger() { _vm = vm; + _mouseState = MOUSE_ENABLED_SHOW; registerCmd("continue", WRAP_METHOD(Debugger, cmdExit)); registerCmd("location", WRAP_METHOD(Debugger, Cmd_Location)); diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index 277f1cbe69..4c52990874 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -220,7 +220,7 @@ static const PARALLACTIONGameDescription gameDescriptions[] = { class ParallactionMetaEngine : public AdvancedMetaEngine { public: ParallactionMetaEngine() : AdvancedMetaEngine(Parallaction::gameDescriptions, sizeof(Parallaction::PARALLACTIONGameDescription), parallactionGames) { - _guioptions = GUIO1(GUIO_NOLAUNCHLOAD); + _guiOptions = GUIO1(GUIO_NOLAUNCHLOAD); } virtual const char *getName() const { @@ -271,9 +271,8 @@ bool ParallactionMetaEngine::createInstance(OSystem *syst, Engine **engine, cons SaveStateList ParallactionMetaEngine::listSaves(const char *target) const { Common::SaveFileManager *saveFileMan = g_system->getSavefileManager(); - Common::String pattern(ConfMan.getDomain(target)->getVal("gameid") + ".0??"); + Common::String pattern(ConfMan.getDomain(target)->getVal("gameid") + ".0##"); Common::StringArray filenames = saveFileMan->listSavefiles(pattern); - sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..) SaveStateList saveList; for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) { @@ -290,6 +289,8 @@ SaveStateList ParallactionMetaEngine::listSaves(const char *target) const { } } + // Sort saves based on slot number. + Common::sort(saveList.begin(), saveList.end(), SaveStateDescriptorSlotComparator()); return saveList; } diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp index 62e2152816..4dbedc8dbe 100644 --- a/engines/parallaction/dialogue.cpp +++ b/engines/parallaction/dialogue.cpp @@ -140,6 +140,21 @@ DialogueManager::DialogueManager(Parallaction *vm, ZonePtr z) : _vm(vm), _z(z) { _cmdList = 0; _answerId = 0; + + _faceId = 0; + + _q = NULL; + memset(_visAnswers, 0, sizeof(_visAnswers)); + _numVisAnswers = 0; + + _selection = _oldSelection = 0; + + _isKeyDown = false; + _downKey = 0; + + _mouseButtons = 0; + + _state = DIALOGUE_START; } void DialogueManager::start() { @@ -412,7 +427,8 @@ protected: } public: - DialogueManager_ns(Parallaction_ns *vm, ZonePtr z) : DialogueManager(vm, z), _vm(vm) { + DialogueManager_ns(Parallaction_ns *vm, ZonePtr z) : DialogueManager(vm, z), _vm(vm), + _passwordChanged(false), _askPassword(false) { _ballonPos._questionBalloon = Common::Point(140, 10); _ballonPos._questionChar = Common::Point(190, 80); _ballonPos._answerChar = Common::Point(10, 80); diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp index 7458065b8c..af2d2b82e0 100644 --- a/engines/parallaction/disk_br.cpp +++ b/engines/parallaction/disk_br.cpp @@ -762,14 +762,11 @@ Common::String AmigaDisk_br::selectArchive(const Common::String& name) { } -Disk_br::Disk_br(Parallaction *vm) : _vm(vm), _baseDir(0) { - +Disk_br::Disk_br(Parallaction *vm) : _vm(vm), _baseDir(0), _language(0) { } Disk_br::~Disk_br() { _sset.clear(); } - - } // namespace Parallaction diff --git a/engines/parallaction/disk_ns.cpp b/engines/parallaction/disk_ns.cpp index 28e61b04f9..c25236acbd 100644 --- a/engines/parallaction/disk_ns.cpp +++ b/engines/parallaction/disk_ns.cpp @@ -238,7 +238,7 @@ void Disk_ns::setLanguage(uint16 language) { #pragma mark - -DosDisk_ns::DosDisk_ns(Parallaction* vm) : Disk_ns(vm) { +DosDisk_ns::DosDisk_ns(Parallaction* vm) : Disk_ns(vm), _gfx(NULL) { } diff --git a/engines/parallaction/exec.cpp b/engines/parallaction/exec.cpp index ceba072173..3d4e9bd803 100644 --- a/engines/parallaction/exec.cpp +++ b/engines/parallaction/exec.cpp @@ -81,7 +81,7 @@ void ProgramExec::runScripts(ProgramList::iterator first, ProgramList::iterator return; } -ProgramExec::ProgramExec() : _modCounter(0) { +ProgramExec::ProgramExec() : _modCounter(0), _instructionNames(NULL) { } diff --git a/engines/parallaction/font.cpp b/engines/parallaction/font.cpp index 57b04deb12..0476b15971 100644 --- a/engines/parallaction/font.cpp +++ b/engines/parallaction/font.cpp @@ -70,6 +70,8 @@ public: _data = (byte *)malloc(size); stream.read(_data, size); + _cp = 0; + _bufPitch = 0; } ~BraFont() { @@ -302,7 +304,7 @@ protected: } public: - DosFont(Cnv *cnv) : _data(cnv), _pitch(cnv->_width) { + DosFont(Cnv *cnv) : _data(cnv), _pitch(cnv->_width), _cp(NULL), _bufPitch(0) { } ~DosFont() { diff --git a/engines/parallaction/gfxbase.cpp b/engines/parallaction/gfxbase.cpp index f1499f7782..819804bfe7 100644 --- a/engines/parallaction/gfxbase.cpp +++ b/engines/parallaction/gfxbase.cpp @@ -32,7 +32,8 @@ namespace Parallaction { GfxObj::GfxObj(uint objType, Frames *frames, const char* name) : _frames(frames), x(0), y(0), z(0), _prog(0), _flags(0), - type(objType), frame(0), layer(3), scale(100), _hasMask(false), _hasPath(false) { + type(objType), frame(0), layer(3), scale(100), _hasMask(false), _hasPath(false), + transparentKey(0), _maskId(0), _pathId(0) { if (name) { _name = strdup(name); diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index 06b315016a..162671b68a 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -743,6 +743,8 @@ Gfx::Gfx(Parallaction* vm) : _nextProjectorPos = 0; _hbCircleRadius = 0; + _overlayMode = false; + _unpackedBitmap = new byte[MAXIMUM_UNPACKED_BITMAP_SIZE]; assert(_unpackedBitmap); diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h index 55e2bbca84..03b4dd97ef 100644 --- a/engines/parallaction/graphics.h +++ b/engines/parallaction/graphics.h @@ -57,7 +57,7 @@ protected: public: - Font() {} + Font() : _color(0) {} virtual ~Font() {} virtual void setColor(byte color) { diff --git a/engines/parallaction/gui_br.cpp b/engines/parallaction/gui_br.cpp index ae3d136b0e..17d759d26f 100644 --- a/engines/parallaction/gui_br.cpp +++ b/engines/parallaction/gui_br.cpp @@ -43,7 +43,8 @@ protected: int _fadeSteps; public: - SplashInputState_BR(Parallaction *vm, const Common::String &name, MenuInputHelper *helper) : MenuInputState(name, helper), _vm(vm) { + SplashInputState_BR(Parallaction *vm, const Common::String &name, MenuInputHelper *helper) : MenuInputState(name, helper), _vm(vm), + _timeOut(0), _startTime(0), _fadeSteps(0) { } virtual MenuInputState* run() { @@ -382,6 +383,9 @@ public: _menuObj->getRect(0, _menuRect); _cellW = _menuRect.width() / 3; _cellH = _menuRect.height() / 2; + + _menuObjId = _mscMenuObjId = _sfxMenuObjId = 0; + _sfxStatus = _mscStatus = 0; } ~IngameMenuInputState_BR() { diff --git a/engines/parallaction/gui_ns.cpp b/engines/parallaction/gui_ns.cpp index 3d977c9e51..3c312c4f2d 100644 --- a/engines/parallaction/gui_ns.cpp +++ b/engines/parallaction/gui_ns.cpp @@ -43,7 +43,8 @@ protected: Parallaction *_vm; public: - SplashInputState_NS(Parallaction *vm, const Common::String &name, MenuInputHelper *helper) : MenuInputState(name, helper), _vm(vm) { + SplashInputState_NS(Parallaction *vm, const Common::String &name, MenuInputHelper *helper) : MenuInputState(name, helper), _vm(vm), + _timeOut(0), _startTime(0) { } virtual MenuInputState* run() { @@ -298,7 +299,7 @@ class LoadGameInputState_NS : public MenuInputState { Parallaction *_vm; public: - LoadGameInputState_NS(Parallaction *vm, MenuInputHelper *helper) : MenuInputState("loadgame", helper), _vm(vm) { } + LoadGameInputState_NS(Parallaction *vm, MenuInputHelper *helper) : MenuInputState("loadgame", helper), _vm(vm), _result(false) { } virtual MenuInputState* run() { if (!_result) { @@ -477,6 +478,11 @@ public: _labels[0] = 0; _labels[1] = 0; + _fail = false; + _len = 0; + _startTime = 0; + _state = 0; + _codeSelectBlocks[0] = Common::Rect( 111, 129, 127, 153 ); // na _codeSelectBlocks[1] = Common::Rect( 128, 120, 144, 144 ); // wa _codeSelectBlocks[2] = Common::Rect( 145, 111, 161, 135 ); // ra @@ -689,6 +695,9 @@ public: ShowCreditsInputState_NS(Parallaction *vm, MenuInputHelper *helper) : MenuInputState("showcredits", helper), _vm(vm) { _labels[0] = 0; _labels[1] = 0; + + _current = 0; + _startTime = 0; } ~ShowCreditsInputState_NS() { @@ -827,6 +836,8 @@ public: _labels[1] = 0; _labels[2] = 0; _labels[3] = 0; + + _allPartsComplete = false; } void destroyLabels() { diff --git a/engines/parallaction/input.cpp b/engines/parallaction/input.cpp index 290af339bb..c62e7479d3 100644 --- a/engines/parallaction/input.cpp +++ b/engines/parallaction/input.cpp @@ -70,10 +70,15 @@ Input::Input(Parallaction *vm) : _vm(vm) { _mouseButtons = 0; _delayedActionZone.reset(); + _inputMode = 0; + _hasKeyPressEvent = false; + _dinoCursor = 0; _dougCursor = 0; _donnaCursor = 0; _comboArrow = 0; + _mouseArrow = 0; + initCursors(); } diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp index 50a5b38d8d..950d62a841 100644 --- a/engines/parallaction/objects.cpp +++ b/engines/parallaction/objects.cpp @@ -145,6 +145,8 @@ Program::Program() { _locals = new LocalVariable[NUM_LOCALS]; _numLocals = 0; _status = kProgramIdle; + _ip = 0; + _loopStart = 0; } Program::~Program() { @@ -163,7 +165,7 @@ int16 Program::findLocal(const char* name) { int16 Program::addLocal(const char *name, int16 value, int16 min, int16 max) { assert(_numLocals < NUM_LOCALS); - strcpy(_localNames[_numLocals], name); + Common::strlcpy(_localNames[_numLocals], name, 10); _locals[_numLocals].setRange(min, max); _locals[_numLocals].setValue(value); @@ -259,6 +261,8 @@ Answer::Answer() { _noFlags = 0; _yesFlags = 0; _hasCounterCondition = false; + _counterValue = 0; + _counterOp = 0; } bool Answer::textIsNull() { @@ -298,6 +302,7 @@ Instruction::Instruction() { // common _immediate = 0; + _endif = 0; // BRA specific _text = 0; diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 2b75e78582..bbe759dffe 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -60,6 +60,7 @@ Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gam DebugMan.addDebugChannel(kDebugMenu, "menu", "Menu debug level"); DebugMan.addDebugChannel(kDebugInventory, "inventory", "Inventory debug level"); + _screenWidth = 0; _screenHeight = 0; _screenSize = 0; _gameType = 0; @@ -86,6 +87,7 @@ Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gam _inventory = 0; _currentLocationIndex = 0; _numLocations = 0; + _language = 0; } Parallaction::~Parallaction() { @@ -208,7 +210,7 @@ void Parallaction::allocateLocationSlot(const char *name) { error("No more location slots available. Please report this immediately to ScummVM team"); if (_currentLocationIndex == -1) { - strcpy(_locationNames[_numLocations], name); + Common::strlcpy(_locationNames[_numLocations], name, 10); _currentLocationIndex = _numLocations; _numLocations++; diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 6ea50584f8..c4839897ef 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -20,8 +20,8 @@ * */ -#ifndef PARALLACTION_H -#define PARALLACTION_H +#ifndef PARALLACTION_PARALLACTION_H +#define PARALLACTION_PARALLACTION_H #include "common/str.h" #include "common/stack.h" diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index 1e1c0b0a3d..9f045cb397 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -320,7 +320,7 @@ void Parallaction_br::changeLocation() { freeLocation(false); // load new location - strcpy(_location._name, _newLocationName.c_str()); + Common::strlcpy(_location._name, _newLocationName.c_str(), 100); parseLocation(_location._name); if (_location._startPosition.x != -1000) { diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index 144c2b3a98..ccf7130eb8 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -352,8 +352,8 @@ void Parallaction_ns::changeLocation() { } char location[200]; - strcpy(location, _newLocationName.c_str()); - strcpy(_location._name, _newLocationName.c_str()); + Common::strlcpy(location, _newLocationName.c_str(), 200); + Common::strlcpy(_location._name, _newLocationName.c_str(), 100); debugC(1, kDebugExec, "changeLocation(%s)", location); @@ -395,7 +395,7 @@ void Parallaction_ns::changeLocation() { changeCharacter(locname.character()); } - strcpy(g_saveData1, locname.location()); + Common::strlcpy(g_saveData1, locname.location(), 30); parseLocation(g_saveData1); if (_location._startPosition.x != -1000) { diff --git a/engines/parallaction/parser.cpp b/engines/parallaction/parser.cpp index c37cee692e..725a8b5996 100644 --- a/engines/parallaction/parser.cpp +++ b/engines/parallaction/parser.cpp @@ -226,6 +226,7 @@ uint16 Script::readLineToken(bool errorOnEOF) { void Parser::reset() { _currentOpcodes = 0; _currentStatements = 0; + _lookup = 0; _statements.clear(); _opcodes.clear(); diff --git a/engines/parallaction/parser.h b/engines/parallaction/parser.h index 7b77f58eb0..e7ae7dcc36 100644 --- a/engines/parallaction/parser.h +++ b/engines/parallaction/parser.h @@ -405,7 +405,7 @@ protected: virtual void parseRValue(ScriptVar &var, const char *str); public: - ProgramParser_br(Parallaction_br *vm) : ProgramParser_ns((Parallaction_ns*)vm), _vm(vm) { + ProgramParser_br(Parallaction_br *vm) : ProgramParser_ns((Parallaction_ns*)vm), _vm(vm), _openIfStatement(0) { } virtual void init(); diff --git a/engines/parallaction/saveload.cpp b/engines/parallaction/saveload.cpp index 72e9400acd..0f4ceae7a5 100644 --- a/engines/parallaction/saveload.cpp +++ b/engines/parallaction/saveload.cpp @@ -25,10 +25,7 @@ #include "common/textconsole.h" #include "common/translation.h" -#include "gui/dialog.h" #include "gui/saveload.h" -#include "gui/widget.h" -#include "gui/widgets/list.h" #include "gui/message.h" #include "parallaction/parallaction.h" @@ -96,7 +93,7 @@ void SaveLoad_ns::doLoadGame(uint16 slot) { uint16 _si; for (_si = 0; _si < _vm->_numLocations; _si++) { s = f->readLine(); - strcpy(_vm->_locationNames[_si], s.c_str()); + Common::strlcpy(_vm->_locationNames[_si], s.c_str(), 32); s = f->readLine(); _vm->_localFlags[_si] = atoi(s.c_str()); @@ -194,7 +191,7 @@ int SaveLoad::selectSaveFile(Common::String &selectedName, bool saveMode, const bool SaveLoad::loadGame() { Common::String null; - int _di = selectSaveFile(null, false, "Load file", "Load"); + int _di = selectSaveFile(null, false, _("Load file"), _("Load")); if (_di == -1) { return false; } @@ -209,7 +206,7 @@ bool SaveLoad::loadGame() { bool SaveLoad::saveGame() { Common::String saveName; - int slot = selectSaveFile(saveName, true, "Save file", "Save"); + int slot = selectSaveFile(saveName, true, _("Save file"), _("Save")); if (slot == -1) { return false; } diff --git a/engines/parallaction/sound_br.cpp b/engines/parallaction/sound_br.cpp index d13b318ace..0147d3cd90 100644 --- a/engines/parallaction/sound_br.cpp +++ b/engines/parallaction/sound_br.cpp @@ -86,7 +86,7 @@ protected: byte *_trackEnd; public: - MidiParser_MSC() : byte_11C5A(false) { + MidiParser_MSC() : byte_11C5A(false), _beats(0), _lastEvent(0), _trackEnd(NULL) { } }; @@ -467,6 +467,11 @@ SoundMan_br::SoundMan_br(Parallaction_br *vm) : _vm(vm) { _musicEnabled = true; _sfxEnabled = true; + + _sfxLooping = false; + _sfxVolume = 0; + _sfxRate = 0; + _sfxChannel = 0; } SoundMan_br::~SoundMan_br() { diff --git a/engines/parallaction/sound_ns.cpp b/engines/parallaction/sound_ns.cpp index 692389b490..6073f82b82 100644 --- a/engines/parallaction/sound_ns.cpp +++ b/engines/parallaction/sound_ns.cpp @@ -323,6 +323,11 @@ void AmigaSoundMan_ns::playLocationMusic(const char *location) { SoundMan_ns::SoundMan_ns(Parallaction_ns *vm) : _vm(vm) { _mixer = _vm->_mixer; + _sfxLooping = false; + _sfxVolume = 0; + _sfxRate = 0; + _sfxChannel = 0; + _musicType = 0; } void SoundMan_ns::setMusicVolume(int value) { @@ -330,7 +335,7 @@ void SoundMan_ns::setMusicVolume(int value) { } void SoundMan_ns::setMusicFile(const char *filename) { - strcpy(_musicFile, filename); + Common::strlcpy(_musicFile, filename, PATH_LEN); } void SoundMan_ns::execute(int command, const char *parm = 0) { diff --git a/engines/parallaction/staticres.cpp b/engines/parallaction/staticres.cpp index 40bac5b64d..d7e49b0fca 100644 --- a/engines/parallaction/staticres.cpp +++ b/engines/parallaction/staticres.cpp @@ -96,6 +96,7 @@ byte braAmigaFramesDefaultPalette[48] = { }; +// For the data source and license look into gui/themes/fonts/topaz in ScummVM distribution byte amigaTopazFont[2600] = { 0x00, 0x00, 0x03, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x79, 0x00, 0x00, 0x03, 0xe9, 0x00, 0x00, 0x02, 0x79, |