aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/pet_control
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-30 22:56:48 -0400
committerPaul Gilbert2016-07-10 16:37:56 -0400
commitce2a9c6f1ba75eedc917deffb79b2531a3d41645 (patch)
treea1f0d0816aeada3b571c5af1f3960345261d7498 /engines/titanic/pet_control
parent9d8208bd465a8f42ceb00418d29e9ca55a4d193f (diff)
downloadscummvm-rg350-ce2a9c6f1ba75eedc917deffb79b2531a3d41645.tar.gz
scummvm-rg350-ce2a9c6f1ba75eedc917deffb79b2531a3d41645.tar.bz2
scummvm-rg350-ce2a9c6f1ba75eedc917deffb79b2531a3d41645.zip
TITANIC: Minor fleshing out of PET Conversations and Inventory
Diffstat (limited to 'engines/titanic/pet_control')
-rw-r--r--engines/titanic/pet_control/pet_conversations.cpp2
-rw-r--r--engines/titanic/pet_control/pet_conversations.h2
-rw-r--r--engines/titanic/pet_control/pet_drag_chev.cpp4
-rw-r--r--engines/titanic/pet_control/pet_inventory.cpp18
-rw-r--r--engines/titanic/pet_control/pet_inventory.h9
5 files changed, 26 insertions, 9 deletions
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index c8d17e830d..d4298dada1 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -528,7 +528,7 @@ uint CPetConversations::getDialLevel(uint dialNum, TTNamedScript *script, int v)
if (!script)
return 0;
else
- return MAX(script->getDialLevel(dialNum), 15);
+ return MAX(script->getDialLevel(dialNum, flag), 15);
}
void CPetConversations::npcDialChange(uint dialNum, int oldLevel, int newLevel) {
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index ec3cdd64cb..9ddc610058 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -230,7 +230,7 @@ public:
virtual void proc34(const CString &name);
- virtual void proc35() {}
+ virtual void proc35();
/**
* Show the text cursor
diff --git a/engines/titanic/pet_control/pet_drag_chev.cpp b/engines/titanic/pet_control/pet_drag_chev.cpp
index 32acf72795..645804118d 100644
--- a/engines/titanic/pet_control/pet_drag_chev.cpp
+++ b/engines/titanic/pet_control/pet_drag_chev.cpp
@@ -56,8 +56,8 @@ bool CPetDragChev::MouseDragEndMsg(CMouseDragEndMsg *msg) {
CSuccUBus *succubus = static_cast<CSuccUBus *>(msg->_dropTarget);
if (succubus) {
- CSetChevRoomBits msg(_field54);
- msg.execute(succubus);
+ CSetChevRoomBits chevMsg(_field54);
+ chevMsg.execute(succubus);
} else {
CPetControl *petControl = getPetControl();
if (petControl && petControl->contains(msg->_mousePos)
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index c7c6dfdf7c..1ea78062d5 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -28,7 +28,7 @@
namespace Titanic {
CPetInventory::CPetInventory() : CPetSection(),
- _field28C(0), _field290(0), _field294(0), _field298(0) {
+ _movie(nullptr), _field290(false), _field294(0), _field298(0) {
for (int idx = 0; idx < TOTAL_ITEMS; ++idx) {
_itemBackgrounds[idx] = _itemGlyphs[idx] = nullptr;
}
@@ -53,8 +53,7 @@ void CPetInventory::draw(CScreenManager *screenManager) {
}
Rect CPetInventory::getBounds() {
- // TODO
- return Rect();
+ return _movie ? _movie->getBounds() : Rect();
}
CGameObject *CPetInventory::dragEnd(const Point &pt) const {
@@ -200,4 +199,17 @@ CGameObject *CPetInventory::getImage(int index) {
return nullptr;
}
+void CPetInventory::setMovie(CGameObject *movie, int flag) {
+ if (_movie)
+ _movie->stopMovie();
+ _movie = movie;
+
+ if (_movie) {
+ if (flag)
+ _movie->playMovie(0, 14, 1);
+ else
+ _movie->playMovie(0);
+ }
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index 969e253676..70bcc12f85 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -39,8 +39,8 @@ private:
CPetInventoryGlyphs _items;
CGameObject *_itemBackgrounds[46];
CGameObject *_itemGlyphs[46];
- int _field28C;
- int _field290;
+ CGameObject *_movie;
+ bool _field290;
int _field294;
int _field298;
private:
@@ -53,6 +53,11 @@ private:
* Get the index of an item added to the PET
*/
int getItemIndex(CGameObject *item) const;
+
+ /**
+ * Set the animated inventory item movie
+ */
+ void setMovie(CGameObject *movie, int flag);
public:
CPetInventory();