shithub: duke3d

Download patch

ref: 030cac6b56e3b05b02cf44abf048f77587625f5c
parent: fb65145deb14daa6c0226b693d74fd274ebf166b
author: Jacob Moody <moody@posixcafe.org>
date: Sun Feb 5 23:22:19 EST 2023

compiles now

--- a/Engine/src/display.c
+++ b/Engine/src/display.c
@@ -53,7 +53,7 @@
 
 
 	/* !!! move these elsewhere? */
-int32_t xres, yres, bytesperline, imageSize, maxpages;
+int32_t xres, yres, dukebytesperline, imageSize, maxpages;
 uint8_t* frameplace;
 
 //The frambuffer address
@@ -112,7 +112,7 @@
 	printf("init_new_res_vars %d %d\n", xdim, ydim);
 
 	numpages = 1; // we always expose the same surface to the drawing engine.
-	bytesperline = surface->w;
+	dukebytesperline = surface->w;
 	vesachecked = 1;
 	vgacompatible = 1;
 	linearmode = 1;
@@ -153,7 +153,7 @@
 	for (i = 0; i <= ydim; i++)
 	{
 		ylookup[i] = j;
-		j += bytesperline;
+		j += dukebytesperline;
 	}
 
 	horizycent = ((ydim * 4) >> 1);
@@ -162,7 +162,7 @@
 	oxyaspect = oxdimen = oviewingrange = -1;
 
 	//Let the Assembly module how many pixels to skip when drawing a column
-	setBytesPerLine(bytesperline);
+	setBytesPerLine(dukebytesperline);
 
 
 	setview(0L, 0L, xdim - 1, ydim - 1);
--- a/Engine/src/display.h
+++ b/Engine/src/display.h
@@ -15,7 +15,7 @@
 char  **_argv;
 
 /* !!! gads, look at all the namespace polution... */
-extern int32_t xres, yres, bytesperline, imageSize, maxpages;
+extern int32_t xres, yres, dukebytesperline, imageSize, maxpages;
 extern uint8_t  *screen, vesachecked;
 extern int32_t buffermode, origbuffermode, linearmode;
 extern uint8_t  permanentupdate, vgacompatible;
--- a/Engine/src/draw.c
+++ b/Engine/src/draw.c
@@ -183,10 +183,10 @@
 
 //Variable used to draw column.
 //This is how much you have to skip in the framebuffer in order to be one pixel below.
-static int32_t bytesperline;
-void setBytesPerLine(int32_t _bytesperline)
+static int32_t dukebytesperline;
+void setBytesPerLine(int32_t _dukebytesperline)
 {
-    bytesperline = _bytesperline;
+    dukebytesperline = _dukebytesperline;
 } 
 
 
@@ -238,7 +238,7 @@
 			*dest = palookupoffse[temp];
 	    
 		vplce += vince;
-	    dest += bytesperline;
+	    dest += dukebytesperline;
 	    numPixels--;
     }
     return vplce;
@@ -276,7 +276,7 @@
 		i4 += i1;
         
         //We are drawing a column ?!
-		dest += bytesperline;
+		dest += dukebytesperline;
 		numPixels--;
 	}
 	return i4;
@@ -360,8 +360,8 @@
 #endif
 			}
 		}
-		i6 += bytesperline;
-	} while (i6 > i6 - bytesperline);
+		i6 += dukebytesperline;
+	} while (i6 > i6 - dukebytesperline);
 	asm1 = i5;
 	asm2 = ebp;
 } 
@@ -387,7 +387,7 @@
 		}
 
 	    vplce += vince;
-	    dest += bytesperline;
+	    dest += dukebytesperline;
     }
     return vplce;
 }
@@ -422,7 +422,7 @@
 
 			vplce[i] += vince[i];
 		}
-		index += bytesperline;
+		index += dukebytesperline;
 	} while (index < length);
 }
 
@@ -461,7 +461,7 @@
 		  }
 	      vplce[i] += vince[i];
         }
-        index += bytesperline;
+        index += dukebytesperline;
 
     } while (index < length);
 } 
@@ -530,7 +530,7 @@
 			}
             
             //Move down one pixel on the framebuffer
-			dest += bytesperline;
+			dest += dukebytesperline;
 		}
 
 		
--- a/Engine/src/engine.c
+++ b/Engine/src/engine.c
@@ -2859,7 +2859,7 @@
             for(; i<windowx2+1+(stereopixelwidth<<1); i++) {
                 startumost[i] = windowy1, startdmost[i] = windowy2+1;
             }
-            viewoffset = windowy1*bytesperline+windowx1-(stereopixelwidth<<1);
+            viewoffset = windowy1*dukebytesperline+windowx1-(stereopixelwidth<<1);
             i = stereowidth;
         }
         else
@@ -2870,7 +2870,7 @@
             for(; i<windowx2+1+(stereopixelwidth<<1); i++) {
                 startumost[i] = 1, startdmost[i] = 0;
             }
-            viewoffset = windowy1*bytesperline+windowx1;
+            viewoffset = windowy1*dukebytesperline+windowx1;
             i = -stereowidth;
         }
         globalposx += mulscale24(singlobalang,i);
@@ -7384,7 +7384,7 @@
 }
 
 
-int initmouse(void)
+int dukeinitmouse(void)
 {
     return(moustat = setupmouse());
 }
@@ -7985,7 +7985,7 @@
         startumost[i] = 1, startdmost[i] = 0;
     }
 
-    viewoffset = windowy1*bytesperline + windowx1;
+    viewoffset = windowy1*dukebytesperline + windowx1;
 
     if (stereomode)
     {
@@ -9053,8 +9053,8 @@
     else
         k = max(bakxsiz[setviewcnt-1],bakxsiz[setviewcnt]);
     j = 0;
-    for(i=0; i<=k; i++) ylookup[i] = j, j += bytesperline;
-    setBytesPerLine(bytesperline);
+    for(i=0; i<=k; i++) ylookup[i] = j, j += dukebytesperline;
+    setBytesPerLine(dukebytesperline);
 }
 
 
--- a/Engine/src/engine.h
+++ b/Engine/src/engine.h
@@ -35,7 +35,7 @@
  *  See build.txt, build2.txt...and anything else with a .txt extention for
  *  information on using these functions that may or may not be accurate. :)
  */
-int initmouse(void);
+int dukeinitmouse(void);
 int setgamemode(int32_t daxdim, int32_t daydim);
 int getceilzofslope(int16_t sectnum, int32_t dax, int32_t day);
 int getflorzofslope(int16_t sectnum, int32_t dax, int32_t day);
--- a/Engine/src/mmulti.c
+++ b/Engine/src/mmulti.c
@@ -1551,6 +1551,7 @@
 static void deinit_network_transport(gcomtype *gcom)
 {
     printf("UDP NETWORK TRANSPORT DEINITIALIZING...\n");
+#ifndef __plan9__
 
     if (gcom != NULL)
     {
@@ -1566,6 +1567,7 @@
         socketclose(udpsocket);
         udpsocket = -1;
     }
+#endif
 
     deinitialize_sockets();
 
--- a/Game/src/mkfile
+++ b/Game/src/mkfile
@@ -3,15 +3,16 @@
 CFLAGS=-Fpw -I/sys/include/npe -I/sys/include/npe/SDL2 -I ../../Engine/src -D__plan9__ -D__${objtype}__
 TARG=games/duke3d
 
+DIRS=\
+	../../Engine/src \
+	audiolib \
+	midi \
+
 LIB=\
 	../../Engine/src/libbuild.a \
 	audiolib/libaudio.a \
 	midi/libmidi.a \
 
-CLEANFILES=\
-	$LIB \
-
-
 OFILES=\
 	actors.$O \
 	animlib.$O \
@@ -70,3 +71,9 @@
 
 midi/libmidi.a:
 	@{cd midi && mk }
+
+clean:V:
+	rm -f *.[$OS] [$OS].out y.tab.? lex.yy.c y.debug y.output $TARG $CLEANFILES
+	for(i in $DIRS)@{
+		cd $i && mk clean
+	}