From 888e91b51b82cf59de98545d24de0c05416b8693 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Mon, 18 Mar 2019 05:53:54 -0400 Subject: [PATCH] - fixing botched past merges, this should fix compile errors --- src/d_main.cpp | 2 +- src/gamedata/d_dehacked.cpp | 5 ++++- src/p_map.cpp | 2 ++ src/rendering/swrenderer/plane/r_flatplane.cpp | 10 +++++++++- src/rendering/swrenderer/viewport/r_viewport.cpp | 4 ++++ src/version.h | 7 +------ wadsrc/static/zscript/actors/doom/weaponfist.zs | 2 +- wadsrc/static/zscript/actors/hexen/clericmace.zs | 4 ++-- wadsrc/static/zscript/actors/hexen/fighteraxe.zs | 4 ++-- wadsrc/static/zscript/actors/hexen/fighterfist.zs | 4 ++-- 10 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 81ce4b8a3..6cc176a3b 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -790,7 +790,7 @@ void D_Display () screen->DrawBlend(viewsec); if (automapactive) { - primaryLevel->automap->Drawer ((hud_althud && viewheight == SCREENHEIGHT) ? viewheight : StatusBar->GetTopOfStatusbar()); + primaryLevel->automap->Drawer (hud_althud? viewheight : StatusBar->GetTopOfStatusbar()); } // for timing the statusbar code. diff --git a/src/gamedata/d_dehacked.cpp b/src/gamedata/d_dehacked.cpp index de7037fd5..c7105117d 100644 --- a/src/gamedata/d_dehacked.cpp +++ b/src/gamedata/d_dehacked.cpp @@ -2120,12 +2120,15 @@ static int PatchCodePtrs (int dummy) symname.Format("A_%s", Line2); // Let's consider as aliases some redundant MBF pointer + bool ismbfcp = false; for (unsigned int i = 0; i < MBFCodePointers.Size(); i++) { if (!symname.CompareNoCase(MBFCodePointers[i].alias)) { symname = MBFCodePointers[i].name; DPrintf(DMSG_SPAMMY, "%s --> %s\n", MBFCodePointers[i].alias, MBFCodePointers[i].name.GetChars()); + ismbfcp = true; + break; } } @@ -2136,7 +2139,7 @@ static int PatchCodePtrs (int dummy) { Printf(TEXTCOLOR_RED "Frame %d: Unknown code pointer '%s'\n", frame, Line2); } - else + else if (!ismbfcp) // MBF special code pointers will produce errors here because they will receive some args and won't match the conditions here. { TArray &args = sym->Variants[0].ArgFlags; unsigned numargs = sym->GetImplicitArgs(); diff --git a/src/p_map.cpp b/src/p_map.cpp index a258ad4de..6b7888674 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -4147,6 +4147,7 @@ struct aim_t thingtoppitch = -VecToAngle(exitdist, th->Top() - shootz); if (thingtoppitch > bottompitch) continue; } + else continue; // shot over the thing } else continue; // shot over the thing } @@ -4165,6 +4166,7 @@ struct aim_t thingbottompitch = -VecToAngle(exitdist, th->Z() - shootz); if (thingbottompitch < toppitch) continue; } + else continue; // shot over the thing } continue; // shot under the thing } diff --git a/src/rendering/swrenderer/plane/r_flatplane.cpp b/src/rendering/swrenderer/plane/r_flatplane.cpp index 1d3e15526..278fe3e14 100644 --- a/src/rendering/swrenderer/plane/r_flatplane.cpp +++ b/src/rendering/swrenderer/plane/r_flatplane.cpp @@ -191,13 +191,21 @@ namespace swrenderer if (r_dynlights) { + int tx = x1; + bool mirror = !!(Thread->Portal->MirrorFlags & RF_XFLIP); + if (mirror) + tx = viewwidth - tx - 1; + // Find row position in view space float zspan = (float)(planeheight / (fabs(y + 0.5 - viewport->CenterY) / viewport->InvZtoScale)); - drawerargs.dc_viewpos.X = (float)((x1 + 0.5 - viewport->CenterX) / viewport->CenterX * zspan); + drawerargs.dc_viewpos.X = (float)((tx + 0.5 - viewport->CenterX) / viewport->CenterX * zspan); drawerargs.dc_viewpos.Y = zspan; drawerargs.dc_viewpos.Z = (float)((viewport->CenterY - y - 0.5) / viewport->InvZtoScale * zspan); drawerargs.dc_viewpos_step.X = (float)(zspan / viewport->CenterX); + if (mirror) + drawerargs.dc_viewpos_step.X = -drawerargs.dc_viewpos_step.X; + // Plane normal drawerargs.dc_normal.X = 0.0f; drawerargs.dc_normal.Y = 0.0f; diff --git a/src/rendering/swrenderer/viewport/r_viewport.cpp b/src/rendering/swrenderer/viewport/r_viewport.cpp index 09b9a48c7..7b72543c9 100644 --- a/src/rendering/swrenderer/viewport/r_viewport.cpp +++ b/src/rendering/swrenderer/viewport/r_viewport.cpp @@ -62,6 +62,10 @@ namespace swrenderer void RenderViewport::SetupPolyViewport(RenderThread *thread) { WorldToView = SoftwareWorldToView(viewpoint); + + if (thread->Portal->MirrorFlags & RF_XFLIP) + WorldToView = Mat4f::Scale(-1.0f, 1.0f, 1.0f) * WorldToView; + ViewToClip = SoftwareViewToClip(); WorldToClip = ViewToClip * WorldToView; } diff --git a/src/version.h b/src/version.h index e92f6444d..fa17555f4 100644 --- a/src/version.h +++ b/src/version.h @@ -96,14 +96,9 @@ const char *GetVersionString(); #define OPTIONALWAD "zd_extra.pk3" // More stuff that needs to be different for derivatives. -<<<<<<< HEAD #define GAMENAME "QZDoom" +#define WGAMENAME L"QZDoom" #define GAMENAMELOWERCASE "qzdoom" -======= -#define GAMENAME "GZDoom" -#define WGAMENAME L"GZDoom" -#define GAMENAMELOWERCASE "gzdoom" ->>>>>>> 86a4aea6503864509a80f65fff5ae52df11abd0a #define FORUM_URL "http://forum.zdoom.org/" #define BUGS_FORUM_URL "http://forum.zdoom.org/viewforum.php?f=2" diff --git a/wadsrc/static/zscript/actors/doom/weaponfist.zs b/wadsrc/static/zscript/actors/doom/weaponfist.zs index 6f106e14a..ae0eedddc 100644 --- a/wadsrc/static/zscript/actors/doom/weaponfist.zs +++ b/wadsrc/static/zscript/actors/doom/weaponfist.zs @@ -65,7 +65,7 @@ extend class Actor damage *= 10; double ang = angle + Random2[Punch]() * (5.625 / 256); - double pitch = AimLineAttack (ang, DEFMELEERANGE); + double pitch = AimLineAttack (ang, DEFMELEERANGE, null, 0., ALF_CHECK3D); LineAttack (ang, DEFMELEERANGE, pitch, damage, 'Melee', "BulletPuff", LAF_ISMELEEATTACK, t); diff --git a/wadsrc/static/zscript/actors/hexen/clericmace.zs b/wadsrc/static/zscript/actors/hexen/clericmace.zs index de188ae2f..7e202571a 100644 --- a/wadsrc/static/zscript/actors/hexen/clericmace.zs +++ b/wadsrc/static/zscript/actors/hexen/clericmace.zs @@ -66,7 +66,7 @@ class CWeapMace : ClericWeapon for (int j = 1; j >= -1; j -= 2) { double ang = angle + j*i*(45. / 16); - double slope = AimLineAttack(ang, 2 * DEFMELEERANGE, t); + double slope = AimLineAttack(ang, 2 * DEFMELEERANGE, t, 0., ALF_CHECK3D); if (t.linetarget) { LineAttack(ang, 2 * DEFMELEERANGE, slope, damage, 'Melee', "HammerPuff", true, t); @@ -81,7 +81,7 @@ class CWeapMace : ClericWeapon // didn't find any creatures, so try to strike any walls weaponspecial = 0; - double slope = AimLineAttack (angle, DEFMELEERANGE); + double slope = AimLineAttack (angle, DEFMELEERANGE, null, 0., ALF_CHECK3D); LineAttack (angle, DEFMELEERANGE, slope, damage, 'Melee', "HammerPuff"); } } diff --git a/wadsrc/static/zscript/actors/hexen/fighteraxe.zs b/wadsrc/static/zscript/actors/hexen/fighteraxe.zs index 5351f2789..8217d87e9 100644 --- a/wadsrc/static/zscript/actors/hexen/fighteraxe.zs +++ b/wadsrc/static/zscript/actors/hexen/fighteraxe.zs @@ -245,7 +245,7 @@ class FWeapAxe : FighterWeapon for (int j = 1; j >= -1; j -= 2) { double ang = angle + j*i*(45. / 16); - double slope = AimLineAttack(ang, AXERANGE, t); + double slope = AimLineAttack(ang, AXERANGE, t, 0., ALF_CHECK3D); if (t.linetarget) { LineAttack(ang, AXERANGE, slope, damage, 'Melee', pufftype, true, t); @@ -273,7 +273,7 @@ class FWeapAxe : FighterWeapon // didn't find any creatures, so try to strike any walls self.weaponspecial = 0; - double slope = AimLineAttack (angle, DEFMELEERANGE); + double slope = AimLineAttack (angle, DEFMELEERANGE, null, 0., ALF_CHECK3D); LineAttack (angle, DEFMELEERANGE, slope, damage, 'Melee', pufftype, true); } } diff --git a/wadsrc/static/zscript/actors/hexen/fighterfist.zs b/wadsrc/static/zscript/actors/hexen/fighterfist.zs index 5ee7e22c4..7d0e9b94a 100644 --- a/wadsrc/static/zscript/actors/hexen/fighterfist.zs +++ b/wadsrc/static/zscript/actors/hexen/fighterfist.zs @@ -56,7 +56,7 @@ class FWeapFist : FighterWeapon Class pufftype; FTranslatedLineTarget t; - double slope = AimLineAttack (angle, 2*DEFMELEERANGE, t); + double slope = AimLineAttack (angle, 2*DEFMELEERANGE, t, 0., ALF_CHECK3D); if (t.linetarget != null) { if (++weaponspecial >= 3) @@ -117,7 +117,7 @@ class FWeapFist : FighterWeapon // didn't find any creatures, so try to strike any walls weaponspecial = 0; - double slope = AimLineAttack (angle, DEFMELEERANGE); + double slope = AimLineAttack (angle, DEFMELEERANGE, null, 0., ALF_CHECK3D); LineAttack (angle, DEFMELEERANGE, slope, damage, 'Melee', "PunchPuff", true); }