[Scummvm-git-logs] scummvm master -> 74eaaa5a888d5c40472c1efb9a6603fba83e8df1
Strangerke
noreply at scummvm.org
Sun May 26 05:22:03 UTC 2024
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
d40c9badf9 BAGEL: Fix various tiny issues (missing or useless keywords, typos, variable scopes, ...)
3bbe28bcd8 BAGEL: Remove unused methods in CBofWindow
79457670a1 BAGEL: Remove unreachable code in CBofMovie
74eaaa5a88 BAGEL: Remove extra const in function declarations, add missing const
Commit: d40c9badf9a08749fd84c3c52bb50326ebc1f1d9
https://github.com/scummvm/scummvm/commit/d40c9badf9a08749fd84c3c52bb50326ebc1f1d9
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-05-26T06:21:48+01:00
Commit Message:
BAGEL: Fix various tiny issues (missing or useless keywords, typos, variable scopes, ...)
Changed paths:
engines/bagel/baglib/cursor.h
engines/bagel/baglib/fmovie.cpp
engines/bagel/baglib/link_object.h
engines/bagel/baglib/moo.h
engines/bagel/baglib/object.h
engines/bagel/baglib/sprite_object.h
engines/bagel/baglib/storage_dev_win.cpp
engines/bagel/baglib/storage_dev_win.h
engines/bagel/boflib/gfx/bitmap.cpp
engines/bagel/boflib/gui/dialog.h
engines/bagel/boflib/gui/text_box.cpp
engines/bagel/boflib/gui/window.cpp
engines/bagel/boflib/gui/window.h
engines/bagel/boflib/timer.cpp
engines/bagel/dialogs/opt_window.cpp
engines/bagel/dialogs/save_dialog.h
diff --git a/engines/bagel/baglib/cursor.h b/engines/bagel/baglib/cursor.h
index c33349f3c05..f478d557876 100644
--- a/engines/bagel/baglib/cursor.h
+++ b/engines/bagel/baglib/cursor.h
@@ -61,7 +61,7 @@ public:
_x = x;
_y = y;
}
- void setHotspot(CBofPoint point) {
+ void setHotspot(const CBofPoint point) {
setHotspot(point.x, point.y);
}
CBofPoint getHotspot() const {
diff --git a/engines/bagel/baglib/fmovie.cpp b/engines/bagel/baglib/fmovie.cpp
index 52e671e6f43..fdfef1f4462 100644
--- a/engines/bagel/baglib/fmovie.cpp
+++ b/engines/bagel/baglib/fmovie.cpp
@@ -107,7 +107,6 @@ bool CBagFMovie::openMovie(const char *sFilename) {
// Opened failed ?
if (!_smk->loadFile(sFilename)) {
error("Movie not found=%s", sFilename);
- return false;
}
diff --git a/engines/bagel/baglib/link_object.h b/engines/bagel/baglib/link_object.h
index b4867e2cdfa..c2d96f3ff31 100644
--- a/engines/bagel/baglib/link_object.h
+++ b/engines/bagel/baglib/link_object.h
@@ -65,10 +65,10 @@ public:
void setSize(const CBofSize &size) override {
_size = size;
}
- void setDstLoc(CBofPoint loc) {
+ void setDstLoc(const CBofPoint loc) {
_destLocation = loc;
}
- void setSrcLoc(CBofPoint loc) {
+ void setSrcLoc(const CBofPoint loc) {
_srcLocation = loc;
}
};
diff --git a/engines/bagel/baglib/moo.h b/engines/bagel/baglib/moo.h
index 96f6e2bfbef..0b3862fe161 100644
--- a/engines/bagel/baglib/moo.h
+++ b/engines/bagel/baglib/moo.h
@@ -30,7 +30,6 @@
namespace Bagel {
class CBagMoo : public CBagStorageDevBmp {
-protected:
private:
static CBagCharacterObject *_pMovie;
static PdaMode _eSavePDAMode;
@@ -41,11 +40,11 @@ public:
virtual ~CBagMoo();
static void initialize();
- virtual ErrorCode update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcRect = nullptr, int nMaskColor = -1);
+ ErrorCode update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcRect = nullptr, int nMaskColor = -1) override;
// Grab the button event of the bagbmobj and send them to the cbagsdev
- void onLButtonUp(uint32 /*nFlags*/, CBofPoint * /*xPoint*/, void * /*info*/) {}
- virtual void onLButtonDown(uint32 /*nFlags*/, CPoint * /*xPoint*/, void * = nullptr) {}
+ void onLButtonUp(uint32 /*nFlags*/, CBofPoint * /*xPoint*/, void * /*info*/) override {}
+ void onLButtonDown(uint32 /*nFlags*/, CPoint * /*xPoint*/, void * = nullptr) override {}
// For public access to our movie object
diff --git a/engines/bagel/baglib/object.h b/engines/bagel/baglib/object.h
index 2f41bf0998c..c7f6271a182 100644
--- a/engines/bagel/baglib/object.h
+++ b/engines/bagel/baglib/object.h
@@ -150,8 +150,8 @@ public:
}
// Return true if the Object had members that are properly initialized/de-initialized
- virtual ErrorCode attach() override;
- virtual ErrorCode detach() override;
+ ErrorCode attach() override;
+ ErrorCode detach() override;
BagObjectType getType() {
return (BagObjectType)_xObjType;
@@ -160,26 +160,26 @@ public:
_xObjType = (uint16)nType;
}
- // Object can be moved within a sceene
+ // Object can be moved within a screen
virtual bool isInside(const CBofPoint &xPoint) {
return getRect().ptInRect(xPoint);
}
- // Object can be moved within a sceene
+ // Object can be moved within a screen
bool isMovable() {
return isProperty(MOVABLE);
}
void setMovable(bool b = true) {
setProperty(MOVABLE, b);
}
- // Object can be stretched within a sceene
+ // Object can be stretched within a screen
bool isStretchable() {
return isProperty(STRETCH);
}
void setStretchable(bool b = true) {
setProperty(STRETCH, b);
}
- // Object has exclusive updates to a sceene
+ // Object has exclusive updates to a screen
bool isModal() {
return isProperty(MODAL);
}
@@ -214,7 +214,8 @@ public:
bool isTransparent() {
return isProperty(TRANSPAR);
}
- void setTransparent(bool b = true) {
+
+ virtual void setTransparent(bool b = true) {
setProperty(TRANSPAR, b);
}
// Should the object be hidden when clicked on
diff --git a/engines/bagel/baglib/sprite_object.h b/engines/bagel/baglib/sprite_object.h
index 9fa3789194e..4466574702e 100644
--- a/engines/bagel/baglib/sprite_object.h
+++ b/engines/bagel/baglib/sprite_object.h
@@ -52,35 +52,35 @@ public:
bool isInside(const CBofPoint &xPoint) override;
- int getWieldCursor() {
+ int getWieldCursor() const {
return _nWieldCursor;
}
void setWieldCursor(int n) {
_nWieldCursor = n;
}
- CBofSprite *getSprite() {
+ CBofSprite *getSprite() const {
return _xSprite;
}
CBofRect getRect() override;
- int getCels() {
+ int getCels() const {
return _nCels;
}
- bool isAnimated() {
+ bool isAnimated() const {
return _bAnimated;
}
void setAnimated(bool b = true);
void setCels(int nCels);
- virtual void setPosition(const CBofPoint &pos) override;
+ void setPosition(const CBofPoint &pos) override;
ErrorCode update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcRect = nullptr, int /*nMaskColor*/ = -1) override;
void setProperty(const CBofString &sProp, int nVal) override;
int getProperty(const CBofString &sProp) override;
- int getFrameRate() {
+ int getFrameRate() const {
return _nMaxFrameRate;
}
void setFrameRate(int nFR) {
diff --git a/engines/bagel/baglib/storage_dev_win.cpp b/engines/bagel/baglib/storage_dev_win.cpp
index 9dc007241c0..761efd95be7 100644
--- a/engines/bagel/baglib/storage_dev_win.cpp
+++ b/engines/bagel/baglib/storage_dev_win.cpp
@@ -1080,7 +1080,7 @@ CBagObject *CBagStorageDev::onNewUserObject(const CBofString &str) {
return nullptr;
}
-void CBagStorageDev::onSetFilter(bool (*filterFunction)(const uint16 nFilterid, CBofBitmap *, CBofRect *)) {
+void CBagStorageDev::onSetFilter(bool (*filterFunction)(uint16 nFilterid, CBofBitmap *, CBofRect *)) {
_pBitmapFilter = filterFunction;
}
diff --git a/engines/bagel/baglib/storage_dev_win.h b/engines/bagel/baglib/storage_dev_win.h
index ed2185c2ec5..8ccbbadfa04 100644
--- a/engines/bagel/baglib/storage_dev_win.h
+++ b/engines/bagel/baglib/storage_dev_win.h
@@ -348,7 +348,7 @@ public:
virtual CBofPoint arrangeFloater(CBofPoint nPos, CBagObject *pObj);
// Set and Get the number of pages required to display all floating objects
- int getNumFloatPages() {
+ int getNumFloatPages() const {
return _nFloatPages;
}
void setNumFloatPages(int nFloatPages) {
@@ -357,7 +357,7 @@ public:
// Correctly set the filter function for the storage device.
//
- void onSetFilter(bool (*FilterFxn)(const uint16 nFilterId, CBofBitmap *, CBofRect *));
+ void onSetFilter(bool (*FilterFxn)(uint16 nFilterId, CBofBitmap *, CBofRect *));
// Get a pointer to the filter function
//
@@ -365,7 +365,7 @@ public:
// Predicate to test if this storage device is filtered.
//
- bool isFiltered() {
+ bool isFiltered() const {
return _nFilterId != 0;
}
@@ -428,14 +428,13 @@ public:
void setOnUpdate(bool bVal = true) {
_bOnUpdate = bVal;
}
- bool getOnUpdate() {
+ bool getOnUpdate() const {
return _bOnUpdate;
}
virtual ErrorCode paintScreen(CBofRect *pRect = nullptr);
- ErrorCode paintObjects(CBofList<CBagObject *> *list, CBofBitmap *pBmp,
- CBofRect &viewOffsetRect, CBofList<CBofRect> * = nullptr, bool tempVar = true);
- ErrorCode paintWithCursor(CBofBitmap *pBmp, CBofRect *pRect = nullptr);
+ virtual ErrorCode paintObjects(CBofList<CBagObject *> *list, CBofBitmap *pBmp,
+ CBofRect &viewOffsetRect, CBofList<CBofRect> * = nullptr, bool tempVar = true);
virtual CBofRect getLocation() {
return getWindowRect();
@@ -450,7 +449,7 @@ public:
return _pWorkBmp;
}
- ErrorCode loadFile(const CBofString &sWldFile) override;
+ ErrorCode loadFile(const CBofString &sFile) override;
virtual const CBofString &getHelpFilename() {
return _sHelpFileName;
@@ -499,20 +498,21 @@ public:
return getWindowRect();
}
- virtual ErrorCode setBackground(CBofBitmap *pBmp) override {
+ ErrorCode setBackground(CBofBitmap *pBmp) override {
if (pBmp)
return setBackdrop(pBmp);
killBackdrop();
return ERR_NONE;
}
- virtual CBofBitmap *getBackground() override {
+
+ CBofBitmap *getBackground() override {
return getBackdrop();
}
- virtual ErrorCode loadFile(const CBofString &sWldFile) override;
+ ErrorCode loadFile(const CBofString &sWldFile) override;
- ErrorCode create(const char *pszName, CBofRect *pRect = nullptr, CBofWindow *pParent = nullptr, uint32 nControlID = 0);
+ ErrorCode create(const char *pszName, CBofRect *pRect = nullptr, CBofWindow *pParent = nullptr, uint32 nControlID = 0) override;
ErrorCode attach() override; // This function attaches the background and necessary bitmaps
@@ -555,7 +555,7 @@ public:
int getObjectValue(const CBofString &sObject, const CBofString &sProperty);
void setObjectValue(const CBofString &sObject, const CBofString &sProperty, int nValue);
- int getNumStorageDevices() {
+ int getNumStorageDevices() const {
return _xStorageDeviceList.getCount();
}
diff --git a/engines/bagel/boflib/gfx/bitmap.cpp b/engines/bagel/boflib/gfx/bitmap.cpp
index 345ba554faf..fecbbd8e788 100644
--- a/engines/bagel/boflib/gfx/bitmap.cpp
+++ b/engines/bagel/boflib/gfx/bitmap.cpp
@@ -1097,9 +1097,7 @@ ErrorCode paintBitmap(CBofWindow *pWindow, const char *pszFileName, CBofRect *pD
assert(pWindow != nullptr);
assert(pszFileName != nullptr);
- ErrorCode errorCode;
CBofBitmap *pBmp = new CBofBitmap(pszFileName, pPalette);
-
CBofRect cRect = pBmp->getRect();
if (pSrcRect == nullptr)
@@ -1108,7 +1106,7 @@ ErrorCode paintBitmap(CBofWindow *pWindow, const char *pszFileName, CBofRect *pD
if (pDstRect == nullptr)
pDstRect = &cRect;
- errorCode = pBmp->paint(pWindow, pDstRect, pSrcRect, nMaskColor);
+ ErrorCode errorCode = pBmp->paint(pWindow, pDstRect, pSrcRect, nMaskColor);
delete pBmp;
diff --git a/engines/bagel/boflib/gui/dialog.h b/engines/bagel/boflib/gui/dialog.h
index cba6e528712..5b4540d3775 100644
--- a/engines/bagel/boflib/gui/dialog.h
+++ b/engines/bagel/boflib/gui/dialog.h
@@ -94,7 +94,7 @@ public:
* @param nControlID Control Id
* @return Error return code
*/
- ErrorCode create(const char *pszName, CBofRect *pRect = nullptr, CBofWindow *pParent = nullptr, uint32 nControlID = 0);
+ virtual ErrorCode create(const char *pszName, CBofRect *pRect = nullptr, CBofWindow *pParent = nullptr, uint32 nControlID = 0);
/**
* Set the dialog flags
diff --git a/engines/bagel/boflib/gui/text_box.cpp b/engines/bagel/boflib/gui/text_box.cpp
index 1d2b94ad551..386d9ec0c7e 100644
--- a/engines/bagel/boflib/gui/text_box.cpp
+++ b/engines/bagel/boflib/gui/text_box.cpp
@@ -163,8 +163,8 @@ int CBofTextBox::getIndex(const int nLine) {
// Find the index into our buffer that represents the top left of the
// buffer that is nLine from current the beginning of the buffer.
- const char *pszCur, *pszBuffer, *pszLast;
- pszLast = pszCur = pszBuffer = _cBuffer;
+ const char *pszCur, *pszBuffer;
+ const char *pszLast = pszCur = pszBuffer = _cBuffer;
for (int i = 0; i < nLine; i++) {
pszLast = pszCur;
pszCur = strstr(pszCur, "\n");
diff --git a/engines/bagel/boflib/gui/window.cpp b/engines/bagel/boflib/gui/window.cpp
index 750a03b7810..5546d0d763e 100644
--- a/engines/bagel/boflib/gui/window.cpp
+++ b/engines/bagel/boflib/gui/window.cpp
@@ -435,14 +435,11 @@ void CBofWindow::postUserMessage(uint32 lMessage, uint32 lExtraInfo) {
CBofWindow *CBofWindow::getAnscestor() {
assert(isValidObject(this));
- CBofWindow *pCurWnd, *pLastWnd;
-
- pLastWnd = this;
- pCurWnd = _parent;
+ CBofWindow *pLastWnd = this;
+ CBofWindow *pCurWnd = _parent;
while (pCurWnd != nullptr) {
pLastWnd = pCurWnd;
-
pCurWnd = pCurWnd->_parent;
}
diff --git a/engines/bagel/boflib/gui/window.h b/engines/bagel/boflib/gui/window.h
index 507d731ccfd..ff1c8727597 100644
--- a/engines/bagel/boflib/gui/window.h
+++ b/engines/bagel/boflib/gui/window.h
@@ -274,11 +274,11 @@ public:
_pBackdrop = nullptr;
}
- CBofBitmap *getBackdrop() {
+ CBofBitmap *getBackdrop() const {
return _pBackdrop;
}
- bool hasBackdrop() {
+ bool hasBackdrop() const {
return _pBackdrop != nullptr;
}
@@ -289,29 +289,30 @@ public:
/**
* Updates the specified section of the background bitmap
- * @param pRect Area of bitmap to update on screen
- * @return Error return code
+ * @param pRect Area of bitmap to update on screen
+ * @param nTransparentColor Color index used for transparency (-1 = none)
+ * @return Error return code
*/
ErrorCode paintBackdrop(CBofRect *pRect = nullptr, int nTransparentColor = -1);
void setControlID(uint32 nID) {
_nID = nID;
}
- uint32 getControlID() {
+ uint32 getControlID() const {
return _nID;
}
void setBkColor(RGBCOLOR cColor) {
_cBkColor = cColor;
}
- RGBCOLOR getBkColor() {
+ RGBCOLOR getBkColor() const {
return _cBkColor;
}
void setFgColor(RGBCOLOR cColor) {
_cFgColor = cColor;
}
- RGBCOLOR getFgColor() {
+ RGBCOLOR getFgColor() const {
return _cFgColor;
}
diff --git a/engines/bagel/boflib/timer.cpp b/engines/bagel/boflib/timer.cpp
index d4c53e43f54..3924d2f0aa8 100644
--- a/engines/bagel/boflib/timer.cpp
+++ b/engines/bagel/boflib/timer.cpp
@@ -91,13 +91,10 @@ CBofTimer::~CBofTimer() {
void CBofTimer::handleTimers() {
- CBofTimer *pTimer;
- uint32 lCurrentTime;
-
- pTimer = _pTimerList;
+ CBofTimer *pTimer = _pTimerList;
while (pTimer != nullptr) {
if (pTimer->isActive()) {
- lCurrentTime = g_system->getMillis();
+ uint32 lCurrentTime = g_system->getMillis();
if ((uint32)(lCurrentTime - pTimer->_lLastTime) >= pTimer->_nInterval) {
// Remember for next time
diff --git a/engines/bagel/dialogs/opt_window.cpp b/engines/bagel/dialogs/opt_window.cpp
index 751e9f77e6a..4b755b9cec8 100644
--- a/engines/bagel/dialogs/opt_window.cpp
+++ b/engines/bagel/dialogs/opt_window.cpp
@@ -538,7 +538,6 @@ void CBagOptWindow::saveOutNewSettings() {
void CBagOptWindow::loadIniSettings() {
assert(isValidObject(this));
- int nTemp;
ConfMan.registerDefault("Panimations", true);
ConfMan.registerDefault("FlyThroughs", true);
@@ -549,7 +548,7 @@ void CBagOptWindow::loadIniSettings() {
_cSystemData._bPanimations = ConfMan.getBool("Panimations");
_cSystemData._bFlythroughs = ConfMan.getBool("FlyThroughs");
- nTemp = ConfMan.getInt("Correction");
+ int nTemp = ConfMan.getInt("Correction");
if (nTemp < 0 || nTemp > 6)
nTemp = 2;
_cSystemData._nCorrection = 6 - nTemp;
diff --git a/engines/bagel/dialogs/save_dialog.h b/engines/bagel/dialogs/save_dialog.h
index f871ceba996..f6e5a3ce9ee 100644
--- a/engines/bagel/dialogs/save_dialog.h
+++ b/engines/bagel/dialogs/save_dialog.h
@@ -53,10 +53,10 @@ public:
void onInitDialog() override;
protected:
- virtual void onPaint(CBofRect *pRect) override;
- virtual void onBofButton(CBofObject *pObject, int nState) override;
- virtual void onBofListBox(CBofObject *pObject, int nItemIndex) override;
- virtual void onKeyHit(uint32 lKey, uint32 lRepCount) override;
+ void onPaint(CBofRect *pRect) override;
+ void onBofButton(CBofObject *pObject, int nState) override;
+ void onBofListBox(CBofObject *pObject, int nItemIndex) override;
+ void onKeyHit(uint32 lKey, uint32 lRepCount) override;
void saveAndClose();
Commit: 3bbe28bcd85b15711b76830856652123432a5f7e
https://github.com/scummvm/scummvm/commit/3bbe28bcd85b15711b76830856652123432a5f7e
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-05-26T06:21:48+01:00
Commit Message:
BAGEL: Remove unused methods in CBofWindow
Changed paths:
engines/bagel/boflib/gui/window.cpp
engines/bagel/boflib/gui/window.h
diff --git a/engines/bagel/boflib/gui/window.cpp b/engines/bagel/boflib/gui/window.cpp
index 5546d0d763e..66f5a40cc55 100644
--- a/engines/bagel/boflib/gui/window.cpp
+++ b/engines/bagel/boflib/gui/window.cpp
@@ -412,10 +412,6 @@ void CBofWindow::screenToClient(CBofPoint *pPoint) {
// Not needed in ScummVM
}
-void CBofWindow::clientToScreen(CBofPoint *pPoint) {
- // Not needed in ScummVM
-}
-
CBofRect CBofWindow::getClientRect() {
assert(isValidObject(this));
@@ -432,20 +428,6 @@ void CBofWindow::postUserMessage(uint32 lMessage, uint32 lExtraInfo) {
g_system->getEventManager()->pushEvent(e);
}
-CBofWindow *CBofWindow::getAnscestor() {
- assert(isValidObject(this));
-
- CBofWindow *pLastWnd = this;
- CBofWindow *pCurWnd = _parent;
-
- while (pCurWnd != nullptr) {
- pLastWnd = pCurWnd;
- pCurWnd = pCurWnd->_parent;
- }
-
- return pLastWnd;
-}
-
void CBofWindow::flushAllMessages() {
// Make sure this is a valid window
assert(isValidObject(this));
diff --git a/engines/bagel/boflib/gui/window.h b/engines/bagel/boflib/gui/window.h
index ff1c8727597..ccd51a6e5e2 100644
--- a/engines/bagel/boflib/gui/window.h
+++ b/engines/bagel/boflib/gui/window.h
@@ -144,12 +144,12 @@ public:
* @param y New upper left corner Y position
* @param bRepaint true if should update the window
*/
- void move(const int x, const int y, bool bRepaint = false);
+ void move(int x, int y, bool bRepaint = false);
/**
* Resizes current window to specified area
- * @param pRect New area for window
- * @parambRepaint Optional repaint after resize
+ * @param pRect New area for window
+ * @param bRepaint Optional repaint after resize
*/
void reSize(CBofRect *pRect, bool bRepaint = false);
@@ -189,27 +189,12 @@ public:
*/
void killMyTimers();
- /**
- * Determines if specified window is a child to current window
- * @param pWin Window to check
- * @return true if pWnd is a child of current window, false if not
- */
- bool isChildOf(CBofWindow *pWin);
-
- /**
- * Determines if specified window is a parent to current window
- * @param pWin Window to check
- * @return true if pWnd is a parent of current window, false if not
- */
- bool isParentOf(CBofWindow *pWin);
-
/**
* Returns the parent window element, if any
*/
CBofWindow *getParent() const {
return _parent;
}
- CBofWindow *getAnscestor();
/**
* Causes all parent windows to have valid paint regions
@@ -246,7 +231,6 @@ public:
}
void screenToClient(CBofPoint *pPoint);
- void clientToScreen(CBofPoint *pPoint);
/**
* Selects and Realizes specified palette into current DC
@@ -319,7 +303,7 @@ public:
void setPrevMouseDown(CBofPoint p) {
_cPrevMouseDown = p;
}
- CBofPoint getPrevMouseDown() {
+ CBofPoint getPrevMouseDown() const {
return _cPrevMouseDown;
}
Commit: 79457670a1bd78e9ba1f04efa2df2a5719abd6c3
https://github.com/scummvm/scummvm/commit/79457670a1bd78e9ba1f04efa2df2a5719abd6c3
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-05-26T06:21:49+01:00
Commit Message:
BAGEL: Remove unreachable code in CBofMovie
Changed paths:
engines/bagel/boflib/gui/movie.cpp
diff --git a/engines/bagel/boflib/gui/movie.cpp b/engines/bagel/boflib/gui/movie.cpp
index d51a7b9ee76..3c745fab478 100644
--- a/engines/bagel/boflib/gui/movie.cpp
+++ b/engines/bagel/boflib/gui/movie.cpp
@@ -100,7 +100,6 @@ bool CBofMovie::openMovie(const char *sFilename) {
if (!_pSmk->loadFile(sFilename)) {
// Opened failed
error("Movie not found=%s", sFilename);
- return false;
}
// If supposed to stretch into specified window
Commit: 74eaaa5a888d5c40472c1efb9a6603fba83e8df1
https://github.com/scummvm/scummvm/commit/74eaaa5a888d5c40472c1efb9a6603fba83e8df1
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-05-26T06:21:50+01:00
Commit Message:
BAGEL: Remove extra const in function declarations, add missing const
Changed paths:
engines/bagel/boflib/gfx/text.h
engines/bagel/boflib/gui/dialog.h
engines/bagel/boflib/gui/list_box.h
engines/bagel/boflib/gui/scroll_bar.h
engines/bagel/boflib/gui/text_box.h
engines/bagel/boflib/point.h
diff --git a/engines/bagel/boflib/gfx/text.h b/engines/bagel/boflib/gfx/text.h
index 7aeb128f016..ce94a2d8618 100644
--- a/engines/bagel/boflib/gfx/text.h
+++ b/engines/bagel/boflib/gfx/text.h
@@ -210,7 +210,7 @@ public:
* @param cColor Color that the text will be
* @return Error return Code
*/
- ErrorCode display(CBofWindow *pWnd, const char *pszText, const int nSize, const int nWeight, const RGBCOLOR cColor = CTEXT_COLOR, int nFont = FONT_DEFAULT);
+ ErrorCode display(CBofWindow *pWnd, const char *pszText, int nSize, int nWeight, RGBCOLOR cColor = CTEXT_COLOR, int nFont = FONT_DEFAULT);
/**
* Display a text string, formatted in the current text area
@@ -221,7 +221,7 @@ public:
* @param cColor Color that the text will be
* @return Error return Code
*/
- ErrorCode display(CBofBitmap *pBmp, const char *pszText, const int nSize, const int nWeight, const RGBCOLOR cColor = CTEXT_COLOR, int nFont = FONT_DEFAULT);
+ ErrorCode display(CBofBitmap *pBmp, const char *pszText, int nSize, int nWeight, RGBCOLOR cColor = CTEXT_COLOR, int nFont = FONT_DEFAULT);
/**
* Display a shadowed text string into the current text area
diff --git a/engines/bagel/boflib/gui/dialog.h b/engines/bagel/boflib/gui/dialog.h
index 5b4540d3775..1989f282778 100644
--- a/engines/bagel/boflib/gui/dialog.h
+++ b/engines/bagel/boflib/gui/dialog.h
@@ -66,7 +66,7 @@ public:
/**
* Constructor
*/
- CBofDialog(const char *pszFileName, CBofWindow *pParent, const uint32 nID = 0, const uint32 lFlags = BOFDLG_DEFAULT);
+ CBofDialog(const char *pszFileName, CBofWindow *pParent, uint32 nID = 0, uint32 lFlags = BOFDLG_DEFAULT);
/**
* Destructor
diff --git a/engines/bagel/boflib/gui/list_box.h b/engines/bagel/boflib/gui/list_box.h
index cba3007f10f..571a3de45ae 100644
--- a/engines/bagel/boflib/gui/list_box.h
+++ b/engines/bagel/boflib/gui/list_box.h
@@ -77,12 +77,12 @@ public:
return scrollDown(_nPageSize);
}
- ErrorCode scrollUp(const int nLines);
+ ErrorCode scrollUp(int nLines);
ErrorCode scrollDown(const int nLines) {
return scrollUp(-nLines);
}
- ErrorCode scrollTo(const int nLine);
+ ErrorCode scrollTo(int nLine);
ErrorCode createWorkArea();
ErrorCode saveBackground();
diff --git a/engines/bagel/boflib/gui/scroll_bar.h b/engines/bagel/boflib/gui/scroll_bar.h
index f7b409f83d7..444b3e367b5 100644
--- a/engines/bagel/boflib/gui/scroll_bar.h
+++ b/engines/bagel/boflib/gui/scroll_bar.h
@@ -51,8 +51,8 @@ public:
ErrorCode loadBitmaps(const char *pszBack, const char *pszThumb, const char *pszLeftUp = nullptr, const char *pszRightUp = nullptr, const char *pszLeftDown = nullptr, const char *pszRightDown = nullptr);
- ErrorCode setPos(const int nPos, bool bRepaint = true, bool isInitial = false);
- int getPos() {
+ ErrorCode setPos(int nPos, bool bRepaint = true, bool isInitial = false);
+ int getPos() const {
return _nPos;
}
@@ -76,24 +76,24 @@ public:
return setPos(_nMax);
}
- int getScrollMin() {
+ int getScrollMin() const {
return _nMin;
}
- int getScrollMax() {
+ int getScrollMax() const {
return _nMax;
}
void setLineDelta(const int nDelta) {
_nLineDelta = nDelta;
}
- int getLineDelta() {
+ int getLineDelta() const {
return _nLineDelta;
}
void setPageDelta(const int nDelta) {
_nPageDelta = nDelta;
}
- int getPageDelta() {
+ int getPageDelta() const {
return _nPageDelta;
}
@@ -108,11 +108,11 @@ public:
protected:
int pointToPos(CBofPoint *pPoint);
- virtual void onPaint(CBofRect *pDirtyRect);
- virtual void onLButtonDown(uint32 nFlags, CBofPoint *pPoint, void * = nullptr);
- virtual void onLButtonUp(uint32 nFlags, CBofPoint *pPoint, void * = nullptr);
- virtual void onMouseMove(uint32 nFlags, CBofPoint *pPoint, void * = nullptr);
- virtual void onTimer(uint32);
+ void onPaint(CBofRect *pDirtyRect) override;
+ void onLButtonDown(uint32 nFlags, CBofPoint *pPoint, void * = nullptr) override;
+ void onLButtonUp(uint32 nFlags, CBofPoint *pPoint, void * = nullptr) override;
+ void onMouseMove(uint32 nFlags, CBofPoint *pPoint, void * = nullptr) override;
+ void onTimer(uint32) override;
//
// Data members
diff --git a/engines/bagel/boflib/gui/text_box.h b/engines/bagel/boflib/gui/text_box.h
index e7f89238b0a..0e82100ae89 100644
--- a/engines/bagel/boflib/gui/text_box.h
+++ b/engines/bagel/boflib/gui/text_box.h
@@ -43,40 +43,40 @@ public:
void setDisplay(CBofWindow *pWindow);
void setDisplay(CBofBitmap *pBitmap);
- void setTextAttribs(const int nSize, const int nWeight, const RGBCOLOR cColor = CTEXT_COLOR, const int nFont = FONT_DEFAULT);
+ void setTextAttribs(int nSize, int nWeight, RGBCOLOR cColor = CTEXT_COLOR, int nFont = FONT_DEFAULT);
void setPointSize(const int nSize) {
_nPointSize = nSize;
}
- int getPointSize() {
+ int getPointSize() const {
return _nPointSize;
}
void setWeight(const int nWeight) {
_nWeight = nWeight;
}
- int getWeight() {
+ int getWeight() const {
return _nWeight;
}
void setPageLength(const int nSize) {
_nPageSize = nSize;
}
- int getPageLength() {
+ int getPageLength() const {
return _nPageSize;
}
void setColor(const RGBCOLOR cColor) {
_cTextColor = cColor;
}
- RGBCOLOR getColor() {
+ RGBCOLOR getColor() const {
return _cTextColor;
}
void setFont(int nFont) {
_nTextFont = nFont;
}
- int getFont() {
+ int getFont() const {
return _nTextFont;
}
@@ -114,7 +114,7 @@ public:
}
protected:
- int getIndex(const int nLines);
+ int getIndex(int nLines);
// Data
CBofString _cBuffer;
diff --git a/engines/bagel/boflib/point.h b/engines/bagel/boflib/point.h
index 1cf3f8ec97e..b913208d58b 100644
--- a/engines/bagel/boflib/point.h
+++ b/engines/bagel/boflib/point.h
@@ -35,8 +35,8 @@ class CBofPoint : public StPoint, public CBofObject {
public:
// Constructors
CBofPoint();
- CBofPoint(const int initX, const int initY);
- CBofPoint(const StPoint stPoint);
+ CBofPoint(int initX, int initY);
+ CBofPoint(StPoint stPoint);
CBofPoint(const CBofPoint &cPoint);
CBofPoint(const StSize &cSize);
@@ -45,7 +45,7 @@ public:
}
void setWinPoint(const POINT *pPoint);
- POINT GetWinPoint();
+ POINT GetWinPoint() const;
void operator=(const POINT &stPoint) {
setWinPoint(&stPoint);
@@ -62,19 +62,19 @@ public:
void offset(StSize size);
void operator=(const StPoint &point);
void operator=(const CBofPoint &point);
- bool operator==(StPoint point);
- bool operator!=(StPoint point);
+ bool operator==(StPoint point) const;
+ bool operator!=(StPoint point) const;
void operator+=(StSize size);
void operator-=(StSize size);
void operator+=(StPoint point);
void operator-=(StPoint point);
// Operators returning CBofPoint values
- CBofPoint operator+(StSize size);
- CBofPoint operator+(StPoint point);
- CBofPoint operator-(StSize size);
- CBofPoint operator-(StPoint point);
- CBofPoint operator-();
+ CBofPoint operator+(StSize size) const;
+ CBofPoint operator+(StPoint point) const;
+ CBofPoint operator-(StSize size) const;
+ CBofPoint operator-(StPoint point) const;
+ CBofPoint operator-() const;
};
// CBofPoint
@@ -111,7 +111,7 @@ inline void CBofPoint::setWinPoint(const POINT *pPoint) {
y = pPoint->y;
}
-inline POINT CBofPoint::GetWinPoint() {
+inline POINT CBofPoint::GetWinPoint() const {
assert(isValidObject(this));
POINT stPoint;
@@ -162,14 +162,14 @@ inline void CBofPoint::operator=(const CBofPoint &point) {
y = point.y;
}
-inline bool CBofPoint::operator==(StPoint point) {
+inline bool CBofPoint::operator==(StPoint point) const {
// Make sure object is not used after it is destructed
assert(isValidObject(this));
return (x == point.x && y == point.y);
}
-inline bool CBofPoint::operator!=(StPoint point) {
+inline bool CBofPoint::operator!=(StPoint point) const {
// Make sure object is not used after it is destructed
assert(isValidObject(this));
@@ -208,35 +208,35 @@ inline void CBofPoint::operator-=(StSize size) {
y -= size.cy;
}
-inline CBofPoint CBofPoint::operator+(StSize size) {
+inline CBofPoint CBofPoint::operator+(StSize size) const {
// Make sure object is not used after it is destructed
assert(isValidObject(this));
return CBofPoint(x + size.cx, y + size.cy);
}
-inline CBofPoint CBofPoint::operator+(StPoint point) {
+inline CBofPoint CBofPoint::operator+(StPoint point) const {
// Make sure object is not used after it is destructed
assert(isValidObject(this));
return CBofPoint(x + point.x, y + point.y);
}
-inline CBofPoint CBofPoint::operator-(StSize size) {
+inline CBofPoint CBofPoint::operator-(StSize size) const {
// Make sure object is not used after it is destructed
assert(isValidObject(this));
return CBofPoint(x - size.cx, y - size.cy);
}
-inline CBofPoint CBofPoint::operator-(StPoint point) {
+inline CBofPoint CBofPoint::operator-(StPoint point) const {
// Make sure object is not used after it is destructed
assert(isValidObject(this));
return CBofPoint(x - point.x, y - point.y);
}
-inline CBofPoint CBofPoint::operator-() {
+inline CBofPoint CBofPoint::operator-() const {
// Make sure object is not used after it is destructed
assert(isValidObject(this));
More information about the Scummvm-git-logs
mailing list