shithub: duke3d

Download patch

ref: 27447546cc4c6733d872f96207409d46be56a4bb
parent: caf9454f256543aab7fc151a1380ead3f7be0f57
author: Rohit Nirmal <rohitnirmal9@gmail.com>
date: Thu Apr 2 11:26:16 EDT 2015

64-bit: Fix crashes related to drawing certain sprites
through the save game menu and in-game security camera.

--- a/Engine/src/draw.c
+++ b/Engine/src/draw.c
@@ -36,7 +36,7 @@
 
 /* ---------------  WALLS RENDERING METHOD (USED TO BE HIGHLY OPTIMIZED ASSEMBLY) ----------------------------*/
 extern int32_t asm1;
-extern int32_t asm2;
+extern intptr_t asm2;
 extern uint8_t *asm3;
 extern int32_t asm4;
 
@@ -312,8 +312,8 @@
 	uint32_t tran2incb = asm1;
 	uintptr_t tran2bufa = i3;
 	uintptr_t tran2bufb = i4;
-	uint32_t tran2edi = asm2;
-	uint32_t tran2edi1 = asm2 + 1;
+	uintptr_t tran2edi = asm2;
+	uintptr_t tran2edi1 = asm2 + 1;
 
 	i6 -= asm2;
 
--- a/Engine/src/engine.c
+++ b/Engine/src/engine.c
@@ -190,8 +190,8 @@
 
 int32_t xyaspect, viewingrangerecip;
 
-int32_t asm1, asm2, asm4;
-intptr_t asm3;
+int32_t asm1, asm4;
+intptr_t asm2, asm3;
 
 
 int32_t vplce[4], vince[4];
@@ -3047,8 +3047,8 @@
 
 static void transmaskvline(int32_t x)
 {
-    int32_t vplc, vinc, p, i, palookupoffs;
-    intptr_t bufplc;
+    int32_t vplc, vinc, i, palookupoffs;
+    intptr_t bufplc, p;
     short y1v, y2v;
 
     if ((x < 0) || (x >= xdimen)) return;
@@ -3079,7 +3079,8 @@
 
 static void transmaskvline2 (int32_t x)
 {
-    int32_t i, y1, y2, x2;
+    int32_t y1, y2, x2;
+    intptr_t i;
     short y1ve[2], y2ve[2];
 
     if ((x < 0) || (x >= xdimen)) return;