aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/pet_control
diff options
context:
space:
mode:
authorPaul Gilbert2016-06-26 23:00:00 -0400
committerPaul Gilbert2016-07-15 19:25:19 -0400
commitef1d10e926fcf31ffeb5c594a305ec0cd8bf7064 (patch)
treee475bdb1a91a7f87f96a9582addd861ea66a4a66 /engines/titanic/pet_control
parentb6f476c70f90dd451e7e931fe91ce7c86b922b20 (diff)
downloadscummvm-rg350-ef1d10e926fcf31ffeb5c594a305ec0cd8bf7064.tar.gz
scummvm-rg350-ef1d10e926fcf31ffeb5c594a305ec0cd8bf7064.tar.bz2
scummvm-rg350-ef1d10e926fcf31ffeb5c594a305ec0cd8bf7064.zip
TITANIC: Implemented remaining CGameManager methods and others
Diffstat (limited to 'engines/titanic/pet_control')
-rw-r--r--engines/titanic/pet_control/pet_control.cpp12
-rw-r--r--engines/titanic/pet_control/pet_control.h24
-rw-r--r--engines/titanic/pet_control/pet_starfield.cpp8
-rw-r--r--engines/titanic/pet_control/pet_starfield.h29
4 files changed, 55 insertions, 18 deletions
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 793436521c..1643459963 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -251,7 +251,7 @@ CRoomItem *CPetControl::getHiddenRoom() {
CGameObject *CPetControl::getHiddenObject(const CString &name) {
CRoomItem *room = getHiddenRoom();
- return room ? findUnder(room, name) : nullptr;
+ return room ? static_cast<CGameObject *>(findUnder(room, name)) : nullptr;
}
bool CPetControl::containsPt(const Common::Point &pt) const {
@@ -677,4 +677,14 @@ int CPetControl::getMailDest(const CRoomFlags &roomFlags) const {
return roomFlags.getSuccUBusNum(roomFlags.getSuccUBusRoomName());
}
+void CPetControl::starsSetButtons(int val1, int val2) {
+ _starfield.setButtons(val1, val2);
+ if (_currentArea == PET_STARFIELD)
+ _starfield.makePetDirty();
+}
+
+void CPetControl::starsSetReference(bool hasRef) {
+ _starfield.setHasReference(hasRef);
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index e389a0e31a..5601c403f4 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -386,6 +386,13 @@ public:
void resetActiveNPC();
/**
+ * Resets NPC in conversations
+ */
+ void convResetNPC() {
+ _conversations.resetNPC();
+ }
+
+ /**
* Resets the conversation dials back to 0 position
*/
void resetDials0() { _conversations.resetDials0(); }
@@ -543,6 +550,23 @@ public:
bool isSuccUBusRoom(const CRoomFlags &roomFlags) {
return roomFlags.isSuccUBusRoomFlags();
}
+
+ /**
+ * Called with a phonograph action for Send, Receive, or Record
+ */
+ void phonographAction(const CString &action) {
+ // Original had some code that had no effect
+ }
+
+ /**
+ * Sets the status buttons for the starfield control
+ */
+ void starsSetButtons(int val1, int val2);
+
+ /**
+ * Set whether the user has the galactic reference material
+ */
+ void starsSetReference(bool hasRef);
};
} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_starfield.cpp b/engines/titanic/pet_control/pet_starfield.cpp
index 4230d9454f..cde512c681 100644
--- a/engines/titanic/pet_control/pet_starfield.cpp
+++ b/engines/titanic/pet_control/pet_starfield.cpp
@@ -28,7 +28,7 @@
namespace Titanic {
CPetStarfield::CPetStarfield() : _field18C(0), _photoOn(true),
- _field210(0), _rect1(22, 352, 598, 478) {
+ _hasReference(false), _rect1(22, 352, 598, 478) {
_btnOffsets[0] = _btnOffsets[1] = _btnOffsets[2] = 0;
}
@@ -86,7 +86,7 @@ bool CPetStarfield::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
CPETHelmetOnOffMsg helmetMsg;
helmetMsg.execute(_petControl->_remoteTarget);
} else if (_imgPhoto.MouseButtonDownMsg(msg->_mousePos)) {
- if (_field210) {
+ if (_hasReference) {
_photoOn = !_photoOn;
CPETPhotoOnOffMsg photoMsg;
photoMsg.execute(_petControl->_remoteTarget);
@@ -124,7 +124,7 @@ bool CPetStarfield::isValid(CPetControl *petControl) {
void CPetStarfield::load(SimpleFile *file, int param) {
if (!param) {
_photoOn = file->readNumber();
- _field210 = file->readNumber();
+ _hasReference = file->readNumber();
}
}
@@ -134,7 +134,7 @@ void CPetStarfield::postLoad() {
void CPetStarfield::save(SimpleFile *file, int indent) const {
file->writeNumberLine(_photoOn, indent);
- file->writeNumberLine(_field210, indent);
+ file->writeNumberLine(_hasReference, indent);
}
bool CPetStarfield::setupControl(CPetControl *petControl) {
diff --git a/engines/titanic/pet_control/pet_starfield.h b/engines/titanic/pet_control/pet_starfield.h
index 6cfc308d24..ec659ccb31 100644
--- a/engines/titanic/pet_control/pet_starfield.h
+++ b/engines/titanic/pet_control/pet_starfield.h
@@ -41,7 +41,7 @@ private:
int _field18C;
CPetText _text;
bool _photoOn;
- int _field210;
+ bool _hasReference;
private:
/**
* Setup the control
@@ -53,18 +53,6 @@ private:
*/
void drawButton(int offset, int index, CScreenManager *screenManager);
- void set210(int val) { _field210 = val; }
-
- /**
- * Sets the offsets for each of the buttons
- */
- void setButtons(int val1, int val2);
-
- /**
- * Make the PET as dirty, requiring a redraw
- */
- void makePetDirty();
-
/**
* Mouse down handling for Nav elements
*/
@@ -115,6 +103,21 @@ public:
* Save the data for the class to file
*/
virtual void save(SimpleFile *file, int indent) const;
+
+ /**
+ * Sets the offsets for each of the buttons
+ */
+ void setButtons(int val1, int val2);
+
+ /**
+ * Sets whether the player has the galactic reference material
+ */
+ void setHasReference(bool hasRef) { _hasReference = hasRef; }
+
+ /**
+ * Make the PET as dirty, requiring a redraw
+ */
+ void makePetDirty();
};
} // End of namespace Titanic