[Scummvm-git-logs] scummvm master -> c333222e3a7f59ff285d2df1026a649662040aa7
Strangerke
noreply at scummvm.org
Wed May 22 07:32:18 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:
c333222e3a BAGEL: Remove scrollDown, change the definition of fadeLines and scrollUp in order to remove the unused parameters, clea
Commit: c333222e3a7f59ff285d2df1026a649662040aa7
https://github.com/scummvm/scummvm/commit/c333222e3a7f59ff285d2df1026a649662040aa7
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-05-22T08:32:12+01:00
Commit Message:
BAGEL: Remove scrollDown, change the definition of fadeLines and scrollUp in order to remove the unused parameters, clean the implementation
Changed paths:
engines/bagel/baglib/master_win.cpp
engines/bagel/boflib/gfx/bitmap.cpp
engines/bagel/boflib/gfx/bitmap.h
diff --git a/engines/bagel/baglib/master_win.cpp b/engines/bagel/baglib/master_win.cpp
index e6eeea8cecb..b3d95365b54 100644
--- a/engines/bagel/baglib/master_win.cpp
+++ b/engines/bagel/baglib/master_win.cpp
@@ -1275,7 +1275,7 @@ void CBagMasterWin::onUserMessage(uint32 message, uint32 param) {
CBofBitmap bmp(width(), height(), CBagel::getApp()->getPalette());
bmp.fillRect(nullptr, COLOR_BLACK);
- bmp.fadeLines(this, 0, 0);
+ bmp.fadeLines(this);
char buffer[MAX_FNAME];
diff --git a/engines/bagel/boflib/gfx/bitmap.cpp b/engines/bagel/boflib/gfx/bitmap.cpp
index 656155a41c5..55e88d74ffa 100644
--- a/engines/bagel/boflib/gfx/bitmap.cpp
+++ b/engines/bagel/boflib/gfx/bitmap.cpp
@@ -834,7 +834,7 @@ ErrorCode CBofBitmap::scrollRight(int nPixels, CBofRect * /*pRect*/) {
return _errCode;
}
-ErrorCode CBofBitmap::scrollUp(int nPixels, CBofRect *pRect) {
+ErrorCode CBofBitmap::scrollUp(int nPixels) {
assert(isValidObject(this));
if (_errCode == ERR_NONE) {
@@ -842,15 +842,10 @@ ErrorCode CBofBitmap::scrollUp(int nPixels, CBofRect *pRect) {
CBofRect cRect(0, 0, _nDX - 1, _nDY - 1);
- // Flip entire bitmap ?
- if (pRect == nullptr) {
- pRect = &cRect;
- }
-
- int32 x = pRect->left;
- int32 y = pRect->top;
- int32 dx = pRect->width();
- int32 dy = pRect->height();
+ int32 x = cRect.left;
+ int32 y = cRect.top;
+ int32 dx = cRect.width();
+ int32 dy = cRect.height();
// Height must be valid or we're hosed
assert(dy > 0);
@@ -1032,7 +1027,7 @@ ErrorCode CBofBitmap::curtain(CBofWindow *pWnd, int nSpeed, int nMaskColor) {
return _errCode;
}
-ErrorCode CBofBitmap::fadeLines(CBofWindow *pWnd, CBofRect *pDstRect, CBofRect *pSrcRect, int nSpeed, int nMaskColor) {
+ErrorCode CBofBitmap::fadeLines(CBofWindow *pWnd,int nSpeed, int nMaskColor) {
assert(isValidObject(this));
assert(pWnd != nullptr);
assert(nSpeed != 0);
@@ -1040,17 +1035,13 @@ ErrorCode CBofBitmap::fadeLines(CBofWindow *pWnd, CBofRect *pDstRect, CBofRect *
if (_errCode == ERR_NONE) {
CBofRect cDstRect, cSrcRect, cWindowRect, cBmpRect;
-
// Entire window?
//
- if (pDstRect == nullptr) {
- cWindowRect = pWnd->getRect();
- pDstRect = &cWindowRect;
- }
- if (pSrcRect == nullptr) {
- cBmpRect = getRect();
- pSrcRect = &cBmpRect;
- }
+ cWindowRect = pWnd->getRect();
+ CBofRect *pDstRect = &cWindowRect;
+
+ cBmpRect = getRect();
+ CBofRect *pSrcRect = &cBmpRect;
int x1 = pDstRect->left;
int y1 = pDstRect->top;
diff --git a/engines/bagel/boflib/gfx/bitmap.h b/engines/bagel/boflib/gfx/bitmap.h
index 67cd9370f36..49b91f270f9 100644
--- a/engines/bagel/boflib/gfx/bitmap.h
+++ b/engines/bagel/boflib/gfx/bitmap.h
@@ -322,7 +322,7 @@ public:
ErrorCode fadeIn(CBofWindow *pWnd, int x = 0, int y = 0, int nMaskColor = NOT_TRANSPARENT, int nBlockSize = CBMP_FADE_SIZE, int nSpeed = CBMP_FADE_SPEED);
ErrorCode curtain(CBofWindow *pWnd, int nSpeed = CBMP_CURT_SPEED, int nMaskColor = NOT_TRANSPARENT);
- ErrorCode fadeLines(CBofWindow *pWnd, CBofRect *pDstRect = nullptr, CBofRect *pSrcRect = nullptr, int nSpeed = CBMP_LINE_SPEED, int nMaskColor = NOT_TRANSPARENT);
+ ErrorCode fadeLines(CBofWindow *pWnd, int nSpeed = CBMP_LINE_SPEED, int nMaskColor = NOT_TRANSPARENT);
/**
* Returns the color at the (x, y) location in this bmp
@@ -397,15 +397,9 @@ public:
/**
* Scrolls current bitmap vertically
* @param nPixels Number of pixels to scroll by
- * @param pRect Section of bitmap to scroll
* @return Error return code
*/
- ErrorCode scrollUp(int nPixels, CBofRect *pRect = nullptr);
-
-
- ErrorCode scrollDown(int nPixels, CBofRect *pRect = nullptr) {
- return scrollUp(-nPixels, pRect);
- }
+ ErrorCode scrollUp(int nPixels);
static void setUseBackdrop(bool b) {
_bUseBackdrop = b;
More information about the Scummvm-git-logs
mailing list