From 282ed45c77e81f1a5d2f0663c516d455dd7a8032 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 21 Apr 2016 22:45:37 -0400 Subject: TITANIC: Beginnings of CPetSound --- engines/titanic/pet_control/pet_slider.h | 8 +++++++- engines/titanic/pet_control/pet_sound.cpp | 31 ++++++++++++++++++++++++++++++- engines/titanic/pet_control/pet_sound.h | 20 ++++++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) (limited to 'engines/titanic/pet_control') diff --git a/engines/titanic/pet_control/pet_slider.h b/engines/titanic/pet_control/pet_slider.h index acad55c4ae..b3ba60fd41 100644 --- a/engines/titanic/pet_control/pet_slider.h +++ b/engines/titanic/pet_control/pet_slider.h @@ -24,6 +24,7 @@ #define TITANIC_PET_SLIDER_H #include "titanic/support/rect.h" +#include "titanic/support/string.h" namespace Titanic { @@ -46,7 +47,12 @@ public: virtual void proc1() {} virtual void proc2() {} virtual void proc3() {} - virtual void proc4() {} + + /** + * Reset the slider + */ + virtual void reset(const CString &name) {} + virtual void proc5() {} virtual void proc6() {} diff --git a/engines/titanic/pet_control/pet_sound.cpp b/engines/titanic/pet_control/pet_sound.cpp index b236b1ab3d..6c6c2ead64 100644 --- a/engines/titanic/pet_control/pet_sound.cpp +++ b/engines/titanic/pet_control/pet_sound.cpp @@ -20,10 +20,39 @@ * */ -#include "titanic/pet_control/pet_real_life.h" +#include "titanic/pet_control/pet_sound.h" #include "titanic/pet_control/pet_control.h" namespace Titanic { +CPetSound::CPetSound() : CPetGlyph(), _field198(0), _field19C(0) { +} + +bool CPetSound::setup(CPetControl *petControl, CPetGlyphs *owner) { + CPetGlyph::setup(petControl, owner); + // TODO + + return true; +} + +bool CPetSound::reset() { + CPetControl *pet = getPetControl(); + if (pet) { + setName("PetSound", pet); + _element.reset("PetVolChannels", pet, MODE_UNSELECTED); + _slider1.reset("PetVolSlug"); + _slider2.reset("PetVolSlug"); + _slider3.reset("PetVolSlug"); + _slider4.reset("PetVolSlug"); + + CPetSection *section = getPetSection(); + uint col = section->getColor(0); + for (int idx = 0; idx < 4; ++idx) + _text[idx].setColor(0, col); + } + + return false; +} + } // End of namespace Titanic diff --git a/engines/titanic/pet_control/pet_sound.h b/engines/titanic/pet_control/pet_sound.h index fcd8e9a1d9..e52cccabf8 100644 --- a/engines/titanic/pet_control/pet_sound.h +++ b/engines/titanic/pet_control/pet_sound.h @@ -26,12 +26,32 @@ #include "titanic/pet_control/pet_glyphs.h" #include "titanic/pet_control/pet_gfx_element.h" #include "titanic/pet_control/pet_text.h" +#include "titanic/pet_control/pet_slider.h" namespace Titanic { class CPetSound : public CPetGlyph { private: + CPetGfxElement _element; + CPetSlider _slider1; + CPetSlider _slider2; + CPetSlider _slider3; + CPetSlider _slider4; + CPetText _text[4]; + int _field198; + int _field19C; public: + CPetSound(); + + /** + * Setup the glyph + */ + virtual bool setup(CPetControl *petControl, CPetGlyphs *owner); + + /** + * Reset the glyph + */ + virtual bool reset(); }; } // End of namespace Titanic -- cgit v1.2.3