Skip to content

Commit e36dcaf

Browse files
committed
Hotfix for division by zero exceptions in the soft graphics drivers.
1 parent ca396fc commit e36dcaf

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/Graphics_SoftFP.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,8 +581,8 @@ static void DrawSprite2D(VertexFixed* V0, VertexFixed* V1, VertexFixed* V2) {
581581
int delTY = (FixedMul(V2->v, IntToFixed(curTexHeight)) >> FP_SHIFT) - begTY;
582582

583583
int width = maxX - minX, height = maxY - minY;
584-
if (width == 0) width == 1;
585-
if (height == 0) height == 1;
584+
if (width == 0) width = 1;
585+
if (height == 0) height = 1;
586586

587587
int fast = delTX == width && delTY == height &&
588588
(begTX + delTX < curTexWidth) &&

src/Graphics_SoftGPU.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,8 @@ static void DrawSprite2D(Vertex* V0, Vertex* V1, Vertex* V2) {
401401
int delTY = (int)(V2->v * curTexHeight) - begTY;
402402

403403
int width = maxX - minX, height = maxY - minY;
404-
if (width == 0) width == 1;
405-
if (height == 0) height == 1;
404+
if (width == 0) width = 1;
405+
if (height == 0) height = 1;
406406

407407
int fast = delTX == width && delTY == height &&
408408
(begTX + delTX < curTexWidth ) &&

src/Graphics_SoftMin.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,8 @@ static void DrawSprite2D(Vertex* V0, Vertex* V1, Vertex* V2) {
388388
int delTY = (int)(V2->v * curTexHeight) - begTY;
389389

390390
int width = maxX - minX, height = maxY - minY;
391-
if (width == 0) width == 1;
392-
if (height == 0) height == 1;
391+
if (width == 0) width = 1;
392+
if (height == 0) height = 1;
393393

394394
int fast = delTX == width && delTY == height &&
395395
(begTX + delTX < curTexWidth ) &&

0 commit comments

Comments
 (0)