aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/titanic/pet_control/pet_glyphs.cpp13
-rw-r--r--engines/titanic/pet_control/pet_glyphs.h2
2 files changed, 12 insertions, 3 deletions
diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index a9a15c5ac2..196424121f 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -50,7 +50,7 @@ bool CPetGlyph::translateContains(const Point &delta, const Point &pt) {
/*------------------------------------------------------------------------*/
CPetGlyphs::CPetGlyphs() : _firstVisibleIndex(0), _numVisibleGlyphs(7),
- _highlightIndex(-1), _field1C(-1), _field20(0), _field24(0) {
+ _highlightIndex(-1), _field1C(-1), _field20(0), _owner(nullptr) {
}
void CPetGlyphs::setNumVisible(int total) {
@@ -65,7 +65,16 @@ void CPetGlyphs::clear() {
}
void CPetGlyphs::setup(int numVisible, CPetSection *owner) {
- error("TODO");
+ setNumVisible(numVisible);
+ _owner = owner;
+ _selection.setBounds(Rect(0, 0, 76, 76));
+
+ int buttonsLeft = numVisible * 7 * 5 + 21;
+
+ _scrollLeft.setBounds(Rect(0, 0, 31, 15));
+ _scrollLeft.translate(buttonsLeft, 373);
+ _scrollRight.setBounds(Rect(0, 0, 31, 15));
+ _scrollRight.translate(buttonsLeft, 413);
}
void CPetGlyphs::reset() {
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index fceca4d27e..88b6e40956 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -153,7 +153,7 @@ protected:
int _highlightIndex;
int _field1C;
int _field20;
- int _field24;
+ CPetSection *_owner;
CPetGfxElement _selection;
CPetGfxElement _scrollLeft;
CPetGfxElement _scrollRight;