[Scummvm-git-logs] scummvm master -> 0a61066bd16334046dd1de73eacc6b2653407c71

Strangerke noreply at scummvm.org
Wed May 29 21:00:05 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0a61066bd1 BAGEL: Add some more const and override keywords


Commit: 0a61066bd16334046dd1de73eacc6b2653407c71
    https://github.com/scummvm/scummvm/commit/0a61066bd16334046dd1de73eacc6b2653407c71
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-05-29T21:57:09+01:00

Commit Message:
BAGEL: Add some more const and override keywords

Changed paths:
    engines/bagel/bagel.cpp
    engines/bagel/bagel.h
    engines/bagel/baglib/area_object.h
    engines/bagel/baglib/bagel.h
    engines/bagel/baglib/base_pda.cpp
    engines/bagel/baglib/base_pda.h


diff --git a/engines/bagel/bagel.cpp b/engines/bagel/bagel.cpp
index 9a26e2a901c..dc362a483c6 100644
--- a/engines/bagel/bagel.cpp
+++ b/engines/bagel/bagel.cpp
@@ -212,7 +212,7 @@ void BagelEngine::pauseEngineIntern(bool pause) {
 	}
 }
 
-void BagelEngine::errorDialog(const char *msg) {
+void BagelEngine::errorDialog(const char *msg) const {
 	GUIErrorMessage(msg);
 }
 
diff --git a/engines/bagel/bagel.h b/engines/bagel/bagel.h
index 7da90aaf3ab..2bb6b807ed5 100644
--- a/engines/bagel/bagel.h
+++ b/engines/bagel/bagel.h
@@ -124,7 +124,7 @@ public:
 	 */
 	void pauseEngineIntern(bool pause) override;
 
-	void errorDialog(const char *msg);
+	void errorDialog(const char *msg) const;
 
 	void enableKeymapper(bool enabled);
 };
diff --git a/engines/bagel/baglib/area_object.h b/engines/bagel/baglib/area_object.h
index 7f48d821043..1c90bd24164 100644
--- a/engines/bagel/baglib/area_object.h
+++ b/engines/bagel/baglib/area_object.h
@@ -39,11 +39,11 @@ public:
 	CBagAreaObject();
 	~CBagAreaObject();
 
-	ErrorCode attach();
-	ErrorCode detach();
+	ErrorCode attach() override;
+	ErrorCode detach() override;
 
-	CBofRect getRect();
-	void setSize(const CBofSize &xSize);
+	CBofRect getRect() override;
+	void setSize(const CBofSize &xSize) override;
 };
 
 } // namespace Bagel
diff --git a/engines/bagel/baglib/bagel.h b/engines/bagel/baglib/bagel.h
index 3dd77d4fb79..510acb0133f 100644
--- a/engines/bagel/baglib/bagel.h
+++ b/engines/bagel/baglib/bagel.h
@@ -154,7 +154,7 @@ public:
 		Common::strcpy_s(_szAppName, newAppName);
 	}
 
-	CBagMasterWin *getMasterWnd() {
+	CBagMasterWin *getMasterWnd() const {
 		return (CBagMasterWin *)_pMainWnd;
 	}
 
diff --git a/engines/bagel/baglib/base_pda.cpp b/engines/bagel/baglib/base_pda.cpp
index e7611cfc1d5..9afc2633bfa 100644
--- a/engines/bagel/baglib/base_pda.cpp
+++ b/engines/bagel/baglib/base_pda.cpp
@@ -156,13 +156,13 @@ bool SBBasePda::showMovie() {
 	return false;
 }
 
-void SBBasePda::stopMovie(bool bResetPDA) {
+void SBBasePda::stopMovie(bool bResetPDA) const {
 	if (_mooWnd && _mooWnd == _curDisplay) {
 		((CBagMoo *)_mooWnd)->stopMovie(bResetPDA);
 	}
 }
 
-bool SBBasePda::setMovie(CBofString &movieName) {
+bool SBBasePda::setMovie(CBofString &movieName) const {
 	if (_mooWnd) {
 		((CBagMoo *)_mooWnd)->setPDAMovie(movieName);
 		return true;
@@ -472,14 +472,14 @@ void SBBasePda::getPdaState() {
 	}
 }
 
-#define NULLCURSOR 0
-#define HANDCURSOR 1
+#define NULL_CURSOR 0
+#define HAND_CURSOR 1
 
-int SBBasePda::getProperCursor(const CBofPoint &pos, CBofRect &pdaRect) {
+int SBBasePda::getProperCursor(const CBofPoint &pos, CBofRect &pdaRect) const {
 	int wieldCursor = CBagWield::getWieldCursor();
 
 	// Assume can't click
-	int cursorID = NULLCURSOR;
+	int cursorID = NULL_CURSOR;
 
 	// If we're in the map, return the nullptr cursor, if on the pda but not in the
 	// map window, return the hand.  Same rules for nomode.
@@ -493,9 +493,9 @@ int SBBasePda::getProperCursor(const CBofPoint &pos, CBofRect &pdaRect) {
 				if (wieldCursor >= 0) {
 					return wieldCursor;
 				}
-				return NULLCURSOR;
+				return NULL_CURSOR;
 			}
-			return HANDCURSOR;
+			return HAND_CURSOR;
 		}
 		break;
 
@@ -548,17 +548,17 @@ int SBBasePda::getProperCursor(const CBofPoint &pos, CBofRect &pdaRect) {
 					}
 				}
 
-				return NULLCURSOR;
+				return NULL_CURSOR;
 			}
 
-			return HANDCURSOR;
+			return HAND_CURSOR;
 		}
 	}
 
 	return cursorID;
 }
 
-CBofRect SBBasePda::getViewRect() {
+CBofRect SBBasePda::getViewRect() const {
 	return (_curDisplay == nullptr ? CBofRect() : _curDisplay->getRect());
 }
 
diff --git a/engines/bagel/baglib/base_pda.h b/engines/bagel/baglib/base_pda.h
index dba85362d67..39f69dde8c8 100644
--- a/engines/bagel/baglib/base_pda.h
+++ b/engines/bagel/baglib/base_pda.h
@@ -128,12 +128,12 @@ public:
 	 * @param movieName   Movie filename
 	 * @return            Success/failure
 	 */
-	bool setMovie(CBofString &movieName);
+	bool setMovie(CBofString &movieName) const;
 
 	/**
 	 * Stops any playing movie
 	 */
-	void stopMovie(bool bResetPDA);
+	void stopMovie(bool bResetPDA) const;
 
 	void setDeactivate(bool b) {
 		_deactivateFl = b;
@@ -188,12 +188,12 @@ public:
 		return _zoomedFl;
 	}
 
-	int getProperCursor(const CBofPoint &pos, CBofRect &pdaRect);
+	int getProperCursor(const CBofPoint &pos, CBofRect &pdaRect) const;
 
 	/**
 	 * Returns the background rect
 	 */
-	CBofRect getViewRect();
+	CBofRect getViewRect() const;
 };
 
 } // namespace Bagel




More information about the Scummvm-git-logs mailing list