[gzdoom/zdoom]Intended differences in common code?

Bugs that have been resolved.

Moderator: Graf Zahl

Edward-san
Developer
Developer
Posts: 197
Joined: Sun Nov 29, 2009 16:36

[gzdoom/zdoom]Intended differences in common code?

Post by Edward-san »

I noticed some differences between ZDoom code and GZDoom which don't fall in the trivial 'gl' situation:

Code: Select all

diff -ruZ zdoom/trunk/wadsrc/static/actors/doom/doomarmor.txt zdoom/gzdoom/trunk
/wadsrc/static/actors/doom/doomarmor.txt
--- zdoom/trunk/wadsrc/static/actors/doom/doomarmor.txt 2015-04-01 01:31:13.9075
13596 +0200
+++ zdoom/gzdoom/trunk/wadsrc/static/actors/doom/doomarmor.txt  2014-07-28 12:36:03.052198479 +0200
@@ -8,7 +8,7 @@
        Radius 20
        Height 16
        Inventory.Pickupmessage "$GOTARMBONUS"
-       Inventory.Icon "ARM1A0"
+       Inventory.Icon "BON2A0"
        Armor.Savepercent 33.335
        Armor.Saveamount 1
        Armor.Maxsaveamount 200

Code: Select all

diff -ruZ zdoom/trunk/wadsrc/static/compatibility.txt zdoom/gzdoom/trunk/wadsrc/
static/compatibility.txt
--- zdoom/trunk/wadsrc/static/compatibility.txt 2015-04-01 01:31:13.923513596 +0
200
+++ zdoom/gzdoom/trunk/wadsrc/static/compatibility.txt  2015-04-01 01:20:12.1634
96437 +0200
@@ -395,3 +395,17 @@
 {
        setthingflags 470 2016
 }
+
+712BB4CFBD0753178CA0C6814BE4C288 // map12 BTSX_E1 - patch some rendering glitch
es that are problematic to detect
+{
+       setsectortag 545 32000
+       setsectortag 1618 32000
+       setlinespecial 2853 Sector_Set3DFloor 32000 4 0 0 0
+       setsectortag 439 32001
+       setsectortag 458 32001
+       setlinespecial 2182 Sector_Set3DFloor 32001 4 0 0 0
+       setsectortag 454 32002
+       setsectortag 910 32002
+       setlinespecial 2410 Sector_Set3DFloor 32002 4 1 0 0
+}
+

Code: Select all

diff -ruZ zdoom/trunk/src/cmdlib.cpp zdoom/gzdoom/trunk/src/cmdlib.cpp
--- zdoom/trunk/src/cmdlib.cpp  2015-04-01 01:31:13.843513594 +0200
+++ zdoom/gzdoom/trunk/src/cmdlib.cpp   2014-07-28 12:36:02.940198477 +0200
@@ -957,7 +957,7 @@
        }
 }
 
-#elif defined(__sun) || defined(linux)
+#elif defined(__sun) || defined(__linux__)
 
 //==========================================================================
 //

Code: Select all

diff -ruZ zdoom/trunk/src/stats.h zdoom/gzdoom/trunk/src/stats.h
--- zdoom/trunk/src/stats.h     2015-04-01 01:38:44.515525281 +0200
+++ zdoom/gzdoom/trunk/src/stats.h      2015-01-15 16:48:44.266292052 +0100
@@ -267,6 +267,10 @@
        virtual FString GetStats () = 0;
 
        void ToggleStat ();
+       bool isActive() const
+       {
+               return m_Active;
+       }
 
        static void PrintStat ();
        static FStat *FindStat (const char *name);

Code: Select all

diff -ruZ zdoom/trunk/src/v_video.cpp zdoom/gzdoom/trunk/src/v_video.cpp
--- zdoom/trunk/src/v_video.cpp 2015-04-01 01:31:13.903513596 +0200
+++ zdoom/gzdoom/trunk/src/v_video.cpp  2015-03-15 13:04:42.852596270 +0100
@@ -1245,7 +1245,7 @@
                                        FTextureID pic = frame->Texture[k];
                                        if (pic.isValid())
                                        {
-                                               hitlist[pic.GetIndex()] = 1;
+                                               hitlist[pic.GetIndex()] = 5;
                                        }
                                }
                        }
@@ -1264,7 +1264,7 @@
        {
                hitlist[sides[i].GetTexture(side_t::top).GetIndex()] =
                hitlist[sides[i].GetTexture(side_t::mid).GetIndex()] =
-               hitlist[sides[i].GetTexture(side_t::bottom).GetIndex()] |= 1;
+               hitlist[sides[i].GetTexture(side_t::bottom).GetIndex()] |= 3;
        }
 
        // Sky texture is always present.
@@ -1276,11 +1276,11 @@
 
        if (sky1texture.isValid())
        {
-               hitlist[sky1texture.GetIndex()] |= 1;
+               hitlist[sky1texture.GetIndex()] |= 3;
        }
        if (sky2texture.isValid())
        {
-               hitlist[sky2texture.GetIndex()] |= 1;
+               hitlist[sky2texture.GetIndex()] |= 3;
        }
 }
 

Code: Select all

diff -ruZ zdoom/trunk/src/r_data/r_translate.cpp zdoom/gzdoom/trunk/src/r_data/r
_translate.cpp
--- zdoom/trunk/src/r_data/r_translate.cpp      2015-04-01 01:31:13.883513595 +0
200
+++ zdoom/gzdoom/trunk/src/r_data/r_translate.cpp       2015-01-15 16:48:44.2622
92052 +0100
@@ -824,6 +824,15 @@
                remap->Remap[i] = IcePaletteRemap[v];
                remap->Palette[i] = PalEntry(255, IcePalette[v][0], IcePalette[v
][1], IcePalette[v][2]);
        }
+
+       // The alphatexture translation. Since alphatextures use the red channel
 this is just a standard grayscale mapping.
+       PushIdentityTable(TRANSLATION_Standard);
+       remap = translationtables[TRANSLATION_Standard][8];
+       for (i = 0; i < 256; i++)
+       {
+               remap->Remap[i] = i;
+               remap->Palette[i] = PalEntry(255, i, i, i);
+       }
 }
 
 //----------------------------------------------------------------------------
Are these differences caused by bad merges or are these intentional?


[edit]Regarding the linux one, the correct one should be '__linux__', so zdoom must be changed.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany

Re: [gzdoom/zdoom]Intended differences in common code?

Post by Graf Zahl »

Edward-san wrote:I noticed some differences between ZDoom code and GZDoom which don't fall in the trivial 'gl' situation:
Of course these changes are intentional. Some explanations:

Code: Select all

diff -ruZ zdoom/trunk/wadsrc/static/actors/doom/doomarmor.txt zdoom/gzdoom/trunk
/wadsrc/static/actors/doom/doomarmor.txt
--- zdoom/trunk/wadsrc/static/actors/doom/doomarmor.txt 2015-04-01 01:31:13.9075
13596 +0200
+++ zdoom/gzdoom/trunk/wadsrc/static/actors/doom/doomarmor.txt  2014-07-28 12:36:03.052198479 +0200
@@ -8,7 +8,7 @@
        Radius 20
        Height 16
        Inventory.Pickupmessage "$GOTARMBONUS"
-       Inventory.Icon "ARM1A0"
+       Inventory.Icon "BON2A0"
        Armor.Savepercent 33.335
        Armor.Saveamount 1
        Armor.Maxsaveamount 200
This was done a long time back because I liked the bonus better as an icon. It's n

Code: Select all

diff -ruZ zdoom/trunk/wadsrc/static/compatibility.txt zdoom/gzdoom/trunk/wadsrc/
static/compatibility.txt
--- zdoom/trunk/wadsrc/static/compatibility.txt 2015-04-01 01:31:13.923513596 +0
200
+++ zdoom/gzdoom/trunk/wadsrc/static/compatibility.txt  2015-04-01 01:20:12.1634
96437 +0200
@@ -395,3 +395,17 @@
 {
        setthingflags 470 2016
 }
+
+712BB4CFBD0753178CA0C6814BE4C288 // map12 BTSX_E1 - patch some rendering glitch
es that are problematic to detect
+{
+       setsectortag 545 32000
+       setsectortag 1618 32000
+       setlinespecial 2853 Sector_Set3DFloor 32000 4 0 0 0
+       setsectortag 439 32001
+       setsectortag 458 32001
+       setlinespecial 2182 Sector_Set3DFloor 32001 4 0 0 0
+       setsectortag 454 32002
+       setsectortag 910 32002
+       setlinespecial 2410 Sector_Set3DFloor 32002 4 1 0 0
+}
+
That's hardware renderer specific. Without this compatibility setting the map will exhibit a visual glitch.

Code: Select all

diff -ruZ zdoom/trunk/src/stats.h zdoom/gzdoom/trunk/src/stats.h
--- zdoom/trunk/src/stats.h     2015-04-01 01:38:44.515525281 +0200
+++ zdoom/gzdoom/trunk/src/stats.h      2015-01-15 16:48:44.266292052 +0100
@@ -267,6 +267,10 @@
        virtual FString GetStats () = 0;
 
        void ToggleStat ();
+       bool isActive() const
+       {
+               return m_Active;
+       }
 
        static void PrintStat ();
        static FStat *FindStat (const char *name);
That's needed for some optimization in the renderer. Running timer stats is not a cheap operation so they are disabled when the info is not needed. But to query their state I needed to add this check function.

Code: Select all

diff -ruZ zdoom/trunk/src/v_video.cpp zdoom/gzdoom/trunk/src/v_video.cpp
--- zdoom/trunk/src/v_video.cpp 2015-04-01 01:31:13.903513596 +0200
+++ zdoom/gzdoom/trunk/src/v_video.cpp  2015-03-15 13:04:42.852596270 +0100
@@ -1245,7 +1245,7 @@
                                        FTextureID pic = frame->Texture[k];
                                        if (pic.isValid())
                                        {
-                                               hitlist[pic.GetIndex()] = 1;
+                                               hitlist[pic.GetIndex()] = 5;
                                        }
                                }
                        }
@@ -1264,7 +1264,7 @@
        {
                hitlist[sides[i].GetTexture(side_t::top).GetIndex()] =
                hitlist[sides[i].GetTexture(side_t::mid).GetIndex()] =
-               hitlist[sides[i].GetTexture(side_t::bottom).GetIndex()] |= 1;
+               hitlist[sides[i].GetTexture(side_t::bottom).GetIndex()] |= 3;
        }
 
        // Sky texture is always present.
@@ -1276,11 +1276,11 @@
 
        if (sky1texture.isValid())
        {
-               hitlist[sky1texture.GetIndex()] |= 1;
+               hitlist[sky1texture.GetIndex()] |= 3;
        }
        if (sky2texture.isValid())
        {
-               hitlist[sky2texture.GetIndex()] |= 1;
+               hitlist[sky2texture.GetIndex()] |= 3;
        }
 }
 
Precaching in hardware is a bit different, so this needed a slight change. The reason is that textures for sprites are created a bit differently.
The code as it was was still broken, though, when using the software renderer. Will fix ASAP.

Code: Select all

diff -ruZ zdoom/trunk/src/r_data/r_translate.cpp zdoom/gzdoom/trunk/src/r_data/r
_translate.cpp
--- zdoom/trunk/src/r_data/r_translate.cpp      2015-04-01 01:31:13.883513595 +0
200
+++ zdoom/gzdoom/trunk/src/r_data/r_translate.cpp       2015-01-15 16:48:44.2622
92052 +0100
@@ -824,6 +824,15 @@
                remap->Remap[i] = IcePaletteRemap[v];
                remap->Palette[i] = PalEntry(255, IcePalette[v][0], IcePalette[v
][1], IcePalette[v][2]);
        }
+
+       // The alphatexture translation. Since alphatextures use the red channel
 this is just a standard grayscale mapping.
+       PushIdentityTable(TRANSLATION_Standard);
+       remap = translationtables[TRANSLATION_Standard][8];
+       for (i = 0; i < 256; i++)
+       {
+               remap->Remap[i] = i;
+               remap->Palette[i] = PalEntry(255, i, i, i);
+       }
 }
 
 //----------------------------------------------------------------------------
That additional translation is hardware renderer specific.

Return to “Closed Bugs”