aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/core/game_object.cpp22
-rw-r--r--engines/titanic/core/game_object.h20
-rw-r--r--engines/titanic/pet_control/pet_control.cpp15
-rw-r--r--engines/titanic/pet_control/pet_control.h18
4 files changed, 57 insertions, 18 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 695a6d66a5..79ceb92116 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -402,10 +402,10 @@ void CGameObject::petShowCursor() {
pet->showCursor();
}
-void CGameObject::petFn3(CTreeItem *item) {
+void CGameObject::petSetRemoteTarget() {
CPetControl *pet = getPetControl();
if (pet)
- pet->fn3(item);
+ pet->setRemoteTarget(this);
}
void CGameObject::playMovie(uint startFrame, uint endFrame, uint flags) {
@@ -1057,4 +1057,22 @@ void CGameObject::resetMail() {
mailMan->resetValue();
}
+void CGameObject::petSetRooms1D0(int val) {
+ CPetControl *petControl = getPetControl();
+ if (petControl)
+ petControl->setRooms1D0(val);
+}
+
+int CGameObject::petGetRooms1D0() const {
+ CPetControl *petControl = getPetControl();
+ return petControl ? petControl->getRooms1D0() : 0;
+}
+
+void CGameObject::petAddRandomRoom(int passClassNum) {
+ CPetControl *petControl = getPetControl();
+ if (petControl)
+ petControl->addRandomRoom(passClassNum);
+}
+
+
} // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index bb6b161a48..0a6070463f 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -141,17 +141,16 @@ protected:
*/
void petShowCursor();
- void petFn3(CTreeItem *item);
+ /**
+ * Set the remote target in the PET to this object
+ */
+ void petSetRemoteTarget();
+
void incState38();
void inc54();
void dec54();
/**
- * Adds a room to the room list
- */
- void petAddRandomRoom(int passClassNum);
-
- /**
* Locks/hides the mouse
*/
void lockMouse();
@@ -565,6 +564,15 @@ public:
* Sets up credits text
*/
void createCredits();
+
+ void petSetRooms1D0(int val);
+
+ int petGetRooms1D0() const;
+
+ /**
+ * Adds a random room to the pET
+ */
+ void petAddRandomRoom(int passClassNum);
};
} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 45b5ac3c93..802e0ada12 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -178,9 +178,14 @@ void CPetControl::enterRoom(CRoomItem *room) {
_remote.enterRoom(room);
}
-void CPetControl::clear() {
+void CPetControl::resetRemoteTarget() {
_remoteTarget = nullptr;
- _string2.clear();
+ _remoteTargetName.clear();
+}
+
+void CPetControl::resetActiveNPC() {
+ _activeNPC = nullptr;
+ _activeNPCName = "";
}
bool CPetControl::fn1(int val) {
@@ -219,12 +224,12 @@ void CPetControl::highlightGlyph(int id) {
_sections[_currentArea]->highlight(id);
}
-void CPetControl::fn3(CTreeItem *item) {
+void CPetControl::setRemoteTarget(CGameObject *item) {
_remoteTarget = item;
if (item)
- _string2 = item->getName();
+ _remoteTargetName = item->getName();
else
- _string2.clear();
+ _remoteTargetName.clear();
}
CRoomItem *CPetControl::getHiddenRoom() {
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index c9056a7b32..3881bda78f 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -63,7 +63,7 @@ private:
CPetMessage _message;
CPetFrame _frame;
CString _activeNPCName;
- CString _string2;
+ CString _remoteTargetName;
CRoomItem *_hiddenRoom;
Rect _drawBounds;
PetEventInfo _timers[2];
@@ -112,7 +112,7 @@ protected:
public:
PetArea _currentArea;
CTreeItem *_activeNPC;
- CTreeItem *_remoteTarget;
+ CGameObject *_remoteTarget;
public:
CLASSDEF
CPetControl();
@@ -158,13 +158,21 @@ public:
void enterRoom(CRoomItem *room);
/**
- * Called to clear the PET display
+ * Called to reset the remote target
*/
- void clear();
+ void resetRemoteTarget();
+
+ /**
+ * Resets the Active NPC
+ */
+ void resetActiveNPC();
bool fn1(int val);
- void fn3(CTreeItem *item);
+ /**
+ * Set the remote target
+ */
+ void setRemoteTarget(CGameObject *item);
/**
* Sets the currently viewed area within the PET