PARALLACTION: Cleanup object initialization
This commit is contained in:
parent
829e62a9fe
commit
b16c5439b0
19 changed files with 82 additions and 21 deletions
|
@ -277,6 +277,15 @@ public:
|
||||||
_channels[i].init(this, i);
|
_channels[i].init(this, i);
|
||||||
|
|
||||||
_isOpen = false;
|
_isOpen = false;
|
||||||
|
|
||||||
|
_opl = NULL;
|
||||||
|
memset(_voices, 0, sizeof(_voices));
|
||||||
|
|
||||||
|
_lastVoice = 0;
|
||||||
|
_percussionMask = 0;
|
||||||
|
|
||||||
|
_adlibTimerProc = NULL;
|
||||||
|
_adlibTimerParam = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int open();
|
int open();
|
||||||
|
|
|
@ -55,7 +55,7 @@ protected:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WrappedLineFormatter(Font *font) : _font(font) { }
|
WrappedLineFormatter(Font *font) : _font(font), _lines(0), _lineWidth(0) { }
|
||||||
virtual ~WrappedLineFormatter() { }
|
virtual ~WrappedLineFormatter() { }
|
||||||
|
|
||||||
virtual void calc(const Common::String &text, uint16 maxwidth) {
|
virtual void calc(const Common::String &text, uint16 maxwidth) {
|
||||||
|
@ -136,7 +136,7 @@ protected:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
StringExtent_NS(Font *font) : WrappedLineFormatter(font) { }
|
StringExtent_NS(Font *font) : WrappedLineFormatter(font), _width(0), _height(0) { }
|
||||||
|
|
||||||
uint width() const { return _width; }
|
uint width() const { return _width; }
|
||||||
uint height() const { return _height; }
|
uint height() const { return _height; }
|
||||||
|
@ -189,7 +189,8 @@ protected:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
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) {
|
void write(const Common::String &text, uint maxWidth, byte color, Graphics::Surface *surf) {
|
||||||
StringExtent_NS se(_font);
|
StringExtent_NS se(_font);
|
||||||
|
@ -464,7 +465,7 @@ protected:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
StringExtent_BR(Font *font) : WrappedLineFormatter(font) { }
|
StringExtent_BR(Font *font) : WrappedLineFormatter(font), _width(0), _height(0) { }
|
||||||
|
|
||||||
uint width() const { return _width; }
|
uint width() const { return _width; }
|
||||||
uint height() const { return _height; }
|
uint height() const { return _height; }
|
||||||
|
@ -480,7 +481,8 @@ class StringWriter_BR : public WrappedLineFormatter {
|
||||||
Graphics::Surface *_surf;
|
Graphics::Surface *_surf;
|
||||||
|
|
||||||
protected:
|
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:
|
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) {
|
void write(const Common::String &text, uint maxWidth, byte color, Graphics::Surface *surf) {
|
||||||
StringExtent_BR se(_font);
|
StringExtent_BR se(_font);
|
||||||
|
|
|
@ -32,6 +32,7 @@ namespace Parallaction {
|
||||||
Debugger::Debugger(Parallaction *vm)
|
Debugger::Debugger(Parallaction *vm)
|
||||||
: GUI::Debugger() {
|
: GUI::Debugger() {
|
||||||
_vm = vm;
|
_vm = vm;
|
||||||
|
_mouseState = MOUSE_ENABLED_SHOW;
|
||||||
|
|
||||||
registerCmd("continue", WRAP_METHOD(Debugger, cmdExit));
|
registerCmd("continue", WRAP_METHOD(Debugger, cmdExit));
|
||||||
registerCmd("location", WRAP_METHOD(Debugger, Cmd_Location));
|
registerCmd("location", WRAP_METHOD(Debugger, Cmd_Location));
|
||||||
|
|
|
@ -140,6 +140,19 @@ DialogueManager::DialogueManager(Parallaction *vm, ZonePtr z) : _vm(vm), _z(z) {
|
||||||
|
|
||||||
_cmdList = 0;
|
_cmdList = 0;
|
||||||
_answerId = 0;
|
_answerId = 0;
|
||||||
|
|
||||||
|
_faceId = 0;
|
||||||
|
|
||||||
|
_q = NULL;
|
||||||
|
memset(_visAnswers, 0, sizeof(_visAnswers));
|
||||||
|
_numVisAnswers = 0;
|
||||||
|
|
||||||
|
_selection = _oldSelection = 0;
|
||||||
|
|
||||||
|
_isKeyDown = false;
|
||||||
|
_downKey = 0;
|
||||||
|
|
||||||
|
_mouseButtons = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogueManager::start() {
|
void DialogueManager::start() {
|
||||||
|
@ -412,7 +425,8 @@ protected:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
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._questionBalloon = Common::Point(140, 10);
|
||||||
_ballonPos._questionChar = Common::Point(190, 80);
|
_ballonPos._questionChar = Common::Point(190, 80);
|
||||||
_ballonPos._answerChar = Common::Point(10, 80);
|
_ballonPos._answerChar = Common::Point(10, 80);
|
||||||
|
|
|
@ -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() {
|
Disk_br::~Disk_br() {
|
||||||
_sset.clear();
|
_sset.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace Parallaction
|
} // namespace Parallaction
|
||||||
|
|
|
@ -238,7 +238,7 @@ void Disk_ns::setLanguage(uint16 language) {
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|
||||||
|
|
||||||
DosDisk_ns::DosDisk_ns(Parallaction* vm) : Disk_ns(vm) {
|
DosDisk_ns::DosDisk_ns(Parallaction* vm) : Disk_ns(vm), _gfx(NULL) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ void ProgramExec::runScripts(ProgramList::iterator first, ProgramList::iterator
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProgramExec::ProgramExec() : _modCounter(0) {
|
ProgramExec::ProgramExec() : _modCounter(0), _instructionNames(NULL) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -302,7 +302,7 @@ protected:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DosFont(Cnv *cnv) : _data(cnv), _pitch(cnv->_width) {
|
DosFont(Cnv *cnv) : _data(cnv), _pitch(cnv->_width), _cp(NULL), _bufPitch(0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
~DosFont() {
|
~DosFont() {
|
||||||
|
|
|
@ -32,7 +32,8 @@ namespace Parallaction {
|
||||||
|
|
||||||
GfxObj::GfxObj(uint objType, Frames *frames, const char* name) :
|
GfxObj::GfxObj(uint objType, Frames *frames, const char* name) :
|
||||||
_frames(frames), x(0), y(0), z(0), _prog(0), _flags(0),
|
_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) {
|
if (name) {
|
||||||
_name = strdup(name);
|
_name = strdup(name);
|
||||||
|
|
|
@ -743,6 +743,8 @@ Gfx::Gfx(Parallaction* vm) :
|
||||||
_nextProjectorPos = 0;
|
_nextProjectorPos = 0;
|
||||||
_hbCircleRadius = 0;
|
_hbCircleRadius = 0;
|
||||||
|
|
||||||
|
_overlayMode = false;
|
||||||
|
|
||||||
_unpackedBitmap = new byte[MAXIMUM_UNPACKED_BITMAP_SIZE];
|
_unpackedBitmap = new byte[MAXIMUM_UNPACKED_BITMAP_SIZE];
|
||||||
assert(_unpackedBitmap);
|
assert(_unpackedBitmap);
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ protected:
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Font() {}
|
Font() : _color(0) {}
|
||||||
virtual ~Font() {}
|
virtual ~Font() {}
|
||||||
|
|
||||||
virtual void setColor(byte color) {
|
virtual void setColor(byte color) {
|
||||||
|
|
|
@ -43,7 +43,8 @@ protected:
|
||||||
int _fadeSteps;
|
int _fadeSteps;
|
||||||
|
|
||||||
public:
|
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() {
|
virtual MenuInputState* run() {
|
||||||
|
@ -382,6 +383,9 @@ public:
|
||||||
_menuObj->getRect(0, _menuRect);
|
_menuObj->getRect(0, _menuRect);
|
||||||
_cellW = _menuRect.width() / 3;
|
_cellW = _menuRect.width() / 3;
|
||||||
_cellH = _menuRect.height() / 2;
|
_cellH = _menuRect.height() / 2;
|
||||||
|
|
||||||
|
_menuObjId = _mscMenuObjId = _sfxMenuObjId = 0;
|
||||||
|
_sfxStatus = _mscStatus = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
~IngameMenuInputState_BR() {
|
~IngameMenuInputState_BR() {
|
||||||
|
|
|
@ -43,7 +43,8 @@ protected:
|
||||||
Parallaction *_vm;
|
Parallaction *_vm;
|
||||||
|
|
||||||
public:
|
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() {
|
virtual MenuInputState* run() {
|
||||||
|
@ -298,7 +299,7 @@ class LoadGameInputState_NS : public MenuInputState {
|
||||||
Parallaction *_vm;
|
Parallaction *_vm;
|
||||||
|
|
||||||
public:
|
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() {
|
virtual MenuInputState* run() {
|
||||||
if (!_result) {
|
if (!_result) {
|
||||||
|
@ -477,6 +478,11 @@ public:
|
||||||
_labels[0] = 0;
|
_labels[0] = 0;
|
||||||
_labels[1] = 0;
|
_labels[1] = 0;
|
||||||
|
|
||||||
|
_fail = false;
|
||||||
|
_len = 0;
|
||||||
|
_startTime = 0;
|
||||||
|
_state = 0;
|
||||||
|
|
||||||
_codeSelectBlocks[0] = Common::Rect( 111, 129, 127, 153 ); // na
|
_codeSelectBlocks[0] = Common::Rect( 111, 129, 127, 153 ); // na
|
||||||
_codeSelectBlocks[1] = Common::Rect( 128, 120, 144, 144 ); // wa
|
_codeSelectBlocks[1] = Common::Rect( 128, 120, 144, 144 ); // wa
|
||||||
_codeSelectBlocks[2] = Common::Rect( 145, 111, 161, 135 ); // ra
|
_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) {
|
ShowCreditsInputState_NS(Parallaction *vm, MenuInputHelper *helper) : MenuInputState("showcredits", helper), _vm(vm) {
|
||||||
_labels[0] = 0;
|
_labels[0] = 0;
|
||||||
_labels[1] = 0;
|
_labels[1] = 0;
|
||||||
|
|
||||||
|
_current = 0;
|
||||||
|
_startTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
~ShowCreditsInputState_NS() {
|
~ShowCreditsInputState_NS() {
|
||||||
|
@ -827,6 +836,8 @@ public:
|
||||||
_labels[1] = 0;
|
_labels[1] = 0;
|
||||||
_labels[2] = 0;
|
_labels[2] = 0;
|
||||||
_labels[3] = 0;
|
_labels[3] = 0;
|
||||||
|
|
||||||
|
_allPartsComplete = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void destroyLabels() {
|
void destroyLabels() {
|
||||||
|
|
|
@ -70,6 +70,9 @@ Input::Input(Parallaction *vm) : _vm(vm) {
|
||||||
_mouseButtons = 0;
|
_mouseButtons = 0;
|
||||||
_delayedActionZone.reset();
|
_delayedActionZone.reset();
|
||||||
|
|
||||||
|
_inputMode = 0;
|
||||||
|
_hasKeyPressEvent = false;
|
||||||
|
|
||||||
_dinoCursor = 0;
|
_dinoCursor = 0;
|
||||||
_dougCursor = 0;
|
_dougCursor = 0;
|
||||||
_donnaCursor = 0;
|
_donnaCursor = 0;
|
||||||
|
|
|
@ -145,6 +145,8 @@ Program::Program() {
|
||||||
_locals = new LocalVariable[NUM_LOCALS];
|
_locals = new LocalVariable[NUM_LOCALS];
|
||||||
_numLocals = 0;
|
_numLocals = 0;
|
||||||
_status = kProgramIdle;
|
_status = kProgramIdle;
|
||||||
|
_ip = 0;
|
||||||
|
_loopStart = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Program::~Program() {
|
Program::~Program() {
|
||||||
|
@ -259,6 +261,8 @@ Answer::Answer() {
|
||||||
_noFlags = 0;
|
_noFlags = 0;
|
||||||
_yesFlags = 0;
|
_yesFlags = 0;
|
||||||
_hasCounterCondition = false;
|
_hasCounterCondition = false;
|
||||||
|
_counterValue = 0;
|
||||||
|
_counterOp = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Answer::textIsNull() {
|
bool Answer::textIsNull() {
|
||||||
|
@ -298,6 +302,7 @@ Instruction::Instruction() {
|
||||||
|
|
||||||
// common
|
// common
|
||||||
_immediate = 0;
|
_immediate = 0;
|
||||||
|
_endif = 0;
|
||||||
|
|
||||||
// BRA specific
|
// BRA specific
|
||||||
_text = 0;
|
_text = 0;
|
||||||
|
|
|
@ -226,6 +226,7 @@ uint16 Script::readLineToken(bool errorOnEOF) {
|
||||||
void Parser::reset() {
|
void Parser::reset() {
|
||||||
_currentOpcodes = 0;
|
_currentOpcodes = 0;
|
||||||
_currentStatements = 0;
|
_currentStatements = 0;
|
||||||
|
_lookup = 0;
|
||||||
|
|
||||||
_statements.clear();
|
_statements.clear();
|
||||||
_opcodes.clear();
|
_opcodes.clear();
|
||||||
|
|
|
@ -405,7 +405,7 @@ protected:
|
||||||
virtual void parseRValue(ScriptVar &var, const char *str);
|
virtual void parseRValue(ScriptVar &var, const char *str);
|
||||||
|
|
||||||
public:
|
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();
|
virtual void init();
|
||||||
|
|
|
@ -86,7 +86,7 @@ protected:
|
||||||
byte *_trackEnd;
|
byte *_trackEnd;
|
||||||
|
|
||||||
public:
|
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;
|
_musicEnabled = true;
|
||||||
_sfxEnabled = true;
|
_sfxEnabled = true;
|
||||||
|
|
||||||
|
_sfxLooping = false;
|
||||||
|
_sfxVolume = 0;
|
||||||
|
_sfxRate = 0;
|
||||||
|
_sfxChannel = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SoundMan_br::~SoundMan_br() {
|
SoundMan_br::~SoundMan_br() {
|
||||||
|
|
|
@ -323,6 +323,11 @@ void AmigaSoundMan_ns::playLocationMusic(const char *location) {
|
||||||
|
|
||||||
SoundMan_ns::SoundMan_ns(Parallaction_ns *vm) : _vm(vm) {
|
SoundMan_ns::SoundMan_ns(Parallaction_ns *vm) : _vm(vm) {
|
||||||
_mixer = _vm->_mixer;
|
_mixer = _vm->_mixer;
|
||||||
|
_sfxLooping = false;
|
||||||
|
_sfxVolume = 0;
|
||||||
|
_sfxRate = 0;
|
||||||
|
_sfxChannel = 0;
|
||||||
|
_musicType = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoundMan_ns::setMusicVolume(int value) {
|
void SoundMan_ns::setMusicVolume(int value) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue