From a719b0585fed6bcbce48e924d65cca5d9ff80bf8 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 22 Apr 2016 13:16:44 -0400 Subject: TITANIC: Beginnings of slider logic --- engines/titanic/pet_control/pet_slider.cpp | 15 ++++++++++++ engines/titanic/pet_control/pet_slider.h | 39 +++++++++++++++++++++++++++--- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/engines/titanic/pet_control/pet_slider.cpp b/engines/titanic/pet_control/pet_slider.cpp index dad78d6a1e..4abf0227a1 100644 --- a/engines/titanic/pet_control/pet_slider.cpp +++ b/engines/titanic/pet_control/pet_slider.cpp @@ -21,6 +21,7 @@ */ #include "titanic/pet_control/pet_slider.h" +#include "titanic/pet_control/pet_control.h" namespace Titanic { @@ -86,4 +87,18 @@ void CPetSlider::proc18() { } +/*------------------------------------------------------------------------*/ + +void CPetSoundSlider::setupBackground(const CString &name, CPetControl *petControl) { + if (petControl) { + _background = petControl->getHiddenObject(name); + } +} + +void CPetSoundSlider::setupThumb(const CString &name, CPetControl *petControl) { + if (petControl) { + _thumb = petControl->getHiddenObject(name); + } +} + } // End of namespace Titanic diff --git a/engines/titanic/pet_control/pet_slider.h b/engines/titanic/pet_control/pet_slider.h index b3ba60fd41..a30697a023 100644 --- a/engines/titanic/pet_control/pet_slider.h +++ b/engines/titanic/pet_control/pet_slider.h @@ -25,9 +25,12 @@ #include "titanic/support/rect.h" #include "titanic/support/string.h" +#include "titanic/core/game_object.h" namespace Titanic { +class CPetControl; + class CPetSlider { private: int _field4; @@ -44,9 +47,25 @@ private: public: CPetSlider(); - virtual void proc1() {} - virtual void proc2() {} - virtual void proc3() {} + /** + * Setup the background + */ + virtual void setupBackground(const CString &name, CPetControl *petControl) {} + + /** + * Setup the thumb + */ + virtual void setupThumb(const CString &name, CPetControl *petControl) {} + + /** + * Setup the background + */ + virtual void setupBackground(const CString &name, CTreeItem *treeItem) {} + + /** + * Setup the thumb + */ + virtual void setupThumb(const CString &name, CTreeItem *treeItem) {} /** * Reset the slider @@ -81,9 +100,21 @@ public: class CPetSoundSlider : public CPetSlider { public: - + CGameObject *_background; + CGameObject *_thumb; public: + CPetSoundSlider() : CPetSlider(), _background(nullptr), + _thumb(0) {} + /** + * Setup the background + */ + virtual void setupBackground(const CString &name, CPetControl *petControl); + + /** + * Setup the thumb + */ + virtual void setupThumb(const CString &name, CPetControl *petControl); }; } // End of namespace Titanic -- cgit v1.2.3