From 8c052818b7acdc428a590a0c0cd8922d5c7aeb94 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 14 May 2014 10:27:40 +0200 Subject: [PATCH 1/9] - fixed: long texture name lookup did not work with TEXMAN_TryAny. --- src/textures/texturemanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/textures/texturemanager.cpp b/src/textures/texturemanager.cpp index 0af15d7af5..9ff67803d7 100644 --- a/src/textures/texturemanager.cpp +++ b/src/textures/texturemanager.cpp @@ -220,8 +220,8 @@ FTextureID FTextureManager::CheckForTexture (const char *name, int usetype, BITF { if (firsttype == FTexture::TEX_Null) return FTextureID(0); if (firsttype == FTexture::TEX_FirstDefined && !(flags & TEXMAN_ReturnFirst)) return FTextureID(0); + return FTextureID(firstfound); } - return FTextureID(firstfound); } From 47a9dab56d74fe021f454bccec91e57715f6db94 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 14 May 2014 12:16:33 +0200 Subject: [PATCH 2/9] - allow setting sector planes' plane equations directly from UDMF. --- specs/udmf_zdoom.txt | 14 +++++++++- src/namedef.h | 9 ++++++ src/p_udmf.cpp | 65 ++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 81 insertions(+), 7 deletions(-) diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index d7face6720..1128b2e55d 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -37,7 +37,7 @@ In addition to the base specification ZDoom recognizes the following lumps between the TEXTMAP and ENDMAP lumps: BEHAVIOR = contains compiled ACS code - DIALOGUE = contains compiled Strife conversation scripts. + DIALOGUE = contains compiled Strife or USDF conversation scripts. ZNODES = Nodes (must be stored as extended GL nodes. Compression is allowed but deprecated for portability reasons.) BLOCKMAP = blockmap. It is recommended not to include this lump in UDMF maps. @@ -166,6 +166,14 @@ Note: All fields default to false unless mentioned otherwise. yscaleceiling = ; // Y texture scale of ceiling texture, Default = 1.0. rotationfloor = ; // Rotation of floor texture in degrees, Default = 0.0. rotationceiling = ; // Rotation of ceiling texture in degrees, Default = 0.0. + ceilingplane_a = ; // Define the plane equation for the sector's ceiling. Default is a horizontal plane at 'heightceiling'. + ceilingplane_b = ; // 'heightceiling' will still be used to calculate texture alignment. + ceilingplane_c = ; // The plane equation will only be used if all 4 values are given. + ceilingplane_d = ; + floorplane_a = ; // Define the plane equation for the sector's floor. Default is a horizontal plane at 'heightfloor'. + floorplane_b = ; // 'heightfloor' will still be used to calculate texture alignment. + floorplane_c = ; // The plane equation will only be used if all 4 values are given. + floorplane_d = ; lightfloor = ; // The floor's light level. Default is 0. lightceiling = ; // The ceiling's light level. Default is 0. lightfloorabsolute = ; // true = 'lightfloor' is an absolute value. Default is @@ -355,6 +363,10 @@ Added waterzone sector property. 1.22 12.04.2014 Added transparent line property (to be folded back to core UDMF standard), and health, score, renderstyle, fillcolor, alpha, scale, scalex, scaley, pitch and roll thing properties. +1.24 14.05.2014 +Added plane equations for sector slopes. (Please read carefully to ensure proper use!) +Changed language describing the DIALOGUE lump to mention USDF as an option. + =============================================================================== EOF =============================================================================== diff --git a/src/namedef.h b/src/namedef.h index ba6de104d5..a4c8da6388 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -488,6 +488,15 @@ xx(blockhitscan) xx(Renderstyle) +xx(ceilingplane_a) +xx(ceilingplane_b) +xx(ceilingplane_c) +xx(ceilingplane_d) +xx(floorplane_a) +xx(floorplane_b) +xx(floorplane_c) +xx(floorplane_d) + // USDF keywords xx(Amount) xx(Text) diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 2fa9685026..0c380160d5 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -1245,6 +1245,7 @@ public: int lightcolor = -1; int fadecolor = -1; int desaturation = -1; + int fplaneflags = 0, cplaneflags = 0; memset(sec, 0, sizeof(*sec)); sec->lightlevel = 160; @@ -1446,6 +1447,48 @@ public: Flag(sec->MoreFlags, SECF_UNDERWATER, key); break; + case NAME_floorplane_a: + fplaneflags |= 1; + sec->floorplane.a = CheckFixed(key); + break; + + case NAME_floorplane_b: + fplaneflags |= 2; + sec->floorplane.b = CheckFixed(key); + break; + + case NAME_floorplane_c: + fplaneflags |= 4; + sec->floorplane.c = CheckFixed(key); + sec->floorplane.ic = FixedDiv(FRACUNIT, sec->floorplane.c); + break; + + case NAME_floorplane_d: + fplaneflags |= 8; + sec->floorplane.d = CheckFixed(key); + break; + + case NAME_ceilingplane_a: + cplaneflags |= 1; + sec->ceilingplane.a = CheckFixed(key); + break; + + case NAME_ceilingplane_b: + cplaneflags |= 2; + sec->ceilingplane.b = CheckFixed(key); + break; + + case NAME_ceilingplane_c: + cplaneflags |= 4; + sec->ceilingplane.c = CheckFixed(key); + sec->ceilingplane.ic = FixedDiv(FRACUNIT, sec->ceilingplane.c); + break; + + case NAME_ceilingplane_d: + cplaneflags |= 8; + sec->ceilingplane.d = CheckFixed(key); + break; + default: break; } @@ -1457,12 +1500,22 @@ public: } sec->secretsector = !!(sec->special&SECRET_MASK); - sec->floorplane.d = -sec->GetPlaneTexZ(sector_t::floor); - sec->floorplane.c = FRACUNIT; - sec->floorplane.ic = FRACUNIT; - sec->ceilingplane.d = sec->GetPlaneTexZ(sector_t::ceiling); - sec->ceilingplane.c = -FRACUNIT; - sec->ceilingplane.ic = -FRACUNIT; + + // Reset the planes to their defaults if not all of the plane equation's parameters were found. + if (fplaneflags != 15) + { + sec->floorplane.a = sec->floorplane.b = 0; + sec->floorplane.d = -sec->GetPlaneTexZ(sector_t::floor); + sec->floorplane.c = FRACUNIT; + sec->floorplane.ic = FRACUNIT; + } + if (cplaneflags != 15) + { + sec->ceilingplane.a = sec->ceilingplane.b = 0; + sec->ceilingplane.d = sec->GetPlaneTexZ(sector_t::ceiling); + sec->ceilingplane.c = -FRACUNIT; + sec->ceilingplane.ic = -FRACUNIT; + } if (lightcolor == -1 && fadecolor == -1 && desaturation == -1) { From 388f09f786d5ab3927d3bb6d76895b043a18bdb6 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 14 May 2014 12:54:03 +0200 Subject: [PATCH 3/9] - fixed: In Heretic corpses do not get crunched to gibs, they just get their size reduced to 0. Handled by a new gameinfo flag. This also gets set for Chex quest which has the gib sprite replaced by something different. Using a Crush state will override this global flag. --- src/gi.cpp | 1 + src/gi.h | 1 + src/p_mobj.cpp | 10 ++++++++++ wadsrc/static/mapinfo/chex.txt | 1 + wadsrc/static/mapinfo/heretic.txt | 1 + 5 files changed, 14 insertions(+) diff --git a/src/gi.cpp b/src/gi.cpp index 8ab9358544..4e64dd4256 100644 --- a/src/gi.cpp +++ b/src/gi.cpp @@ -323,6 +323,7 @@ void FMapInfoParser::ParseGameInfo() GAMEINFOKEY_BOOL(noloopfinalemusic, "noloopfinalemusic") GAMEINFOKEY_BOOL(drawreadthis, "drawreadthis") GAMEINFOKEY_BOOL(swapmenu, "swapmenu") + GAMEINFOKEY_BOOL(dontcrunchcorpses, "dontcrunchcorpses") GAMEINFOKEY_BOOL(intermissioncounter, "intermissioncounter") GAMEINFOKEY_BOOL(nightmarefast, "nightmarefast") GAMEINFOKEY_COLOR(dimcolor, "dimcolor") diff --git a/src/gi.h b/src/gi.h index a1a03b2dee..bbfbe73ff6 100644 --- a/src/gi.h +++ b/src/gi.h @@ -113,6 +113,7 @@ struct gameinfo_t bool intermissioncounter; bool nightmarefast; bool swapmenu; + bool dontcrunchcorpses; TArray creditPages; TArray finalePages; TArray infoPages; diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index c6a7fd35c4..72679ef719 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -1010,6 +1010,16 @@ bool AActor::Grind(bool items) if ((flags & MF_CORPSE) && !(flags3 & MF3_DONTGIB) && (health <= 0)) { FState * state = FindState(NAME_Crush); + + // In Heretic and Chex Quest we don't change the actor's sprite, just its size. + if (state == NULL && gameinfo.dontcrunchcorpses) + { + flags &= ~MF_SOLID; + flags3 |= MF3_DONTGIB; + height = radius = 0; + return false; + } + bool isgeneric = false; // ZDoom behavior differs from standard as crushed corpses cannot be raised. // The reason for the change was originally because of a problem with players, diff --git a/wadsrc/static/mapinfo/chex.txt b/wadsrc/static/mapinfo/chex.txt index edc5b4f293..e29eeeb4de 100644 --- a/wadsrc/static/mapinfo/chex.txt +++ b/wadsrc/static/mapinfo/chex.txt @@ -40,6 +40,7 @@ gameinfo definventorymaxamount = 25 defaultrespawntime = 12 defaultdropstyle = 1 + dontcrunchcorpses = 1 endoom = "ENDOOM" player5start = 4001 drawreadthis = true diff --git a/wadsrc/static/mapinfo/heretic.txt b/wadsrc/static/mapinfo/heretic.txt index 196e81c502..d372466f5b 100644 --- a/wadsrc/static/mapinfo/heretic.txt +++ b/wadsrc/static/mapinfo/heretic.txt @@ -56,6 +56,7 @@ gameinfo nightmarefast = true pausesign = "PAUSED" gibfactor = 0.5 + dontcrunchcorpses = true cursorpic = "herecurs" textscreenx = 20 textscreeny = 5 From 51ed68dc7243cf00c285526a8009a2fa2d4c427d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 14 May 2014 13:02:04 +0200 Subject: [PATCH 4/9] - forgot to save this... --- wadsrc/static/mapinfo/chex.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wadsrc/static/mapinfo/chex.txt b/wadsrc/static/mapinfo/chex.txt index e29eeeb4de..1edaf92564 100644 --- a/wadsrc/static/mapinfo/chex.txt +++ b/wadsrc/static/mapinfo/chex.txt @@ -40,7 +40,7 @@ gameinfo definventorymaxamount = 25 defaultrespawntime = 12 defaultdropstyle = 1 - dontcrunchcorpses = 1 + dontcrunchcorpses = true endoom = "ENDOOM" player5start = 4001 drawreadthis = true From 85fb8c4326a0f5ca010f0495275d04ccd4d8860e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 14 May 2014 13:04:47 +0200 Subject: [PATCH 5/9] - fixed: _M_X64 macro was misnamed _M_IX64. --- src/nodebuild.h | 2 +- src/x86.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nodebuild.h b/src/nodebuild.h index 81c7b13453..ce68c4682f 100644 --- a/src/nodebuild.h +++ b/src/nodebuild.h @@ -347,7 +347,7 @@ inline int FNodeBuilder::ClassifyLine (node_t &node, const FPrivVert *v1, const #ifdef DISABLE_SSE return ClassifyLine2 (node, v1, v2, sidev); #else -#if defined(__SSE2__) || defined(_M_IX64) +#if defined(__SSE2__) || defined(_M_X64) // If compiling with SSE2 support everywhere, just use the SSE2 version. return ClassifyLineSSE2 (node, v1, v2, sidev); #elif defined(_MSC_VER) && _MSC_VER < 1300 diff --git a/src/x86.cpp b/src/x86.cpp index ec36aae935..89d88333d2 100644 --- a/src/x86.cpp +++ b/src/x86.cpp @@ -299,7 +299,7 @@ void DoBlending_SSE2(const PalEntry *from, PalEntry *to, int count, int r, int g } #endif -#if defined(__amd64__) || defined(_M_IX64) +#if defined(__amd64__) || defined(_M_X64) long long color; blending256 = _mm_set_epi64x(0x10001000100ll, 0x10001000100ll); From 802a47876602251c9c7ec6bd7f63da21c3d24165 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 14 May 2014 14:03:15 +0200 Subject: [PATCH 6/9] - Heretic doesn't really need dontcrunchcorpses because there was already some alternative handling for that situation. --- wadsrc/static/mapinfo/heretic.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/wadsrc/static/mapinfo/heretic.txt b/wadsrc/static/mapinfo/heretic.txt index d372466f5b..196e81c502 100644 --- a/wadsrc/static/mapinfo/heretic.txt +++ b/wadsrc/static/mapinfo/heretic.txt @@ -56,7 +56,6 @@ gameinfo nightmarefast = true pausesign = "PAUSED" gibfactor = 0.5 - dontcrunchcorpses = true cursorpic = "herecurs" textscreenx = 20 textscreeny = 5 From 2944e4f6ae8601ca567baafbe9b6e80daae138a3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 14 May 2014 14:08:14 +0200 Subject: [PATCH 7/9] - fixed some Linux issues with recent changes. --- src/sdl/i_main.cpp | 6 +----- src/textures/texturemanager.cpp | 2 +- src/wi_stuff.cpp | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/sdl/i_main.cpp b/src/sdl/i_main.cpp index 1736305d84..db6979330c 100644 --- a/src/sdl/i_main.cpp +++ b/src/sdl/i_main.cpp @@ -172,11 +172,7 @@ static int DoomSpecificInfo (char *buffer, char *end) } else { - char name[9]; - - strncpy (name, level.mapname, 8); - name[8] = 0; - p += snprintf (buffer+p, size-p, "\n\nCurrent map: %s", name); + p += snprintf (buffer+p, size-p, "\n\nCurrent map: %s", level.MapName); if (!viewactive) { diff --git a/src/textures/texturemanager.cpp b/src/textures/texturemanager.cpp index 9ff67803d7..aa9ef706b9 100644 --- a/src/textures/texturemanager.cpp +++ b/src/textures/texturemanager.cpp @@ -233,7 +233,7 @@ FTextureID FTextureManager::CheckForTexture (const char *name, int usetype, BITF { FTexture *const NO_TEXTURE = (FTexture*)-1; int lump = Wads.CheckNumForFullName(name); - if (lump != NULL) + if (lump >= 0) { FTexture *tex = Wads.GetLinkedTexture(lump); if (tex == NO_TEXTURE) return FTextureID(-1); diff --git a/src/wi_stuff.cpp b/src/wi_stuff.cpp index 0cf5e7b77e..982668566c 100644 --- a/src/wi_stuff.cpp +++ b/src/wi_stuff.cpp @@ -314,7 +314,7 @@ static bool IsExMy(const char * name) void WI_LoadBackground(bool isenterpic) { - const char *lumpname; + const char *lumpname = NULL; char buffer[10]; in_anim_t an; lnode_t pt; From adcdc11360c9672105c9c8fabb989247d1f2cd40 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 14 May 2014 15:44:05 +0200 Subject: [PATCH 8/9] - GCC compile fix. --- src/sdl/i_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdl/i_main.cpp b/src/sdl/i_main.cpp index db6979330c..3c721ae510 100644 --- a/src/sdl/i_main.cpp +++ b/src/sdl/i_main.cpp @@ -172,7 +172,7 @@ static int DoomSpecificInfo (char *buffer, char *end) } else { - p += snprintf (buffer+p, size-p, "\n\nCurrent map: %s", level.MapName); + p += snprintf (buffer+p, size-p, "\n\nCurrent map: %s", level.MapName.GetChars()); if (!viewactive) { From e3cd144af9692192accb853691a6ccf4a6d5ae2d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 14 May 2014 17:27:22 +0200 Subject: [PATCH 9/9] - one last GCC compile problem. --- src/g_mapinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_mapinfo.cpp b/src/g_mapinfo.cpp index 874a659c6d..7203fdb51e 100644 --- a/src/g_mapinfo.cpp +++ b/src/g_mapinfo.cpp @@ -302,7 +302,7 @@ FString level_info_t::LookupLevelName() // Strip out the header from the localized string if (MapName.Len() > 3 && MapName[0] == 'E' && MapName[2] == 'M') { - mysnprintf (checkstring, countof(checkstring), "%s: ", MapName); + mysnprintf (checkstring, countof(checkstring), "%s: ", MapName.GetChars()); } else if (MapName.Len() > 3 && MapName[0] == 'M' && MapName[1] == 'A' && MapName[2] == 'P') {