diff options
author | Paul Gilbert | 2016-04-17 21:54:29 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-10 16:11:22 -0400 |
commit | 11cde7b4138906c050efef73ce011777d6298cfb (patch) | |
tree | d3fe307240d5b51dba3e39f82f45ca0852e7743e | |
parent | 46a30255b0e5a7f5dad4fd032388d31a69208b62 (diff) | |
download | scummvm-rg350-11cde7b4138906c050efef73ce011777d6298cfb.tar.gz scummvm-rg350-11cde7b4138906c050efef73ce011777d6298cfb.tar.bz2 scummvm-rg350-11cde7b4138906c050efef73ce011777d6298cfb.zip |
TITANIC: Implement CPetGlyphs setup
-rw-r--r-- | engines/titanic/pet_control/pet_glyphs.cpp | 13 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_glyphs.h | 2 |
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; |