diff options
author | Paul Gilbert | 2017-01-22 10:05:52 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-01-22 10:05:52 -0500 |
commit | 487d1a552f5b59500e59990db82fc10c156e1e2e (patch) | |
tree | c1a227d881cbc34e56d5c64a9437b96cbc284ce7 | |
parent | 96c8481f0c914c1c14763d77d4fc94b051f121d6 (diff) | |
download | scummvm-rg350-487d1a552f5b59500e59990db82fc10c156e1e2e.tar.gz scummvm-rg350-487d1a552f5b59500e59990db82fc10c156e1e2e.tar.bz2 scummvm-rg350-487d1a552f5b59500e59990db82fc10c156e1e2e.zip |
TITANIC: Renamings for SuccUBus & hose, minor fixes
-rw-r--r-- | engines/titanic/carry/hose.cpp | 11 | ||||
-rw-r--r-- | engines/titanic/carry/hose.h | 2 | ||||
-rw-r--r-- | engines/titanic/carry/hose_end.cpp | 5 | ||||
-rw-r--r-- | engines/titanic/messages/messages.h | 2 | ||||
-rw-r--r-- | engines/titanic/npcs/parrot_succubus.cpp | 32 | ||||
-rw-r--r-- | engines/titanic/npcs/parrot_succubus.h | 2 | ||||
-rw-r--r-- | engines/titanic/npcs/succubus.cpp | 76 | ||||
-rw-r--r-- | engines/titanic/npcs/succubus.h | 16 |
8 files changed, 72 insertions, 74 deletions
diff --git a/engines/titanic/carry/hose.cpp b/engines/titanic/carry/hose.cpp index cbca3beea7..ac7c7813ca 100644 --- a/engines/titanic/carry/hose.cpp +++ b/engines/titanic/carry/hose.cpp @@ -44,15 +44,14 @@ void CHose::deinit() { delete _statics; } -CHose::CHose() : CCarry(), - _string6(g_vm->_strings[HOSE_INCOMPATIBLE]) { +CHose::CHose() : CCarry() { } void CHose::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); file->writeNumberLine(_statics->_actionVal, indent); file->writeQuotedLine(_statics->_actionTarget, indent); - file->writeQuotedLine(_string6, indent); + file->writeQuotedLine(_unused1, indent); CCarry::save(file, indent); } @@ -60,7 +59,7 @@ void CHose::load(SimpleFile *file) { file->readNumber(); _statics->_actionVal = file->readNumber(); _statics->_actionTarget = file->readString(); - _string6 = file->readString(); + _unused1 = file->readString(); CCarry::load(file); } @@ -70,7 +69,7 @@ bool CHose::DropZoneGotObjectMsg(CDropZoneGotObjectMsg *msg) { pumpingMsg._value = _statics->_actionVal; pumpingMsg.execute(_statics->_actionTarget); CHoseConnectedMsg connectedMsg; - connectedMsg._value = 1; + connectedMsg._connected = true; connectedMsg.execute(this); return true; @@ -99,7 +98,7 @@ bool CHose::UseWithCharMsg(CUseWithCharMsg *msg) { } bool CHose::HoseConnectedMsg(CHoseConnectedMsg *msg) { - if (msg->_value) { + if (msg->_connected) { CHose *hose = dynamic_cast<CHose *>(findChildInstanceOf(CHose::_type)); if (hose) { setVisible(true); diff --git a/engines/titanic/carry/hose.h b/engines/titanic/carry/hose.h index 3c8c1549c1..0ec37b5b4d 100644 --- a/engines/titanic/carry/hose.h +++ b/engines/titanic/carry/hose.h @@ -41,7 +41,7 @@ class CHose : public CCarry { bool HoseConnectedMsg(CHoseConnectedMsg *msg); bool DropZoneLostObjectMsg(CDropZoneLostObjectMsg *msg); protected: - CString _string6; + CString _unused1; public: static CHoseStatics *_statics; public: diff --git a/engines/titanic/carry/hose_end.cpp b/engines/titanic/carry/hose_end.cpp index c9996437bb..6f8c965182 100644 --- a/engines/titanic/carry/hose_end.cpp +++ b/engines/titanic/carry/hose_end.cpp @@ -27,18 +27,17 @@ namespace Titanic { EMPTY_MESSAGE_MAP(CHoseEnd, CHose); CHoseEnd::CHoseEnd() : CHose() { - _string6 = "Connection refused by remote hose."; } void CHoseEnd::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeQuotedLine(_string6, indent); + file->writeQuotedLine(_unused1, indent); CHose::save(file, indent); } void CHoseEnd::load(SimpleFile *file) { file->readNumber(); - _string6 = file->readString(); + _unused1 = file->readString(); CHose::load(file); } diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h index 2a95c3f5fa..6832c69f3c 100644 --- a/engines/titanic/messages/messages.h +++ b/engines/titanic/messages/messages.h @@ -270,7 +270,7 @@ MESSAGE1(CGetChevLiftBits, int, liftBits, 0); MESSAGE1(CGetChevLiftNum, int, liftNum, 0); MESSAGE1(CGetChevRoomBits, int, roomNum, 0); MESSAGE1(CGetChevRoomNum, int, roomNum, 0); -MESSAGE2(CHoseConnectedMsg, int, value, 1, CGameObject *, object, nullptr); +MESSAGE2(CHoseConnectedMsg, bool, connected, true, CGameObject *, object, nullptr); MESSAGE0(CInitializeAnimMsg); MESSAGE1(CIsEarBowlPuzzleDone, int, value, 0); MESSAGE3(CIsHookedOnMsg, Rect, rect, Rect(), bool, result, false, CString, string1, ""); diff --git a/engines/titanic/npcs/parrot_succubus.cpp b/engines/titanic/npcs/parrot_succubus.cpp index 08866f187d..2fa5b2f844 100644 --- a/engines/titanic/npcs/parrot_succubus.cpp +++ b/engines/titanic/npcs/parrot_succubus.cpp @@ -34,13 +34,13 @@ BEGIN_MESSAGE_MAP(CParrotSuccUBus, CSuccUBus) ON_MESSAGE(LeaveNodeMsg) END_MESSAGE_MAP() -CParrotSuccUBus::CParrotSuccUBus() : CSuccUBus(), _field1DC(0), +CParrotSuccUBus::CParrotSuccUBus() : CSuccUBus(), _hoseConnected(false), _field1EC(0), _field1F0(376), _field1F4(393) { } void CParrotSuccUBus::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeNumberLine(_field1DC, indent); + file->writeNumberLine(_hoseConnected, indent); file->writeQuotedLine(_string3, indent); file->writeNumberLine(_field1EC, indent); @@ -49,7 +49,7 @@ void CParrotSuccUBus::save(SimpleFile *file, int indent) { void CParrotSuccUBus::load(SimpleFile *file) { file->readNumber(); - _field1DC = file->readNumber(); + _hoseConnected = file->readNumber(); _string3 = file->readString(); _field1EC = file->readNumber(); @@ -58,13 +58,13 @@ void CParrotSuccUBus::load(SimpleFile *file) { bool CParrotSuccUBus::HoseConnectedMsg(CHoseConnectedMsg *msg) { CPetControl *pet = getPetControl(); - if (msg->_value == _field1DC) + if (msg->_connected == _hoseConnected) return true; if (mailExists(pet->getRoomFlags())) return false; - _field1DC = msg->_value; - if (_field1DC) { + _hoseConnected = msg->_connected; + if (_hoseConnected) { CGameObject *item = msg->_object; _string3 = item->getName(); CHoseConnectedMsg hoseMsg(1, this); @@ -73,7 +73,7 @@ bool CParrotSuccUBus::HoseConnectedMsg(CHoseConnectedMsg *msg) { CPumpingMsg pumpingMsg(1, this); pumpingMsg.execute(this); - _field1DC = 1; + _hoseConnected = true; if (_enabled) { _enabled = false; @@ -82,7 +82,7 @@ bool CParrotSuccUBus::HoseConnectedMsg(CHoseConnectedMsg *msg) { playSound("z#26.wav"); } - playMovie(_field1C4, _field1C8, MOVIE_NOTIFY_OBJECT); + playMovie(_hoseStartFrame, _hoseEndFrame, MOVIE_NOTIFY_OBJECT); } else { stopMovie(); stopSound(_field1EC); @@ -106,8 +106,8 @@ bool CParrotSuccUBus::HoseConnectedMsg(CHoseConnectedMsg *msg) { } bool CParrotSuccUBus::EnterViewMsg(CEnterViewMsg *msg) { - if (_field1DC) { - playMovie(_field1CC, _field1D0, MOVIE_REPEAT); + if (_hoseConnected) { + playMovie(_pumpingStartFrame, _pumpingEndFrame, MOVIE_REPEAT); return true; } else { return CSuccUBus::EnterViewMsg(msg); @@ -115,8 +115,8 @@ bool CParrotSuccUBus::EnterViewMsg(CEnterViewMsg *msg) { } bool CParrotSuccUBus::MovieEndMsg(CMovieEndMsg *msg) { - if (msg->_endFrame == _field1C8) { - playMovie(_field1CC, _field1D0, MOVIE_REPEAT); + if (msg->_endFrame == _hoseEndFrame) { + playMovie(_pumpingStartFrame, _pumpingEndFrame, MOVIE_REPEAT); _field1EC = playSound("z#472.wav"); return true; } else { @@ -125,9 +125,9 @@ bool CParrotSuccUBus::MovieEndMsg(CMovieEndMsg *msg) { } bool CParrotSuccUBus::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { - if (_field1DC) { + if (_hoseConnected) { CHoseConnectedMsg hoseMsg; - hoseMsg._value = 0; + hoseMsg._connected = false; hoseMsg.execute(this); return true; } else { @@ -136,12 +136,12 @@ bool CParrotSuccUBus::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { } bool CParrotSuccUBus::LeaveNodeMsg(CLeaveNodeMsg *msg) { - if (_field1DC) { + if (_hoseConnected) { getHiddenObject(_string3); if (CHose::_statics->_actionTarget.empty()) { playSound("z#51.wav"); CHoseConnectedMsg hoseMsg; - hoseMsg._value = 0; + hoseMsg._connected = false; hoseMsg.execute(this); } } diff --git a/engines/titanic/npcs/parrot_succubus.h b/engines/titanic/npcs/parrot_succubus.h index 74a4a032eb..69a076c622 100644 --- a/engines/titanic/npcs/parrot_succubus.h +++ b/engines/titanic/npcs/parrot_succubus.h @@ -35,7 +35,7 @@ class CParrotSuccUBus : public CSuccUBus { bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); bool LeaveNodeMsg(CLeaveNodeMsg *msg); public: - int _field1DC; + bool _hoseConnected; CString _string3; int _field1EC; int _field1F0; diff --git a/engines/titanic/npcs/succubus.cpp b/engines/titanic/npcs/succubus.cpp index 3534ba03e3..662dca52bc 100644 --- a/engines/titanic/npcs/succubus.cpp +++ b/engines/titanic/npcs/succubus.cpp @@ -86,18 +86,18 @@ CSuccUBus::CSuccUBus() : CTrueTalkNPC() { _soundHandle = -1; _isChicken = false; _isFeathers = false; - _field1AC = 0; - _field1B0 = 0; + _priorRandomVal1 = 0; + _priorRandomVal2 = 0; _emptyStartFrame = 303; _emptyEndFrame = 312; _smokeStartFrame = 313; _smokeEndFrame = 325; - _field1C4 = 326; - _field1C8 = 347; - _field1CC = 348; - _field1D0 = 375; - _field1D4 = 1; - _field1D8 = 0; + _hoseStartFrame = 326; + _hoseEndFrame = 347; + _pumpingStartFrame = 348; + _pumpingEndFrame = 375; + _destRoomFlags = 1; + _inProgress = false; } void CSuccUBus::save(SimpleFile *file, int indent) { @@ -145,20 +145,20 @@ void CSuccUBus::save(SimpleFile *file, int indent) { file->writeNumberLine(_soundHandle, indent); file->writeNumberLine(_isChicken, indent); file->writeNumberLine(_isFeathers, indent); - file->writeNumberLine(_field1AC, indent); - file->writeNumberLine(_field1B0, indent); + file->writeNumberLine(_priorRandomVal1, indent); + file->writeNumberLine(_priorRandomVal2, indent); file->writeNumberLine(_emptyStartFrame, indent); file->writeNumberLine(_emptyEndFrame, indent); file->writeNumberLine(_smokeStartFrame, indent); file->writeNumberLine(_smokeEndFrame, indent); - file->writeNumberLine(_field1C4, indent); - file->writeNumberLine(_field1C8, indent); - file->writeNumberLine(_field1CC, indent); - file->writeNumberLine(_field1D0, indent); - file->writeNumberLine(_field1D4, indent); + file->writeNumberLine(_hoseStartFrame, indent); + file->writeNumberLine(_hoseEndFrame, indent); + file->writeNumberLine(_pumpingStartFrame, indent); + file->writeNumberLine(_pumpingEndFrame, indent); + file->writeNumberLine(_destRoomFlags, indent); file->writeNumberLine(_v3, indent); - file->writeNumberLine(_field1D8, indent); + file->writeNumberLine(_inProgress, indent); file->writeNumberLine(_field104, indent); CTrueTalkNPC::save(file, indent); @@ -209,27 +209,27 @@ void CSuccUBus::load(SimpleFile *file) { _soundHandle = file->readNumber(); _isChicken = file->readNumber(); _isFeathers = file->readNumber(); - _field1AC = file->readNumber(); - _field1B0 = file->readNumber(); + _priorRandomVal1 = file->readNumber(); + _priorRandomVal2 = file->readNumber(); _emptyStartFrame = file->readNumber(); _emptyEndFrame = file->readNumber(); _smokeStartFrame = file->readNumber(); _smokeEndFrame = file->readNumber(); - _field1C4 = file->readNumber(); - _field1C8 = file->readNumber(); - _field1CC = file->readNumber(); - _field1D0 = file->readNumber(); - _field1D4 = file->readNumber(); + _hoseStartFrame = file->readNumber(); + _hoseEndFrame = file->readNumber(); + _pumpingStartFrame = file->readNumber(); + _pumpingEndFrame = file->readNumber(); + _destRoomFlags = file->readNumber(); _v3 = file->readNumber(); - _field1D8 = file->readNumber(); + _inProgress = file->readNumber(); _field104 = file->readNumber(); CTrueTalkNPC::load(file); } bool CSuccUBus::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { - if (!_field1D8) { + if (!_inProgress) { Rect tempRect = _rect1; tempRect.translate(_bounds.left, _bounds.top); @@ -242,7 +242,7 @@ bool CSuccUBus::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { CTurnOff offMsg; offMsg.execute(this); } else { - switch (getRandomNumber(2)) { + switch (getRandomNumber(2, &_priorRandomVal1)) { case 0: startTalking(this, 230055, findView()); break; @@ -376,7 +376,7 @@ bool CSuccUBus::LeaveViewMsg(CLeaveViewMsg *msg) { } bool CSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) { - if (_field1D8) + if (_inProgress) return true; if (!_enabled) { @@ -409,7 +409,7 @@ bool CSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) { } else { _sendLost = false; - CRoomFlags roomFlags = _roomFlags; + CRoomFlags roomFlags = _destRoomFlags; if (!pet->isSuccUBusDest(roomFlags) || pet->getMailDestClass(roomFlags) < getPassengerClass()) { roomFlags = pet->getSpecialRoomFlags("BilgeRoom"); _sendLost = true; @@ -419,7 +419,7 @@ bool CSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) { _isChicken = mailObject->getName() == "Chicken"; _field158 = 0; _field188 = 0; - _field1D8 = 1; + _inProgress = true; incTransitions(); if (_isFeathers) { @@ -466,7 +466,7 @@ bool CSuccUBus::PETDeliverMsg(CPETDeliverMsg *msg) { bool CSuccUBus::PETReceiveMsg(CPETReceiveMsg *msg) { CPetControl *pet = getPetControl(); - if (_field1D8 || !pet) + if (_inProgress || !pet) return true; if (!_enabled) { petDisplayMessage(2, SUCCUBUS_IS_IN_STANDBY); @@ -510,7 +510,7 @@ bool CSuccUBus::PETReceiveMsg(CPETReceiveMsg *msg) { if (_receiveStartFrame >= 0) { _field158 = 1; - _field1D8 = 1; + _inProgress = true; incTransitions(); playMovie(_receiveStartFrame, _receiveEndFrame, MOVIE_NOTIFY_OBJECT); } @@ -573,7 +573,7 @@ bool CSuccUBus::MovieEndMsg(CMovieEndMsg *msg) { stopSound(_soundHandle); _soundHandle = -1; - switch (getRandomNumber(_v2 ? 7 : 5, &_field1B0)) { + switch (getRandomNumber(_v2 ? 7 : 5, &_priorRandomVal2)) { case 2: startTalking(this, 230001, findView()); break; @@ -613,8 +613,8 @@ bool CSuccUBus::MovieEndMsg(CMovieEndMsg *msg) { startTalking(this, 230013, findView()); } - if (_field1D8) { - _field1D8 = 0; + if (_inProgress) { + _inProgress = false; decTransitions(); } @@ -630,8 +630,8 @@ bool CSuccUBus::MovieEndMsg(CMovieEndMsg *msg) { _field188 = 1; _mailP = 0; - if (_field1D8) { - _field1D8 = 0; + if (_inProgress) { + _inProgress = false; decTransitions(); } @@ -743,7 +743,7 @@ bool CSuccUBus::SUBTransition(CSUBTransition *msg) { bool CSuccUBus::SetChevRoomBits(CSetChevRoomBits *msg) { if (_enabled) { - _roomFlags = msg->_roomFlags; + _destRoomFlags = msg->_roomFlags; playSound("z#98.wav", 100); } @@ -764,7 +764,7 @@ bool CSuccUBus::MouseDragStartMsg(CMouseDragStartMsg *msg) { Rect tempRect = _rect1; tempRect.translate(_bounds.left, _bounds.top); - if (_field1D8 || !_enabled || !_field188 || !tempRect.contains(msg->_mousePos) + if (_inProgress || !_enabled || !_field188 || !tempRect.contains(msg->_mousePos) || !pet) return true; diff --git a/engines/titanic/npcs/succubus.h b/engines/titanic/npcs/succubus.h index d996bcdc68..81bd483f79 100644 --- a/engines/titanic/npcs/succubus.h +++ b/engines/titanic/npcs/succubus.h @@ -88,18 +88,18 @@ protected: int _soundHandle; bool _isChicken; bool _isFeathers; - int _field1AC; - int _field1B0; + int _priorRandomVal1; + int _priorRandomVal2; int _emptyStartFrame; int _emptyEndFrame; int _smokeStartFrame; int _smokeEndFrame; - int _field1C4; - int _field1C8; - int _field1CC; - int _field1D0; - int _field1D4; - int _field1D8; + int _hoseStartFrame; + int _hoseEndFrame; + int _pumpingStartFrame; + int _pumpingEndFrame; + uint _destRoomFlags; + bool _inProgress; public: CLASSDEF; CSuccUBus(); |