aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-23 20:59:07 -0400
committerPaul Gilbert2016-07-10 16:11:54 -0400
commit730895a9ea4a5f1c2032cb552d9221ad22fb8e5f (patch)
tree9a9b7a996e9d57214ffab07a7af9a492519de578
parent2b1e045b5c57f1bae61bd3ffbd05577062f6f34c (diff)
downloadscummvm-rg350-730895a9ea4a5f1c2032cb552d9221ad22fb8e5f.tar.gz
scummvm-rg350-730895a9ea4a5f1c2032cb552d9221ad22fb8e5f.tar.bz2
scummvm-rg350-730895a9ea4a5f1c2032cb552d9221ad22fb8e5f.zip
TITANIC: Cleaning up CPetLoad & CPetSave methods
-rw-r--r--engines/titanic/pet_control/pet_glyphs.cpp6
-rw-r--r--engines/titanic/pet_control/pet_glyphs.h4
-rw-r--r--engines/titanic/pet_control/pet_load.h1
-rw-r--r--engines/titanic/pet_control/pet_save.h13
4 files changed, 17 insertions, 7 deletions
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
@@ -50,6 +50,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
*/
virtual void highlightSave(int index);