[Scummvm-git-logs] scummvm master -> d504f3f18b220e73a333dc6f8b01f42e1f634cb4
AndywinXp
noreply at scummvm.org
Mon Oct 16 21:20:59 UTC 2023
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:
d504f3f18b SWORD1: PSX: Improve accuracy of sprite clipping code
Commit: d504f3f18b220e73a333dc6f8b01f42e1f634cb4
https://github.com/scummvm/scummvm/commit/d504f3f18b220e73a333dc6f8b01f42e1f634cb4
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-10-16T23:20:51+02:00
Commit Message:
SWORD1: PSX: Improve accuracy of sprite clipping code
Changed paths:
engines/sword1/screen.cpp
diff --git a/engines/sword1/screen.cpp b/engines/sword1/screen.cpp
index 7616acb743a..06511504484 100644
--- a/engines/sword1/screen.cpp
+++ b/engines/sword1/screen.cpp
@@ -1331,11 +1331,21 @@ void Screen::fnSetParallax(uint32 screen, uint32 resId) {
}
void Screen::spriteClipAndSet(uint16 *pSprX, uint16 *pSprY, uint16 *pSprWidth, uint16 *pSprHeight, uint16 *incr) {
- int16 sprX = *pSprX - SCREEN_LEFT_EDGE;
- int16 sprY = *pSprY - SCREEN_TOP_EDGE;
+ int16 sprX = *pSprX;
+ int16 sprY = *pSprY;
int16 sprW = *pSprWidth;
int16 sprH = *pSprHeight;
+ // The PSX code clips sprites a little bit differently
+ if (SwordEngine::isPsx()) {
+ sprX -= 129;
+ sprY = (sprY + 1) & 0xFFFE;
+ } else {
+ sprX -= SCREEN_LEFT_EDGE;
+ }
+
+ sprY -= SCREEN_TOP_EDGE;
+
if (sprY < 0) {
*incr = (uint16)((-sprY) * sprW);
sprH += sprY;
@@ -1396,9 +1406,6 @@ void Screen::spriteClipAndSet(uint16 *pSprX, uint16 *pSprY, uint16 *pSprWidth, u
gridBuf += _gridSizeX;
}
}
-
- if (SwordEngine::isPsx())
- *pSprY = (*pSprY + 1) & 0xFFFE;
}
void Screen::fnFlash(uint8 color) {
More information about the Scummvm-git-logs
mailing list