shithub: duke3d

Download patch

ref: b0e452c5a8d4e749543b0f8a979c790b9dbce107
parent: 48170b9f442772d2275e51d3a63b7bfb51881491
parent: 9a7e477f770d159b7e79f6145505007c277297e1
author: Tanguy Fautre <[email protected]>
date: Sat Feb 22 07:39:56 EST 2020

Merge branch 'master' of https://github.com/GPSnoopy/BelgianChocolateDuke3D

--- a/Engine/src/draw.c
+++ b/Engine/src/draw.c
@@ -399,40 +399,32 @@
 }
 
 //FCS This is used to fill the inside of a wall (so it draws VERTICAL column, always).
-void vlineasm4(int32_t columnIndex, intptr_t framebuffer)
+void vlineasm4(int32_t columnIndex, uint8_t* framebuffer)
 {
-
 	if (!RENDER_DRAW_WALL_INSIDE)
-		return ;
+		return;
 
-    {
-        int i;
-        uint32_t temp;
-        
-        uintptr_t index = (framebuffer + ylookup[columnIndex]);
-        uint8_t  *dest= (uint8_t *)(-ylookup[columnIndex]);
-//        uint8_t  *dest= (uint8_t *)framebuffer;
-//        uint32_t index = 0;
-//        uint32_t length = ylookup[columnIndex];
+	int i;
+	uint32_t temp;
+    uint32_t index = 0;
+    uint32_t length = ylookup[columnIndex];
 
-        do {
-            for (i = 0; i < 4; i++)
-            {
-				
-        	    temp = ((uint32_t)vplce[i]) >> mach3_al;
-        	    temp = (((uint8_t *)(bufplce[i]))[temp]);
+	do {
+		for (i = 0; i < 4; i++)
+		{
+			temp = ((uint32_t)vplce[i]) >> mach3_al;
+			temp = (((uint8_t*)(bufplce[i]))[temp]);
 
 #if RENDER_LIMIT_PIXELS
-				if (pixelsAllowed-- > 0)
+			if (pixelsAllowed-- > 0)
 #endif
-        			dest[index+i] = palookupoffse [i] [temp];
-                
-	            vplce[i] += vince[i];
-            }
-            dest += bytesperline;
-        } while (((uint32_t)dest - bytesperline) < ((uint32_t)dest));
-    }
-} 
+				framebuffer[index + i] = palookupoffse[i][temp];
+
+			vplce[i] += vince[i];
+		}
+		index += bytesperline;
+	} while (index < length);
+}
 
 
 void setupmvlineasm(int32_t i1)
@@ -439,15 +431,14 @@
 {
     //Only keep 5 first bits
     machmv = (i1&0x1f);
-} 
+}
 
-
-void mvlineasm4(int32_t column, intptr_t framebufferOffset)
+void mvlineasm4(int32_t columnIndex, uint8_t* framebuffer)
 {
     int i;
     uint32_t temp;
-    uintptr_t index = (framebufferOffset + ylookup[column]);
-    uint8_t  *dest = (uint8_t *)(-ylookup[column]);
+	uint32_t index = 0;
+	uint32_t length = ylookup[columnIndex];
 
     do {
 
@@ -466,42 +457,15 @@
 #if RENDER_LIMIT_PIXELS
 			  if (pixelsAllowed-- > 0)
 #endif
-				dest[index+i] = palookupoffse[i][temp];
+				  framebuffer[index+i] = palookupoffse[i][temp];
 		  }
 	      vplce[i] += vince[i];
         }
-        dest += bytesperline;
+        index += bytesperline;
 
-    } while (((uint32_t)dest - bytesperline) < ((uint32_t)dest));
+    } while (index < length);
 } 
 /* END ---------------  WALLS RENDERING METHOD (USED TO BE HIGHLY OPTIMIZED ASSEMBLY) ----------------------------*/
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 
 
 /* ---------------  SPRITE RENDERING METHOD (USED TO BE HIGHLY OPTIMIZED ASSEMBLY) ----------------------------*/
--- a/Engine/src/draw.h
+++ b/Engine/src/draw.h
@@ -45,9 +45,9 @@
 void tvlineasm2(uint32_t,uint32_t,uintptr_t,uintptr_t,uint32_t,uintptr_t);
 int32_t mvlineasm1(int32_t,uint8_t*,int32_t,int32_t,uint8_t* texture,uint8_t* dest);
 void setupvlineasm(int32_t);
-void vlineasm4(int32_t,intptr_t);
+void vlineasm4(int32_t,uint8_t*);
 void setupmvlineasm(int32_t);
-void mvlineasm4(int32_t,intptr_t);
+void mvlineasm4(int32_t,uint8_t*);
 void setupspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
 void spritevline(int32_t,uint32_t,int32_t,uint32_t,uint8_t*,uint8_t*);
 void msetupspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
--- a/README.md
+++ b/README.md
@@ -37,7 +37,7 @@
 **Windows (Visual Studio 2019 x64 solution)** [![Windows CI Status](https://github.com/GPSnoopy/BelgianChocolateDuke3D/workflows/Windows%20CI/badge.svg)](https://github.com/GPSnoopy/BelgianChocolateDuke3D/actions?query=workflow%3A%22Windows+CI%22)
 ```
 > vcpkg_windows.bat
-> build_windows.bat
+> build_windows_x64.bat
 ```
 
 **Linux (GCC Makefile)** [![Linux CI Status](https://github.com/GPSnoopy/BelgianChocolateDuke3D/workflows/Linux%20CI/badge.svg)](https://github.com/GPSnoopy/BelgianChocolateDuke3D/actions?query=workflow%3A%22Linux+CI%22)
--- a/build_windows.bat
+++ /dev/null
@@ -1,2 +1,0 @@
-build_windows_x86.bat || goto :error
-build_windows_x64.bat || goto :error
\ No newline at end of file