aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/titanic/module.mk3
-rw-r--r--engines/titanic/pet_control/pet_control.h2
-rw-r--r--engines/titanic/pet_control/pet_control_sub11.cpp27
-rw-r--r--engines/titanic/pet_control/pet_control_sub11.h36
-rw-r--r--engines/titanic/pet_control/pet_rooms.cpp114
-rw-r--r--engines/titanic/pet_control/pet_rooms.h100
-rw-r--r--engines/titanic/pet_control/pet_rooms_glyphs.cpp (renamed from engines/titanic/pet_control/pet_control_list_item2.cpp)10
-rw-r--r--engines/titanic/pet_control/pet_rooms_glyphs.h (renamed from engines/titanic/pet_control/pet_control_list_item2.h)17
8 files changed, 202 insertions, 107 deletions
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 3a47bedc67..6875e9032d 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -356,7 +356,6 @@ MODULE_OBJS := \
npcs/titania.o \
npcs/true_talk_npc.o \
pet_control/pet_control.o \
- pet_control/pet_control_list_item2.o \
pet_control/pet_conversations.o \
pet_control/pet_element.o \
pet_control/pet_frame.o \
@@ -364,12 +363,12 @@ MODULE_OBJS := \
pet_control/pet_inventory.o \
pet_control/pet_inventory_glyphs.o \
pet_control/pet_rooms.o \
+ pet_control/pet_rooms_glyphs.o \
pet_control/pet_remote.o \
pet_control/pet_real_life.o \
pet_control/pet_section.o \
pet_control/pet_control_sub5.o \
pet_control/pet_control_sub7.o \
- pet_control/pet_control_sub11.o \
pet_control/pet_drag_chev.o \
pet_control/pet_graphic2.o \
pet_control/pet_graphic.o \
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index e4f0710b76..baad471b8d 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -49,7 +49,7 @@ private:
CPetConversations _conversations;
CPetInventory _inventory;
CPetRemote _remote;
- CPetRoomsSection _rooms;
+ CPetRooms _rooms;
CPetRealLife _realLife;
CPetControlSub5 _sub5;
CPetControlSub7 _sub7;
diff --git a/engines/titanic/pet_control/pet_control_sub11.cpp b/engines/titanic/pet_control/pet_control_sub11.cpp
deleted file mode 100644
index 5148d1267a..0000000000
--- a/engines/titanic/pet_control/pet_control_sub11.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/pet_control/pet_control_sub11.h"
-
-namespace Titanic {
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub11.h b/engines/titanic/pet_control/pet_control_sub11.h
deleted file mode 100644
index eeeb8bf2c8..0000000000
--- a/engines/titanic/pet_control/pet_control_sub11.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB11_H
-#define TITANIC_PET_CONTROL_SUB11_H
-
-#include "titanic/pet_control/pet_glyphs.h"
-
-namespace Titanic {
-
-class CPetControlSub11 : public CPetGlyphs {
-public:
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB11_H */
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index ea81dd8270..9a55af2ba9 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -21,21 +21,66 @@
*/
#include "titanic/pet_control/pet_rooms.h"
+#include "titanic/pet_control/pet_control.h"
namespace Titanic {
-CPetRoomsSection::CPetRoomsSection() :
- _field100(0), _field104(0), _field108(0), _field10C(0),
- _field110(0), _field114(0), _field118(0), _field11C(0),
- _field1C0(0), _field1C4(0), _field1C8(0), _field1CC(0),
- _field1D0(0), _field1D4(0) {
+CPetRooms::CPetRooms() :
+ _chevLeftOnDim(nullptr), _chevLeftOffDim(nullptr),
+ _chevRightOnDim(nullptr), _chevRightOffDim(nullptr),
+ _chevLeftOnLit(nullptr), _chevLeftOffLit(nullptr),
+ _chevRightOnLit(nullptr), _chevRightOffLit(nullptr),
+ _field1C0(0), _field1C4(0), _field1C8(0), _field1CC(0),
+ _field1D0(0), _field1D4(0) {
}
-void CPetRoomsSection::save(SimpleFile *file, int indent) const {
+bool CPetRooms::setup(CPetControl *petControl) {
+ if (petControl && setupControl(petControl))
+ return reset();
+ return false;
+}
+
+bool CPetRooms::reset() {
+ return true;
+}
+
+void CPetRooms::draw(CScreenManager *screenManager) {
+
+}
+
+bool CPetRooms::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+ return true;
+}
+
+bool CPetRooms::MouseDragStartMsg(CMouseDragStartMsg *msg) {
+ return true;
+}
+
+bool CPetRooms::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
+ return true;
+}
+
+bool CPetRooms::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) {
+ return true;
+}
+
+bool CPetRooms::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
+ return true;
+}
+
+int CPetRooms::proc14() {
+ return 0;
+}
+void CPetRooms::displayMessage(const CString &msg) {
+
+}
+
+bool CPetRooms::isValid(CPetControl *petControl) {
+ return true;
}
-void CPetRoomsSection::load(SimpleFile *file, int param) {
+void CPetRooms::load(SimpleFile *file, int param) {
if (!param) {
int count = file->readNumber();
@@ -45,7 +90,7 @@ void CPetRoomsSection::load(SimpleFile *file, int param) {
warning("TODO: CPetRoomsSection::load - %d,%d", v1, v2);
}
- _listItem.setField34(file->readNumber());
+ _glyphItem.set34(file->readNumber());
file->readNumber();
_field1C0 = file->readNumber();
_field1C4 = file->readNumber();
@@ -56,10 +101,57 @@ void CPetRoomsSection::load(SimpleFile *file, int param) {
}
}
-bool CPetRoomsSection::isValid(CPetControl *petControl) {
- // TODO
- return true;
+void CPetRooms::postLoad() {
+
+}
+
+void CPetRooms::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetRooms::enter(PetArea oldArea) {
+
}
+void CPetRooms::enterRoom(CRoomItem *room) {
+
+}
+
+CPetText *CPetRooms::getText() {
+ return &_text;
+}
+
+CGameObject *CPetRooms::getBackground(int index) {
+ return nullptr;
+}
+
+bool CPetRooms::setupControl(CPetControl *petControl) {
+ _petControl = petControl;
+ if (!petControl)
+ return false;
+
+ Rect rect1(0, 0, 470, 15);
+ rect1.moveTo(32, 445);
+ _text.setBounds(rect1);
+ _text.setHasBorder(false);
+
+ Rect rect2(0, 0, 81, 81);
+ rect2.moveTo(374, 494);
+ _element.setBounds(rect2);
+
+ _chevLeftOnDim = petControl->getHiddenObject("3PetChevLeftOnDim");
+ _chevLeftOffDim = petControl->getHiddenObject("3PetChevLeftOffDim");
+ _chevRightOnDim = petControl->getHiddenObject("3PetChevRightOnDim");
+ _chevRightOffDim = petControl->getHiddenObject("3PetChevRightOffDim");
+ _chevLeftOnLit = petControl->getHiddenObject("3PetChevLeftOnLit");
+ _chevLeftOffLit = petControl->getHiddenObject("3PetChevLeftOffLit");
+ _chevRightOnLit = petControl->getHiddenObject("3PetChevRightOnLit");
+ _chevRightOffLit = petControl->getHiddenObject("3PetChevRightOffLit");
+
+ _glyphs.setup(6, this);
+ _glyphs.setFlags(GFLAG_16);
+ _glyphItem.setup(petControl, &_glyphs);
+ _glyphItem.set38(1);
+}
} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms.h b/engines/titanic/pet_control/pet_rooms.h
index 1e68873f93..0974fee026 100644
--- a/engines/titanic/pet_control/pet_rooms.h
+++ b/engines/titanic/pet_control/pet_rooms.h
@@ -20,29 +20,28 @@
*
*/
-#ifndef TITANIC_PET_ROOMS_SECTION_H
-#define TITANIC_PET_ROOMS_SECTION_H
+#ifndef TITANIC_PET_ROOMS_H
+#define TITANIC_PET_ROOMS_H
#include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_control_sub11.h"
#include "titanic/pet_control/pet_text.h"
-#include "titanic/pet_control/pet_control_list_item2.h"
+#include "titanic/pet_control/pet_rooms_glyphs.h"
namespace Titanic {
-class CPetRoomsSection : public CPetSection {
+class CPetRooms : public CPetSection {
private:
- CPetControlSub11 _sub11;
- CPetControlListItem2 _listItem;
- int _field100;
- int _field104;
- int _field108;
- int _field10C;
- int _field110;
- int _field114;
- int _field118;
- int _field11C;
- CPetGfxElement _val1;
+ CPetRoomsGlyphs _glyphs;
+ CPetRoomsGlyph _glyphItem;
+ CGameObject *_chevLeftOnDim;
+ CGameObject *_chevLeftOffDim;
+ CGameObject *_chevRightOnDim;
+ CGameObject *_chevRightOffDim;
+ CGameObject *_chevLeftOnLit;
+ CGameObject *_chevLeftOffLit;
+ CGameObject *_chevRightOnLit;
+ CGameObject *_chevRightOffLit;
+ CPetGfxElement _element;
CPetText _text;
int _field1C0;
int _field1C4;
@@ -50,23 +49,82 @@ private:
int _field1CC;
int _field1D0;
int _field1D4;
+private:
+ /**
+ * Setup the control
+ */
+ bool setupControl(CPetControl *petControl);
public:
- CPetRoomsSection();
+ CPetRooms();
/**
- * Save the data for the class to file
+ * Sets up the section
*/
- virtual void save(SimpleFile *file, int indent) const;
+ virtual bool setup(CPetControl *petControl);
+
+ /**
+ * Reset the section
+ */
+ virtual bool reset();
/**
- * Load the data for the class from file
+ * Draw the section
*/
- virtual void load(SimpleFile *file, int param);
+ virtual void draw(CScreenManager *screenManager);
+
+ /**
+ * Following are handlers for the various messages that the PET can
+ * pass onto the currently active section/area
+ */
+ virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+ virtual bool MouseDragStartMsg(CMouseDragStartMsg *msg);
+ virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
+ virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
+ virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg);
+
+ virtual int proc14();
+
+ /**
+ * Display a message
+ */
+ virtual void displayMessage(const CString &msg);
/**
* Returns true if the object is in a valid state
*/
virtual bool isValid(CPetControl *petControl);
+
+ /**
+ * Load the data for the class from file
+ */
+ virtual void load(SimpleFile *file, int param);
+
+ /**
+ * Called after a game has been loaded
+ */
+ virtual void postLoad();
+
+ /**
+ * Save the data for the class to file
+ */
+ virtual void save(SimpleFile *file, int indent) const;
+
+ /**
+ * Called when a section is switched to
+ */
+ virtual void enter(PetArea oldArea);
+
+ /**
+ * Called when a new room is entered
+ */
+ virtual void enterRoom(CRoomItem *room);
+
+ /**
+ * Get a reference to the tooltip text associated with the section
+ */
+ virtual CPetText *getText();
+
+ virtual CGameObject *getBackground(int index);
};
} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_list_item2.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
index 82b59929d2..c853273873 100644
--- a/engines/titanic/pet_control/pet_control_list_item2.cpp
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
@@ -20,18 +20,22 @@
*
*/
-#include "titanic/pet_control/pet_control_list_item2.h"
+#include "titanic/pet_control/pet_rooms_glyphs.h"
namespace Titanic {
-CPetControlListItem2::CPetControlListItem2() :
+CPetRoomsGlyph::CPetRoomsGlyph() : CPetGlyph(),
_field34(0), _field38(0), _field3C(0), _field40(0),
_field44(0), _field48(0), _field4C(0), _field50(0),
_field54(0), _field58(0), _field5C(0) {
}
-void CPetControlListItem2::setField34(int val) {
+void CPetRoomsGlyph::set34(int val) {
_field34 = val;
}
+void CPetRoomsGlyph::set38(int val) {
+ _field38 = val;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_list_item2.h b/engines/titanic/pet_control/pet_rooms_glyphs.h
index 70feb30432..ee79917b57 100644
--- a/engines/titanic/pet_control/pet_control_list_item2.h
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.h
@@ -20,14 +20,14 @@
*
*/
-#ifndef TITANIC_PET_CONTROL_LIST_ITEM2_H
-#define TITANIC_PET_CONTROL_LIST_ITEM2_H
+#ifndef TITANIC_PET_ROOMS_GLYPHS_H
+#define TITANIC_PET_ROOMS_GLYPHS_H
#include "titanic/pet_control/pet_glyphs.h"
namespace Titanic {
-class CPetControlListItem2 : public CPetGlyph {
+class CPetRoomsGlyph : public CPetGlyph {
protected:
int _field34;
int _field38;
@@ -41,11 +41,16 @@ protected:
int _field58;
int _field5C;
public:
- CPetControlListItem2();
+ CPetRoomsGlyph();
- void setField34(int val);
+ void set34(int val);
+
+ void set38(int val);
+};
+
+class CPetRoomsGlyphs : public CPetGlyphs {
};
} // End of namespace Titanic
-#endif /* TITANIC_PET_CONTROL_LIST_ITEM2_H */
+#endif /* TITANIC_PET_ROOMS_GLYPHS_H */