aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-23 23:30:17 -0400
committerPaul Gilbert2016-07-10 16:11:57 -0400
commit4180e85bc0da500c347a3c5076ec7e6921e8daff (patch)
tree4a690e74f1d04daf5a6a811fe79f691b11ff8014 /engines/titanic
parent73258800cf10f94cee5a9745649f8c5dbb67109c (diff)
downloadscummvm-rg350-4180e85bc0da500c347a3c5076ec7e6921e8daff.tar.gz
scummvm-rg350-4180e85bc0da500c347a3c5076ec7e6921e8daff.tar.bz2
scummvm-rg350-4180e85bc0da500c347a3c5076ec7e6921e8daff.zip
TITANIC: Beginnings of PET Rooms glyph
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/pet_control/pet_glyphs.cpp8
-rw-r--r--engines/titanic/pet_control/pet_glyphs.h7
-rw-r--r--engines/titanic/pet_control/pet_rooms_glyphs.cpp51
-rw-r--r--engines/titanic/pet_control/pet_rooms_glyphs.h37
-rw-r--r--engines/titanic/pet_control/pet_sound.h5
5 files changed, 86 insertions, 22 deletions
diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 914ddbbe0b..8ed8fcf47c 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -32,7 +32,7 @@ bool CPetGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
return true;
}
-void CPetGlyph::drawAt(CScreenManager *screenManager, const Point &pt) {
+void CPetGlyph::drawAt(CScreenManager *screenManager, const Point &pt, bool isHighlighted) {
_element.translate(pt.x, pt.y);
_element.draw(screenManager);
_element.translate(-pt.x, -pt.y);
@@ -151,10 +151,8 @@ void CPetGlyphs::draw(CScreenManager *screenManager) {
Point pt = getPosition(itemIndex);
CPetGlyph *glyph = getGlyph(itemIndex);
- if (glyph) {
- // TODO: Comparison with highlighted index, and a redundant push?
- glyph->drawAt(screenManager, pt);
- }
+ if (glyph)
+ glyph->drawAt(screenManager, pt, index == _highlightIndex);
}
}
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 883c7992a3..9216a42c74 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -74,6 +74,11 @@ public:
void translateBack(const Point &pt) { _element.translate(-pt.x, -pt.y); }
/**
+ * Get the parent RealLife area
+ */
+ CPetGlyphs *getOwner() { return _owner; }
+
+ /**
* Get the PET control
*/
CPetControl *getPetControl() const;
@@ -106,7 +111,7 @@ public:
/**
* Draw the glyph at a specified position
*/
- virtual void drawAt(CScreenManager *screenManager, const Point &pt);
+ virtual void drawAt(CScreenManager *screenManager, const Point &pt, bool isHighlighted);
/**
* Handles any secondary drawing of the glyph
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
index c853273873..6c032e7daf 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
@@ -21,13 +21,15 @@
*/
#include "titanic/pet_control/pet_rooms_glyphs.h"
+#include "titanic/pet_control/pet_section.h"
+#include "titanic/support/screen_manager.h"
namespace Titanic {
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) {
+ _field34(0), _field38(0), _field3C(0),
+ _field40(nullptr), _field44(nullptr), _field48(nullptr), _field4C(nullptr),
+ _field50(nullptr), _field54(nullptr), _field58(nullptr), _field5C(nullptr) {
}
void CPetRoomsGlyph::set34(int val) {
@@ -38,4 +40,47 @@ void CPetRoomsGlyph::set38(int val) {
_field38 = val;
}
+bool CPetRoomsGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+ if (!CPetGlyph::setup(petControl, owner))
+ return false;
+
+ CPetSection *section = owner->getOwner();
+ _field40 = section->getBackground(9);
+ _field44 = section->getBackground(12);
+ _field50 = section->getBackground(13);
+ _field54 = section->getBackground(10);
+ _field48 = section->getBackground(11);
+ _field4C = section->getBackground(14);
+ _field58 = section->getBackground(15);
+ _field5C = _field58;
+ return true;
+}
+
+void CPetRoomsGlyph::drawAt(CScreenManager *screenManager, const Point &pt) {
+ // Clear background
+ Rect rect(pt.x, pt.y, pt.x + 52, pt.y + 52);
+ screenManager->fillRect(SURFACE_BACKBUFFER, &rect, 0, 0, 0);
+
+ warning("TODO: CPetRoomsGlyph::drawAt");
+}
+
+void CPetRoomsGlyph::proc28(const Point &pt) {
+
+}
+int CPetRoomsGlyph::proc29(const Point &pt) {
+ return 0;
+}
+
+void CPetRoomsGlyph::proc32() {
+
+}
+
+int CPetRoomsGlyph::proc33() {
+ return 1;
+}
+
+void CPetRoomsGlyph::proc39() {
+
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.h b/engines/titanic/pet_control/pet_rooms_glyphs.h
index ee79917b57..80c3d36ad8 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.h
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.h
@@ -32,20 +32,41 @@ protected:
int _field34;
int _field38;
int _field3C;
- int _field40;
- int _field44;
- int _field48;
- int _field4C;
- int _field50;
- int _field54;
- int _field58;
- int _field5C;
+ CGameObject *_field40;
+ CGameObject *_field44;
+ CGameObject *_field48;
+ CGameObject *_field4C;
+ CGameObject *_field50;
+ CGameObject *_field54;
+ CGameObject *_field58;
+ CGameObject *_field5C;
public:
CPetRoomsGlyph();
void set34(int val);
void set38(int val);
+
+ /**
+ * Setup the glyph
+ */
+ virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+ /**
+ * Draw the glyph at a specified position
+ */
+ virtual void drawAt(CScreenManager *screenManager, const Point &pt);
+
+ /**
+ * Handles any secondary drawing of the glyph
+ */
+ virtual void draw2(CScreenManager *screenManager) {}
+
+ virtual void proc28(const Point &pt);
+ virtual int proc29(const Point &pt);
+ virtual void proc32();
+ virtual int proc33();
+ virtual void proc39();
};
class CPetRoomsGlyphs : public CPetGlyphs {
diff --git a/engines/titanic/pet_control/pet_sound.h b/engines/titanic/pet_control/pet_sound.h
index 3727780c4b..267bd03309 100644
--- a/engines/titanic/pet_control/pet_sound.h
+++ b/engines/titanic/pet_control/pet_sound.h
@@ -98,11 +98,6 @@ public:
* Returns the tooltip text for when the glyph is selected
*/
virtual void getTooltip(CPetText *text);
-
- /**
- * Get the parent RealLife area
- */
- CPetGlyphs *getOwner() { return _owner; }
};
} // End of namespace Titanic