diff options
-rw-r--r-- | engines/titanic/core/game_object.cpp | 16 | ||||
-rw-r--r-- | engines/titanic/core/game_object.h | 16 | ||||
-rw-r--r-- | engines/titanic/game/television.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_control.cpp | 12 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_control.h | 17 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_remote.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_remote.h | 5 | ||||
-rw-r--r-- | engines/titanic/pet_control/pet_section.h | 5 |
8 files changed, 65 insertions, 12 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp index 466fb443da..aa0de49174 100644 --- a/engines/titanic/core/game_object.cpp +++ b/engines/titanic/core/game_object.cpp @@ -384,10 +384,22 @@ void CGameObject::setVisible(bool val) { } } -void CGameObject::petFn2(int val) { +void CGameObject::petHighlightGlyph(int val) { CPetControl *pet = getPetControl(); if (pet) - pet->fn2(val); + pet->highlightGlyph(val); +} + +void CGameObject::petHideCursor() { + CPetControl *pet = getPetControl(); + if (pet) + pet->hideCursor(); +} + +void CGameObject::petShowCursor() { + CPetControl *pet = getPetControl(); + if (pet) + pet->showCursor(); } void CGameObject::petFn3(CTreeItem *item) { diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h index ad0d93948e..20729d586a 100644 --- a/engines/titanic/core/game_object.h +++ b/engines/titanic/core/game_object.h @@ -126,7 +126,21 @@ protected: */ CViewItem * parseView(const CString &viewString); - void petFn2(int val); + /** + * Highlights a glyph in the currently active PET section + */ + void petHighlightGlyph(int id); + + /** + * Hides the text cursor in the current section, if applicable + */ + void petHideCursor(); + + /** + * Shows the text cursor in the current section, if applicable + */ + void petShowCursor(); + void petFn3(CTreeItem *item); void incState38(); void inc54(); diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp index 280f7f25d6..5127712cad 100644 --- a/engines/titanic/game/television.cpp +++ b/engines/titanic/game/television.cpp @@ -140,7 +140,7 @@ bool CTelevision::ChangeSeasonMsg(CChangeSeasonMsg *msg) { bool CTelevision::EnterViewMsg(CEnterViewMsg *msg) { setPetArea(PET_REMOTE); - petFn2(2); + petHighlightGlyph(GLYPH_TELEVISION_CONTROL); petFn3(0); setVisible(0); _fieldE0 = 1; diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp index 37af6f7d0a..bc2ab036b2 100644 --- a/engines/titanic/pet_control/pet_control.cpp +++ b/engines/titanic/pet_control/pet_control.cpp @@ -211,8 +211,16 @@ PetArea CPetControl::setArea(PetArea newArea) { return newArea; } -void CPetControl::fn2(int val) { - _sections[_currentArea]->proc38(val); +void CPetControl::hideCursor() { + _sections[_currentArea]->hideCursor(); +} + +void CPetControl::showCursor() { + _sections[_currentArea]->showCursor(); +} + +void CPetControl::highlightGlyph(int id) { + _sections[_currentArea]->highlight(id); } void CPetControl::fn3(CTreeItem *item) { diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h index 71785cedb6..3dee76fea6 100644 --- a/engines/titanic/pet_control/pet_control.h +++ b/engines/titanic/pet_control/pet_control.h @@ -163,8 +163,6 @@ public: bool fn1(int val); - void fn2(int val); - void fn3(CTreeItem *item); void fn4(); @@ -175,6 +173,21 @@ public: PetArea setArea(PetArea newSection); /** + * Hides the text cursor in the current section, if applicable + */ + void hideCursor(); + + /** + * Shows the text cursor in the current section, if applicable + */ + void showCursor(); + + /** + * Highlights a glyph item in the currently active section, if applicable + */ + void highlightGlyph(int id); + + /** * Returns true if the PET is currently unlocked */ bool isUnlocked() const { return _locked == 0; } diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp index aac0dc8146..6f133259a8 100644 --- a/engines/titanic/pet_control/pet_remote.cpp +++ b/engines/titanic/pet_control/pet_remote.cpp @@ -214,8 +214,8 @@ CPetGfxElement *CPetRemote::getElement(uint id) { } } -void CPetRemote::proc38(int val) { - int highlightIndex = getHighlightIndex((RemoteGlyph)val); +void CPetRemote::highlight(int id) { + int highlightIndex = getHighlightIndex((RemoteGlyph)id); if (highlightIndex != -1) _items.highlight(highlightIndex); } diff --git a/engines/titanic/pet_control/pet_remote.h b/engines/titanic/pet_control/pet_remote.h index 8703abd099..58c429f5bf 100644 --- a/engines/titanic/pet_control/pet_remote.h +++ b/engines/titanic/pet_control/pet_remote.h @@ -143,7 +143,10 @@ public: */ virtual CPetGfxElement *getElement(uint id); - virtual void proc38(int val); + /** + * Highlights a glyph item in the section + */ + virtual void highlight(int id); /** * Generates a PET message diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h index 52890fc79a..15c4033e8b 100644 --- a/engines/titanic/pet_control/pet_section.h +++ b/engines/titanic/pet_control/pet_section.h @@ -182,7 +182,10 @@ public: */ virtual void hideCursor() {} - virtual void proc38(int val) {} + /** + * Highlights a glyph item in the section, if applicable + */ + virtual void highlight(int id) {} /** * Get the PET control |