pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

doomlegacy-devel: Add patches for DeePsea tall textures



Module Name:	pkgsrc-wip
Committed By:	Michael Baeuerle <micha%NetBSD.org@localhost>
Pushed By:	micha
Date:		Fri Aug 21 18:11:27 2020 +0200
Changeset:	8fe041acdabca4abdc86993d413b87f0dae7ac1d

Modified Files:
	doomlegacy-devel/TODO
	doomlegacy-devel/distinfo
	doomlegacy-devel/patches/patch-src_dstrings.c
Added Files:
	doomlegacy-devel/patches/patch-src_hardware_hw__cache.c
	doomlegacy-devel/patches/patch-src_r__data.c
	doomlegacy-devel/patches/patch-src_r__things.c
	doomlegacy-devel/patches/patch-src_v__video.c

Log Message:
doomlegacy-devel: Add patches for DeePsea tall textures

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=8fe041acdabca4abdc86993d413b87f0dae7ac1d

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 doomlegacy-devel/TODO                              |  12 ++
 doomlegacy-devel/distinfo                          |   6 +-
 doomlegacy-devel/patches/patch-src_dstrings.c      |   7 +-
 .../patches/patch-src_hardware_hw__cache.c         |  39 +++++
 doomlegacy-devel/patches/patch-src_r__data.c       |  40 +++++
 doomlegacy-devel/patches/patch-src_r__things.c     |  51 +++++++
 doomlegacy-devel/patches/patch-src_v__video.c      | 167 +++++++++++++++++++++
 7 files changed, 318 insertions(+), 4 deletions(-)

diffs:
diff --git a/doomlegacy-devel/TODO b/doomlegacy-devel/TODO
index c48b8f76fd..18597632fc 100644
--- a/doomlegacy-devel/TODO
+++ b/doomlegacy-devel/TODO
@@ -57,4 +57,16 @@ Part 11: Resurrect SunOS codepath
     Should be usable for all POSIX conformant operating systems
 
 
+Part 12: Support for DeePsea tall patches in textures and sprites
+=================================================================
+WAD file for test:
+http://jnechaevsky.users.sourceforge.net/files/512x512.wad
+
+[X] Import general support from Crispy Doom
+[X] Tested to work for sprites with software renderer
+[ ] Make it work for textures with hardware renderer
+    The hardware renderer still has some problems (HOM with specific viewing
+    angles)
+
+
 EOF
diff --git a/doomlegacy-devel/distinfo b/doomlegacy-devel/distinfo
index 49d8167ab6..58efc044dd 100644
--- a/doomlegacy-devel/distinfo
+++ b/doomlegacy-devel/distinfo
@@ -7,10 +7,14 @@ Size (doomlegacy_1.48.4_common.zip) = 1004978 bytes
 SHA1 (patch-src_Makefile) = 40184838a23e00975a5380f18c8c53b3cc2eee47
 SHA1 (patch-src_am__map.c) = 14b3c8b70c63778ad043827ab2f0b6f4fe07bcde
 SHA1 (patch-src_doomdata.h) = 8c3186dafbf11a8a75262a06755dd9807cb58612
-SHA1 (patch-src_dstrings.c) = a654c47792800dc6547f5819ef4f5850803b2ca3
+SHA1 (patch-src_dstrings.c) = 16e50ac649f76d415b820a0e5093d15af3180e6d
+SHA1 (patch-src_hardware_hw__cache.c) = 66788b64c1cb2008a0de9cddd4c8142269633af0
 SHA1 (patch-src_i__tcp.c) = 13c8bd14cae31b078154f4ef0d2353cf089234b8
 SHA1 (patch-src_mserv.c) = 685ca5028740428ef2579025ca8673d8da526ebe
 SHA1 (patch-src_p__local.h) = 0340c38a80ba4323e4fe7a8c314575a70a246708
 SHA1 (patch-src_p__setup.c) = 3690d253d07a772eeab87f658ebc5cb61ecc000c
+SHA1 (patch-src_r__data.c) = cee177a2af8d29c2e78019d17dbd53d256b34529
 SHA1 (patch-src_r__defs.h) = 91e6543674e3474c9afdb0ba19d6869b658d0543
+SHA1 (patch-src_r__things.c) = de1f80d48180783091bd665007a0ea2f4e54af5e
 SHA1 (patch-src_t__prepro.h) = 768fc3a87665a75a85ff4ff88b53091b13eab55e
+SHA1 (patch-src_v__video.c) = e67dd1f89379f57eddc496099da33515ac6ff969
diff --git a/doomlegacy-devel/patches/patch-src_dstrings.c b/doomlegacy-devel/patches/patch-src_dstrings.c
index 7ac27c3e6d..cd20cd9b08 100644
--- a/doomlegacy-devel/patches/patch-src_dstrings.c
+++ b/doomlegacy-devel/patches/patch-src_dstrings.c
@@ -2,9 +2,9 @@ $NetBSD$
 
 Print note that this is a patched version to terminal.
 
---- src/dstrings.c.orig	2020-05-15 09:47:31.000000000 +0000
+--- src/dstrings.c.orig	2020-07-07 09:01:41.000000000 +0000
 +++ src/dstrings.c
-@@ -542,6 +542,11 @@ char *text[NUMTEXT] = {
+@@ -542,6 +542,12 @@ char *text[NUMTEXT] = {
      "get a copy of the original game, call 1-800-IDGAMES or see the readme file.\n"
      "        You will not receive technical support for modified games.\n"
      "                      press enter to continue\n"
@@ -12,7 +12,8 @@ Print note that this is a patched version to terminal.
 +    "===========================================================================\n"
 +    "Note for pkgsrc: This version uses pkgsrc patches for additional features:\n"
 +    "- Support for extended nodes (DeeP V4 and ZDoom, Feature request #95)\n"
-+    "- Support for \"-blockmap\" command line option (create blockmap internally)\n"
++    "- Support for \"-blockmap\" command line option (create blockmap internally,\n"
++    "  Feature request #96)\n"
      "===========================================================================\n",
  
    // SHAREWARE
diff --git a/doomlegacy-devel/patches/patch-src_hardware_hw__cache.c b/doomlegacy-devel/patches/patch-src_hardware_hw__cache.c
new file mode 100644
index 0000000000..6a1eb979f6
--- /dev/null
+++ b/doomlegacy-devel/patches/patch-src_hardware_hw__cache.c
@@ -0,0 +1,39 @@
+$NetBSD$
+
+Support for DeePsea tall patches:
+https://doomwiki.org/wiki/Picture_format#Tall_patches
+
+This patch is for the hardware renderer.
+
+--- src/hardware/hw_cache.c.orig	2020-07-07 09:01:37.000000000 +0000
++++ src/hardware/hw_cache.c
+@@ -219,6 +219,8 @@ void HWR_DrawPatchInCache (Mipmap_t* mip
+ 
+     for (block += col*bytepp; ncols--; block+=bytepp, xfrac+=xfracstep)
+     {
++        int  top = -1;  // [MB] 2020-08-21: Support for DeePsea tall patches
++
+         patchcol = (column_t *)((byte *)sw_patch
+                                 + sw_patch->columnofs[xfrac>>16]);
+ 
+@@ -226,9 +228,19 @@ void HWR_DrawPatchInCache (Mipmap_t* mip
+ 
+         while (patchcol->topdelta != 0xff)
+         {
++            // [MB] 2020-08-21: Support for DeePsea tall patches
++            if (patchcol->topdelta <= top)
++            {
++                top += patchcol->topdelta;
++            }
++            else
++            {
++                top = patchcol->topdelta;
++            }
+             source = (byte *)patchcol + 3;
+             count  = ((patchcol->length * scale_y) + (FRACUNIT/2)) >> 16;
+-            ypos = originy + patchcol->topdelta;
++            ypos = originy + top;
++            //ypos = originy + patchcol->topdelta;
+ 
+             yfrac = 0;
+             //yfracstep = (patchcol->length << 16) / count;
diff --git a/doomlegacy-devel/patches/patch-src_r__data.c b/doomlegacy-devel/patches/patch-src_r__data.c
new file mode 100644
index 0000000000..6da450e5f2
--- /dev/null
+++ b/doomlegacy-devel/patches/patch-src_r__data.c
@@ -0,0 +1,40 @@
+$NetBSD$
+
+Support for DeePsea tall patches in textures.
+
+New code is based on Crispy Doom Git commit:
+c97a5c1d8054eab46856f71e4998d71760aa3339
+
+--- src/r_data.c.orig	2020-07-07 09:01:41.000000000 +0000
++++ src/r_data.c
+@@ -613,6 +613,7 @@ void R_DrawColumnInCache ( column_t*    
+ {
+     int         count;
+     int         position;  // dest
++    int         top = -1;  // [crispy] Support for DeePsea tall patches
+     byte*       source;
+ //    byte*       dest;
+ 
+@@ -622,11 +623,21 @@ void R_DrawColumnInCache ( column_t*    
+     // Column is a series of posts (post_t), terminated by 0xFF
+     while (colpost->topdelta != 0xff)	// end of posts
+     {
++        // [crispy] Support for DeePsea tall patches
++        if (colpost->topdelta <= top)
++        {
++            top += colpost->topdelta;
++        }
++        else
++        {
++            top = colpost->topdelta;
++        }
+         // post has 2 byte header (post_t), 
+         // and has extra byte before and after pixel data
+         source = (byte *)colpost + 3;	// pixel data after post header
+         count = colpost->length;
+-        position = originy + colpost->topdelta;  // position in dest
++        position = originy + top;  // [crispy] Support for DeePsea tall patches
++        //position = originy + colpost->topdelta;  // position in dest
+ 
+         if (position < 0)
+         {
diff --git a/doomlegacy-devel/patches/patch-src_r__things.c b/doomlegacy-devel/patches/patch-src_r__things.c
new file mode 100644
index 0000000000..4f52f01a13
--- /dev/null
+++ b/doomlegacy-devel/patches/patch-src_r__things.c
@@ -0,0 +1,51 @@
+$NetBSD$
+
+Support for DeePsea tall patches in sprites (and masked mid textures):
+https://doomwiki.org/wiki/Picture_format#Tall_patches
+
+New code is based on Crispy Doom Git commit:
+c97a5c1d8054eab46856f71e4998d71760aa3339
+
+--- src/r_things.c.orig	2020-07-07 09:01:40.000000000 +0000
++++ src/r_things.c
+@@ -1094,15 +1094,27 @@ fixed_t         dm_texturemid;
+ void R_DrawMaskedColumn ( byte * column_data )
+ {
+     fixed_t     top_post_sc, bottom_post_sc;  // fixed_t screen coord.
++    int         top = -1;  // [crispy] Support for DeePsea tall patches
+ 
+     column_t * column = (column_t*) column_data;
+    
+     // over all column posts for this column
+     for ( ; column->topdelta != 0xff ; )
+     {
++        // [crispy] Support for DeePsea tall patches
++        if (column->topdelta <= top)
++        {
++            top += column->topdelta;
++        }
++        else
++        {
++            top = column->topdelta;
++        }
+         // calculate unclipped screen coordinates
+         //  for post
+-        top_post_sc = dm_top_patch + dm_yscale*column->topdelta;
++        // [crispy] Support for DeePsea tall patches
++        top_post_sc = dm_top_patch + dm_yscale*top;
++        //top_post_sc = dm_top_patch + dm_yscale*column->topdelta;
+         bottom_post_sc = (dm_bottom_patch == FIXED_MAX) ?
+             top_post_sc + dm_yscale*column->length
+             : dm_bottom_patch + dm_yscale*column->length;
+@@ -1151,7 +1163,10 @@ void R_DrawMaskedColumn ( byte * column_
+ #endif
+ 
+             dc_source = (byte *)column + 3;
+-            dc_texturemid = dm_texturemid - (column->topdelta<<FRACBITS);
++            // [crispy] Support for DeePsea tall patches
++            dc_texturemid = dm_texturemid - (top<<FRACBITS);
++            // dc_source = (byte *)column + 3 - top;
++            // dc_texturemid = dm_texturemid - (column->topdelta<<FRACBITS);
+             // dc_source = (byte *)column + 3 - column->topdelta;
+             fog_col_length = column->length;
+ 
diff --git a/doomlegacy-devel/patches/patch-src_v__video.c b/doomlegacy-devel/patches/patch-src_v__video.c
new file mode 100644
index 0000000000..7a21d438b8
--- /dev/null
+++ b/doomlegacy-devel/patches/patch-src_v__video.c
@@ -0,0 +1,167 @@
+$NetBSD$
+
+Support for DeePsea tall patches:
+https://doomwiki.org/wiki/Picture_format#Tall_patches
+
+This patch is for the software renderer.
+
+--- src/v_video.c.orig	2020-07-07 09:01:36.000000000 +0000
++++ src/v_video.c
+@@ -1422,12 +1422,24 @@ void V_DrawMappedPatch(int x, int y, pat
+ 
+     for (col=0; col < wf; col += drawinfo.x_unitfrac)
+     {
++        int  top = -1;  // [MB] 2020-08-21: Support for DeePsea tall patches
++
+         column = (column_t *) ((byte *) patch + patch->columnofs[col >> FRACBITS]);
+ 
+         while (column->topdelta != 0xff)
+         {
++            // [MB] 2020-08-21: Support for DeePsea tall patches
++            if (column->topdelta <= top)
++            {
++                top += column->topdelta;
++            }
++            else
++            {
++                top = column->topdelta;
++            }
+             source = (byte *) column + 3;
+-            dest = desttop + (column->topdelta * drawinfo.ybytes);
++            dest = desttop + (top * drawinfo.ybytes);
++            //dest = desttop + (column->topdelta * drawinfo.ybytes);
+             count = column->length * drawinfo.dupy;
+ 
+             ofs = 0;
+@@ -1511,12 +1523,24 @@ void V_DrawMappedPatch_Box(int x, int y,
+ 
+     for ( ; col < wf; col += drawinfo.x_unitfrac)
+     {
++        int  top = -1;  // [MB] 2020-08-21: Support for DeePsea tall patches
++
+         column = (column_t *) ((byte *) patch + patch->columnofs[col >> FRACBITS]);
+ 
+         while (column->topdelta != 0xff)
+         {
++            // [MB] 2020-08-21: Support for DeePsea tall patches
++            if (column->topdelta <= top)
++            {
++                top += column->topdelta;
++            }
++            else
++            {
++                top = column->topdelta;
++            }
+             source = (byte *) column + 3;
+-            draw_y = draw_y1 + (column->topdelta * drawinfo.ybytes);
++            draw_y = draw_y1 + (top * drawinfo.ybytes);
++            //draw_y = draw_y1 + (column->topdelta * drawinfo.ybytes);
+             count = column->length * drawinfo.dupy;
+             column = (column_t *) ((byte *) column + column->length + 4);  // next column in patch
+             ofs = 0;
+@@ -1661,13 +1685,25 @@ void V_DrawScaledPatch(int x, int y, pat
+ 
+     while( desttop < destend )
+     {
++        int  top = -1;  // [MB] 2020-08-21: Support for DeePsea tall patches
++
+         column = (column_t *) ((byte *) patch + patch->columnofs[col >> FRACBITS]);
+         col += colfrac;
+ 
+         while (column->topdelta != 0xff)
+         {
++            // [MB] 2020-08-21: Support for DeePsea tall patches
++            if (column->topdelta <= top)
++            {
++                top += column->topdelta;
++            }
++            else
++            {
++                top = column->topdelta;
++            }
+             source = (byte *) column + 3;
+-            dest = desttop + (column->topdelta * drawinfo.ybytes);
++            dest = desttop + (top * drawinfo.ybytes);
++            //dest = desttop + (column->topdelta * drawinfo.ybytes);
+             count = column->length * drawinfo.dupy;
+ 
+             ofs = 0;
+@@ -1794,12 +1830,24 @@ void V_DrawSmallScaledPatch(int x, int y
+     // [WDJ] Use same loop for normal and skippixels, with some predefined inc
+     for (  ; desttop < destend; desttop+=vid.bytepp)
+     {
++        int  top = -1;  // [MB] 2020-08-21: Support for DeePsea tall patches
++
+         column = (column_t *) ((byte *) patch + patch->columnofs[col >> FRACBITS]);
+         col += colfrac_inc;
+         while (column->topdelta != 0xff)
+         {
++            // [MB] 2020-08-21: Support for DeePsea tall patches
++            if (column->topdelta <= top)
++            {
++                top += column->topdelta;
++            }
++            else
++            {
++                top = column->topdelta;
++            }
+             source = (byte *) column + 3;
+-            dest = desttop + (column->topdelta * dup_ybytes);
++            dest = desttop + (top * dup_ybytes);
++            //dest = desttop + (column->topdelta * dup_ybytes);
+             count = (column->length * count_dupy) >> 1;  // dupy or dupy/2
+             ofs = 0;
+             while (count--)
+@@ -1860,12 +1908,24 @@ void V_DrawTranslucentPatch(int x, int y
+ 
+     for ( col=0; col < wf; col += drawinfo.x_unitfrac)
+     {
++        int  top = -1;  // [MB] 2020-08-21: Support for DeePsea tall patches
++
+         column = (column_t *) ((byte *) patch + patch->columnofs[col >> FRACBITS]);
+ 
+         while (column->topdelta != 0xff)
+         {
++            // [MB] 2020-08-21: Support for DeePsea tall patches
++            if (column->topdelta <= top)
++            {
++                top += column->topdelta;
++            }
++            else
++            {
++                top = column->topdelta;
++            }
+             source = (byte *) column + 3;
+-            dest = desttop + (column->topdelta * drawinfo.ybytes);
++            dest = desttop + (top * drawinfo.ybytes);
++            //dest = desttop + (column->topdelta * drawinfo.ybytes);
+             count = column->length * drawinfo.dupy;
+ 
+             ofs = 0;
+@@ -1992,13 +2052,25 @@ void V_DrawPatch(int x, int y, int scrn,
+ 
+     for ( col=0; col < wi; col++)
+     {
++        int  top = -1;  // [MB] 2020-08-21: Support for DeePsea tall patches
++
+         column = (column_t *) ((byte *) patch + patch->columnofs[col]);
+ 
+         // step through the posts in a column
+         while (column->topdelta != 0xff)
+         {
++            // [MB] 2020-08-21: Support for DeePsea tall patches
++            if (column->topdelta <= top)
++            {
++                top += column->topdelta;
++            }
++            else
++            {
++                top = column->topdelta;
++            }
+             source = (byte *) column + 3;
+-            dest = desttop + (column->topdelta * vid.ybytes);
++            dest = desttop + (top * vid.ybytes);
++            //dest = desttop + (column->topdelta * vid.ybytes);
+             count = column->length;
+ 
+             while (count--)


Home | Main Index | Thread Index | Old Index