[Scummvm-git-logs] scummvm master -> 83995d9b851abbb0e5d77c751ab1a32cd38927c0
aquadran
noreply at scummvm.org
Thu Oct 2 11:22:54 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:
83995d9b85 TINYGL: Avoid shifting negative values
Commit: 83995d9b851abbb0e5d77c751ab1a32cd38927c0
https://github.com/scummvm/scummvm/commit/83995d9b851abbb0e5d77c751ab1a32cd38927c0
Author: PaweÅ KoÅodziejski (aquadran at gmail.com)
Date: 2025-10-02T13:22:49+02:00
Commit Message:
TINYGL: Avoid shifting negative values
Changed paths:
graphics/tinygl/ztriangle.cpp
diff --git a/graphics/tinygl/ztriangle.cpp b/graphics/tinygl/ztriangle.cpp
index a8e0b5f47a5..399f16e131d 100644
--- a/graphics/tinygl/ztriangle.cpp
+++ b/graphics/tinygl/ztriangle.cpp
@@ -390,10 +390,16 @@ void FrameBuffer::fillTriangle(ZBufferPoint *p0, ZBufferPoint *p1, ZBufferPoint
if (update_left) {
dy1 = l2->y - l1->y;
dx1 = l2->x - l1->x;
- if (dy1 > 0)
- tmp = (dx1 << 16) / dy1;
- else
+ if (dy1 > 0) {
+ if (dx1 < 0) {
+ tmp = (-dx1 << 16) / dy1;
+ tmp = -tmp;
+ } else {
+ tmp = (dx1 << 16) / dy1;
+ }
+ } else {
tmp = 0;
+ }
x1 = l1->x;
error = 0;
derror = tmp & 0x0000ffff;
@@ -446,10 +452,16 @@ void FrameBuffer::fillTriangle(ZBufferPoint *p0, ZBufferPoint *p1, ZBufferPoint
if (update_right) {
dx2 = (pr2->x - pr1->x);
dy2 = (pr2->y - pr1->y);
- if (dy2 > 0)
- dx2dy2 = (dx2 << 16) / dy2;
- else
+ if (dy2 > 0) {
+ if (dx2 < 0) {
+ dx2dy2 = (-dx2 << 16) / dy2;
+ dx2dy2 = -dx2dy2;
+ } else {
+ dx2dy2 = (dx2 << 16) / dy2;
+ }
+ } else {
dx2dy2 = 0;
+ }
x2 = pr1->x << 16;
}
More information about the Scummvm-git-logs
mailing list