[Scummvm-git-logs] scummvm master -> 451972b076e8f099ed281a9aff8bcfe50841e2f6
Strangerke
noreply at scummvm.org
Wed May 29 21:14:47 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:
451972b076 BAGEL: Remove unused variables in CBagButtonObject and variable assignment in CBagCharacterObject
Commit: 451972b076e8f099ed281a9aff8bcfe50841e2f6
https://github.com/scummvm/scummvm/commit/451972b076e8f099ed281a9aff8bcfe50841e2f6
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-05-29T22:14:35+01:00
Commit Message:
BAGEL: Remove unused variables in CBagButtonObject and variable assignment in CBagCharacterObject
Changed paths:
engines/bagel/baglib/button_object.cpp
engines/bagel/baglib/character_object.cpp
diff --git a/engines/bagel/baglib/button_object.cpp b/engines/bagel/baglib/button_object.cpp
index 02650baeddf..06d6d5f8836 100644
--- a/engines/bagel/baglib/button_object.cpp
+++ b/engines/bagel/baglib/button_object.cpp
@@ -153,22 +153,19 @@ void CBagButtonObject::onLButtonUp(uint32 flags, CBofPoint *point, void *extraIn
CBagPanWindow *pWnd = (CBagPanWindow *)extraInfo;
CBofRect r = pWnd->getSlideBitmap()->getCurrView();
- CBofPoint mLoc;
- mLoc.x = point->x + r.left - pWnd->getViewPortPos().x;
- mLoc.y = point->y + r.top - pWnd->getViewPortPos().y;
-
+ int mLocX = point->x + r.left - pWnd->getViewPortPos().x;
int xIncrement = _slideRect.width() / (_numPos - 1);
int slidePos = _slideRect.left;
int i;
- for (i = 0; (i < _numPos) && (slidePos < mLoc.x); i++)
+ for (i = 0; (i < _numPos) && (slidePos < mLocX); i++)
slidePos = _slideRect.left + (i * xIncrement);
// We Went too far
i--;
// Find the previous position was closer to the mouse
- if ((i > 0) && (slidePos - mLoc.x > mLoc.x - (slidePos - xIncrement)))
+ if ((i > 0) && (slidePos - mLocX > mLocX - (slidePos - xIncrement)))
i--; // Go back one
NewPoint.x = _slideRect.left + (i * xIncrement);
@@ -222,15 +219,13 @@ bool CBagButtonObject::onMouseMove(uint32 /*nFlags*/, CBofPoint point, void *ext
}
setDirty();
- CBofPoint mLoc;
CBofPoint NewPoint = getPosition();
CBagPanWindow *pWnd = (CBagPanWindow *)extraInfo;
CBofRect r = pWnd->getSlideBitmap()->getCurrView();
- mLoc.x = point.x + r.left - pWnd->getViewPortPos().x;
- mLoc.y = point.y + r.top - pWnd->getViewPortPos().y;
+ int mLocX = point.x + r.left - pWnd->getViewPortPos().x;
- int NewXPos = mLoc.x;
+ int NewXPos = mLocX;
// Constrict Dragging to width of slidebar
if (NewXPos > _slideRect.right)
diff --git a/engines/bagel/baglib/character_object.cpp b/engines/bagel/baglib/character_object.cpp
index 53bf57fe149..8773800bfc3 100644
--- a/engines/bagel/baglib/character_object.cpp
+++ b/engines/bagel/baglib/character_object.cpp
@@ -237,9 +237,7 @@ void CBagCharacterObject::updatePosition() {
if (lSeekPos + (int32)(2 * sizeof(int32)) <= _binBufLen) {
int xPos = READ_LE_INT32(&_binBuf[lSeekPos]);
lSeekPos += sizeof(int32);
-
int yPos = READ_LE_INT32(&_binBuf[lSeekPos]);
- lSeekPos += sizeof(int32);
// A valid number was read
if ((xPos > -1) && (yPos > -1)) {
More information about the Scummvm-git-logs
mailing list