From 730895a9ea4a5f1c2032cb552d9221ad22fb8e5f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 23 Apr 2016 20:59:07 -0400 Subject: TITANIC: Cleaning up CPetLoad & CPetSave methods --- engines/titanic/pet_control/pet_glyphs.cpp | 6 ++---- engines/titanic/pet_control/pet_glyphs.h | 4 ++-- engines/titanic/pet_control/pet_load.h | 1 - engines/titanic/pet_control/pet_save.h | 13 +++++++++++++ 4 files changed, 17 insertions(+), 7 deletions(-) (limited to 'engines/titanic') diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp index fd4828ab40..914ddbbe0b 100644 --- a/engines/titanic/pet_control/pet_glyphs.cpp +++ b/engines/titanic/pet_control/pet_glyphs.cpp @@ -412,11 +412,9 @@ bool CPetGlyphs::enterHighlighted() { return false; } -bool CPetGlyphs::leaveHighlighted() { +void CPetGlyphs::leaveHighlighted() { if (_highlightIndex >= 0) - return getGlyph(_highlightIndex)->leaveHighlighted(); - else - return false; + getGlyph(_highlightIndex)->leaveHighlighted(); } void CPetGlyphs::startDragging(CPetGlyph *glyph, CMouseDragStartMsg *msg) { diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h index e4f4b1f59a..883c7992a3 100644 --- a/engines/titanic/pet_control/pet_glyphs.h +++ b/engines/titanic/pet_control/pet_glyphs.h @@ -194,7 +194,7 @@ public: /** * Called on a highlighted item when PET area is left */ - virtual bool leaveHighlighted() { return false; } + virtual void leaveHighlighted() {} virtual int proc37() { return 0; } @@ -368,7 +368,7 @@ public: * When the PET section is left, passes onto the highlighted * glyph, if any */ - bool leaveHighlighted(); + void leaveHighlighted(); /** * Called when a dragging operation starts diff --git a/engines/titanic/pet_control/pet_load.h b/engines/titanic/pet_control/pet_load.h index 093fca0977..f87cd8afb2 100644 --- a/engines/titanic/pet_control/pet_load.h +++ b/engines/titanic/pet_control/pet_load.h @@ -58,7 +58,6 @@ public: * Executes the loading or saving */ virtual void execute(); - }; } // End of namespace Titanic diff --git a/engines/titanic/pet_control/pet_save.h b/engines/titanic/pet_control/pet_save.h index 006b2cd95a..106d499d96 100644 --- a/engines/titanic/pet_control/pet_save.h +++ b/engines/titanic/pet_control/pet_save.h @@ -49,6 +49,19 @@ public: */ virtual void getTooltip(CPetText *text); + /** + * Called on a highlighted item when PET area is entered + */ + virtual bool enterHighlighted() { + highlightSave(_savegameSlotNum); + return true; + } + + /** + * Called on a highlighted item when PET area is left + */ + virtual void leaveHighlighted() { unhighlightSave(_savegameSlotNum); } + /** * Highlights a save slot */ -- cgit v1.2.3