aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2017-02-16 21:34:59 -0500
committerPaul Gilbert2017-02-16 21:34:59 -0500
commitd56e4e4584ccb7d0741118da0ffb61129c767bee (patch)
tree54649ffafe2f7e60ea65d59590b2c45aca73a4c4
parent216e57aff49b43446699f236f47f67df2c95d0f1 (diff)
downloadscummvm-rg350-d56e4e4584ccb7d0741118da0ffb61129c767bee.tar.gz
scummvm-rg350-d56e4e4584ccb7d0741118da0ffb61129c767bee.tar.bz2
scummvm-rg350-d56e4e4584ccb7d0741118da0ffb61129c767bee.zip
TITANIC: Further renamings for CGameObject
-rw-r--r--engines/titanic/core/game_object.cpp61
-rw-r--r--engines/titanic/core/game_object.h26
-rw-r--r--engines/titanic/core/view_item.cpp2
-rw-r--r--engines/titanic/game_manager.cpp2
-rw-r--r--engines/titanic/game_state.cpp6
-rw-r--r--engines/titanic/game_state.h2
-rw-r--r--engines/titanic/gfx/toggle_switch.cpp4
-rw-r--r--engines/titanic/moves/enter_bridge.cpp2
-rw-r--r--engines/titanic/npcs/doorbot.cpp4
9 files changed, 56 insertions, 53 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index cd45094f2a..ff5fb9b1eb 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -56,26 +56,25 @@ void CGameObject::deinit() {
CGameObject::CGameObject(): CNamedItem() {
_bounds = Rect(0, 0, 15, 15);
- _field34 = 0;
- _field38 = 0;
- _field3C = 0;
+ _unused1 = 0;
+ _unused2 = 0;
+ _unused3 = 0;
_nonvisual = false;
- _field44 = 0xF0;
- _field48 = 0xF0;
- _field4C = 0xFF;
+ _toggleR = 0xF0;
+ _toggleG = 0xF0;
+ _toggleB = 0xFF;
_isPendingMail = false;
_destRoomFlags = 0;
_roomFlags = 0;
_visible = true;
- _field60 = 0;
+ _handleMouseFlag = false;
_cursorId = CURSOR_ARROW;
_initialFrame = 0;
_frameNumber = -1;
_text = nullptr;
_textBorder = _textBorderRight = 0;
- _field9C = 0;
_surface = nullptr;
- _fieldB8 = 0;
+ _unused4 = 0;
}
CGameObject::~CGameObject() {
@@ -105,19 +104,19 @@ void CGameObject::save(SimpleFile *file, int indent) {
file->writeNumberLine(getMovieFrame(), indent + 1);
file->writeNumberLine(_cursorId, indent + 1);
_movieClips.save(file, indent + 1);
- file->writeNumberLine(_field60, indent + 1);
+ file->writeNumberLine(_handleMouseFlag, indent + 1);
file->writeNumberLine(_nonvisual, indent + 1);
file->writeQuotedLine(_resource, indent + 1);
file->writeBounds(_bounds, indent + 1);
- file->writeFloatLine(_field34, indent + 1);
- file->writeFloatLine(_field38, indent + 1);
- file->writeFloatLine(_field3C, indent + 1);
+ file->writeFloatLine(_unused1, indent + 1);
+ file->writeFloatLine(_unused2, indent + 1);
+ file->writeFloatLine(_unused3, indent + 1);
- file->writeNumberLine(_field44, indent + 1);
- file->writeNumberLine(_field48, indent + 1);
- file->writeNumberLine(_field4C, indent + 1);
- file->writeNumberLine(_fieldB8, indent + 1);
+ file->writeNumberLine(_toggleR, indent + 1);
+ file->writeNumberLine(_toggleG, indent + 1);
+ file->writeNumberLine(_toggleB, indent + 1);
+ file->writeNumberLine(_unused4, indent + 1);
file->writeNumberLine(_visible, indent + 1);
file->writeNumberLine(_isPendingMail, indent + 1);
file->writeNumberLine(_destRoomFlags, indent + 1);
@@ -153,7 +152,7 @@ void CGameObject::load(SimpleFile *file) {
// Deliberate fall-through
case 4:
- _field60 = file->readNumber();
+ _handleMouseFlag = file->readNumber();
// Deliberate fall-through
case 3:
@@ -166,13 +165,13 @@ void CGameObject::load(SimpleFile *file) {
case 1:
_bounds = file->readBounds();
- _field34 = file->readFloat();
- _field38 = file->readFloat();
- _field3C = file->readFloat();
- _field44 = file->readNumber();
- _field48 = file->readNumber();
- _field4C = file->readNumber();
- _fieldB8 = file->readNumber();
+ _unused1 = file->readFloat();
+ _unused2 = file->readFloat();
+ _unused3 = file->readFloat();
+ _toggleR = file->readNumber();
+ _toggleG = file->readNumber();
+ _toggleB = file->readNumber();
+ _unused4 = file->readNumber();
_visible = file->readNumber() != 0;
_isPendingMail = file->readNumber();
_destRoomFlags = file->readNumber();
@@ -1369,11 +1368,11 @@ void CGameObject::createCredits() {
_credits->load(this, screenManager, _bounds);
}
-void CGameObject::fn10(int v1, int v2, int v3) {
+void CGameObject::setToggleColor(byte r, byte g, byte b) {
makeDirty();
- _field44 = v1;
- _field48 = v2;
- _field4C = v3;
+ _toggleR = r;
+ _toggleG = g;
+ _toggleB = b;
}
void CGameObject::movieSetAudioTiming(bool flag) {
@@ -1425,8 +1424,8 @@ bool CGameObject::compareRoomFlags(RoomFlagsComparison compareType, uint flags1,
}
}
-void CGameObject::setState1C(bool flag) {
- getGameManager()->_gameState._field1C = flag;
+void CGameObject::stateSetSoundMakerAllowed(bool flag) {
+ getGameManager()->_gameState._soundMakerAllowed = flag;
}
void CGameObject::addMail(uint destRoomFlags) {
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 88baf0aec2..a1e2c35431 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -77,13 +77,11 @@ private:
protected:
static CCreditText *_credits;
protected:
- double _field34;
- double _field38;
- double _field3C;
+ double _unused1;
+ double _unused2;
+ double _unused3;
bool _nonvisual;
- int _field44;
- int _field48;
- int _field4C;
+ byte _toggleR, _toggleG, _toggleB;
CMovieClipList _movieClips;
int _initialFrame;
CMovieRangeInfoList _movieRangeInfoList;
@@ -91,11 +89,10 @@ protected:
CTextControl *_text;
uint _textBorder;
uint _textBorderRight;
- int _field9C;
Common::Point _savedPos;
CVideoSurface *_surface;
CString _resource;
- int _fieldB8;
+ int _unused4;
protected:
/**
* Saves the current position the object is located at
@@ -465,7 +462,11 @@ protected:
*/
void setPassengerClass(PassengerClass newClass);
- void fn10(int v1, int v2, int v3);
+ /**
+ * Sets color RGB for toggles
+ * @remarks The color set isn't actually used anywhere
+ */
+ void setToggleColor(byte r, byte g, byte b);
/**
* Gets the duration of a specified clip in milliseconds
@@ -526,7 +527,7 @@ public:
bool _isPendingMail;
uint _destRoomFlags;
uint _roomFlags;
- int _field60;
+ bool _handleMouseFlag;
CursorId _cursorId;
bool _visible;
public:
@@ -990,7 +991,10 @@ public:
/*--- CGameState Methods ---*/
- void setState1C(bool flag);
+ /**
+ * Sets whether a background sound maker is allowed for the rooms if available
+ */
+ void stateSetSoundMakerAllowed(bool flag);
/**
* Change to the next season
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 9109bcc5b2..15d187e194 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -260,7 +260,7 @@ bool CViewItem::handleMouseMsg(CMouseMsg *msg, bool flag) {
CGameObject *gameObject = dynamic_cast<CGameObject *>(treeItem);
if (gameObject) {
if (gameObject->checkPoint(msg->_mousePos, false, true) &&
- (!flag || !gameObject->_field60)) {
+ (!flag || !gameObject->_handleMouseFlag)) {
if (gameObjects.size() < 256)
gameObjects.push_back(gameObject);
}
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 96aeda1b83..5f51498e93 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -276,7 +276,7 @@ void CGameManager::frameMessage(CRoomItem *room) {
CFrameMsg frameMsg(g_vm->_events->getTicksCount());
frameMsg.execute(room, nullptr, MSGFLAG_SCAN);
- if (!_soundMaker) {
+ if (_gameState._soundMakerAllowed && !_soundMaker) {
// Check for a sound maker in the room
_soundMaker = dynamic_cast<CBackgroundSoundMaker *>(
_project->findByName("zBackgroundSoundMaker"));
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index c1100c6259..7ddd16ab22 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -46,7 +46,7 @@ bool CGameStateMovieList::empty() {
CGameState::CGameState(CGameManager *gameManager) :
_gameManager(gameManager), _gameLocation(this), _passengerClass(NO_CLASS),
_priorClass(NO_CLASS), _mode(GSMODE_NONE), _seasonNum(SEASON_SUMMER),
- _petActive(false), _field1C(false), _quitGame(false), _parrotMet(false),
+ _petActive(false), _soundMakerAllowed(false), _quitGame(false), _parrotMet(false),
_nodeChangeCtr(0), _nodeEnterTicks(0), _parrotResponseIndex(0) {
}
@@ -58,7 +58,7 @@ void CGameState::save(SimpleFile *file) const {
file->writeNumber(_parrotMet);
file->writeNumber(_parrotResponseIndex);
_gameLocation.save(file);
- file->writeNumber(_field1C);
+ file->writeNumber(_soundMakerAllowed);
}
void CGameState::load(SimpleFile *file) {
@@ -70,7 +70,7 @@ void CGameState::load(SimpleFile *file) {
_parrotResponseIndex = file->readNumber();
_gameLocation.load(file);
- _field1C = file->readNumber();
+ _soundMakerAllowed = file->readNumber();
_nodeChangeCtr = 0;
_nodeEnterTicks = 0;
}
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index 7bcc0a265f..547e8f8221 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -69,7 +69,7 @@ public:
GameStateMode _mode;
Season _seasonNum;
bool _petActive;
- bool _field1C;
+ bool _soundMakerAllowed;
bool _quitGame;
bool _parrotMet;
uint _nodeChangeCtr;
diff --git a/engines/titanic/gfx/toggle_switch.cpp b/engines/titanic/gfx/toggle_switch.cpp
index 815f96cb5a..dae9acba0e 100644
--- a/engines/titanic/gfx/toggle_switch.cpp
+++ b/engines/titanic/gfx/toggle_switch.cpp
@@ -52,9 +52,9 @@ void CToggleSwitch::load(SimpleFile *file) {
bool CToggleSwitch::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
_pressed = !_pressed;
if (_pressed)
- fn10(0, 0, 0);
+ setToggleColor(0, 0, 0);
else
- fn10(0xff, 0xff, 0xff);
+ setToggleColor(0xff, 0xff, 0xff);
return true;
}
diff --git a/engines/titanic/moves/enter_bridge.cpp b/engines/titanic/moves/enter_bridge.cpp
index fb44fe2e02..a9fbb5aff1 100644
--- a/engines/titanic/moves/enter_bridge.cpp
+++ b/engines/titanic/moves/enter_bridge.cpp
@@ -45,7 +45,7 @@ bool CEnterBridge::EnterRoomMsg(CEnterRoomMsg *msg) {
CActMsg actMsg("Disable");
actMsg.execute("ShipAnnouncements");
- setState1C(false);
+ stateSetSoundMakerAllowed(false);
_flag = false;
}
diff --git a/engines/titanic/npcs/doorbot.cpp b/engines/titanic/npcs/doorbot.cpp
index 79e3dafed4..ff518adccf 100644
--- a/engines/titanic/npcs/doorbot.cpp
+++ b/engines/titanic/npcs/doorbot.cpp
@@ -95,7 +95,7 @@ bool CDoorbot::MovieEndMsg(CMovieEndMsg *msg) {
case 6:
if (clipExistsByEnd("Cloak On", msg->_endFrame)) {
petShow();
- setState1C(true);
+ stateSetSoundMakerAllowed(true);
changeView("ServiceElevator.Node 1.S");
changeView("ServiceElevator.Node 1.N");
}
@@ -129,7 +129,7 @@ bool CDoorbot::MovieEndMsg(CMovieEndMsg *msg) {
_introMovieNum = 0;
} else if (clipExistsByEnd("Cloak On", msg->_endFrame)) {
petShow();
- setState1C(true);
+ stateSetSoundMakerAllowed(true);
changeView("ServiceElevator.Node 1.S");
} else {
CTrueTalkNPC::MovieEndMsg(msg);