[Scummvm-git-logs] scummvm master -> c5b28949964e380074fbe6c375f3c78f7e8dfc11
dreammaster
noreply at scummvm.org
Mon Sep 22 10:52:31 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
c5b2894996 BAGEL: Fix monochrome bitmap buffer in CSprite::SpritesOverlap
Commit: c5b28949964e380074fbe6c375f3c78f7e8dfc11
https://github.com/scummvm/scummvm/commit/c5b28949964e380074fbe6c375f3c78f7e8dfc11
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2025-09-22T03:52:24-07:00
Commit Message:
BAGEL: Fix monochrome bitmap buffer in CSprite::SpritesOverlap
Changed paths:
engines/bagel/hodjnpodj/hnplibs/sprite.cpp
diff --git a/engines/bagel/hodjnpodj/hnplibs/sprite.cpp b/engines/bagel/hodjnpodj/hnplibs/sprite.cpp
index e7fd5e7df48..26c4567f146 100644
--- a/engines/bagel/hodjnpodj/hnplibs/sprite.cpp
+++ b/engines/bagel/hodjnpodj/hnplibs/sprite.cpp
@@ -2225,8 +2225,9 @@ bool CSprite::SpritesOverlap(CDC * pDC, CSprite * pSprite, CPoint *pPoint) {
dx = unionRect.right - unionRect.left; // ... contains the bitmap area where the sprite was
dy = unionRect.bottom - unionRect.top; // ... and the bitmap area where it will be next
- dwN = stN = ((dx + 15) >> 3) * dy; // calculate the amount of memory that a bitmap mask
- chPixels = (byte *) calloc((size_t) 1, stN); // ... will occupy and allocation that amount of space
+ // Allocate a pixel buffer
+ dwN = stN = dx * dy;
+ chPixels = (byte *) calloc((size_t) 1, stN);
if (!chPixels)
return false;
@@ -2274,7 +2275,7 @@ bool CSprite::SpritesOverlap(CDC * pDC, CSprite * pSprite, CPoint *pPoint) {
if (chPixels[(i * cBitmapData.bmWidthBytes) + j] != 0) {
bSuccess = true;
if (pPoint != nullptr) { // estimate point of intersection
- (*pPoint).x = (j * 8) - (m_cPosition.x - unionRect.left);
+ (*pPoint).x = j - (m_cPosition.x - unionRect.left);
(*pPoint).y = i - (m_cPosition.y - unionRect.top);
if ((*pPoint).x < 0)
(*pPoint).x = 0;
More information about the Scummvm-git-logs
mailing list