From eed32ee285fe240bf127ce322c0d42b4c1804a32 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 22 May 2016 12:11:39 +0200 Subject: [PATCH 1/9] - fixed: The friction calculations for terrain based friction had some fixed/float mixups. --- src/p_terrain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_terrain.cpp b/src/p_terrain.cpp index 1b3226780d..ca5a8b998a 100644 --- a/src/p_terrain.cpp +++ b/src/p_terrain.cpp @@ -497,7 +497,7 @@ static void ParseFriction (FScanner &sc, int keyword, void *fields) friction = (0x1EB8*(sc.Float*100))/0x80 + 0xD001; friction = clamp (friction, 0, 65536.); - if (friction > ORIG_FRICTION) // ice + if (friction > ORIG_FRICTION * 65536.) // ice movefactor = ((0x10092 - friction) * 1024) / 4352 + 568; else movefactor = ((friction - 0xDB34)*(0xA))/0x80; From db944df467a49e64fbbbad9bdae70f88802d2799 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 22 May 2016 12:15:14 +0200 Subject: [PATCH 2/9] - fixed 3D floor rendering with nearby slopes. --- src/r_bsp.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/r_bsp.cpp b/src/r_bsp.cpp index f41e99a747..934d2d3e54 100644 --- a/src/r_bsp.cpp +++ b/src/r_bsp.cpp @@ -622,6 +622,18 @@ void R_AddLine (seg_t *line) rw_backcz2 = backsector->ceilingplane.ZatPoint(line->v2); rw_backfz2 = backsector->floorplane.ZatPoint(line->v2); + if (fake3D & FAKE3D_FAKEBACK) + { + if (rw_frontfz1 >= rw_backfz1 && rw_frontfz2 >= rw_backfz2) + { + fake3D |= FAKE3D_CLIPBOTFRONT; + } + if (rw_frontcz1 <= rw_backcz1 && rw_frontcz2 <= rw_backcz2) + { + fake3D |= FAKE3D_CLIPTOPFRONT; + } + } + // Cannot make these walls solid, because it can result in // sprite clipping problems for sprites near the wall if (rw_frontcz1 > rw_backcz1 || rw_frontcz2 > rw_backcz2) @@ -1334,14 +1346,6 @@ void R_Subsector (subsector_t *sub) fakeFloor->validcount = validcount; R_3D_NewClip(); } - if (frontsector->CenterFloor() >= backsector->CenterFloor()) - { - fake3D |= FAKE3D_CLIPBOTFRONT; - } - if (frontsector->CenterCeiling() <= backsector->CenterCeiling()) - { - fake3D |= FAKE3D_CLIPTOPFRONT; - } R_AddLine(line); // fake } fakeFloor = NULL; From ae31e0ba72c9b978cb94e8090a8cb7572116ec17 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 22 May 2016 12:20:46 +0200 Subject: [PATCH 3/9] - changed the default key name string because '#' is used as a comment in the config files. --- src/c_bind.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/c_bind.cpp b/src/c_bind.cpp index a298dc2968..5c1b183239 100644 --- a/src/c_bind.cpp +++ b/src/c_bind.cpp @@ -228,7 +228,7 @@ static const char *KeyName (int key) if (KeyNames[key]) return KeyNames[key]; - mysnprintf (name, countof(name), "#%d", key); + mysnprintf (name, countof(name), "Key_%d", key); return name; } From aa6753383da96160134eed58fc5c1ef8a67c391f Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 22 May 2016 13:17:55 +0300 Subject: [PATCH 4/9] Fixed fullscreen mode on non-default monitor in OS X backend Fullscreen window was incorrectly placed on the main screen instead of the current one Honestly I have no idea what was the reason behind that [NSWindow setFrameOrigin:] call Apparently it's redundant and moreover it's incorrect for multi-monitor configuration --- src/posix/cocoa/i_video.mm | 1 - 1 file changed, 1 deletion(-) diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index 89b3714d10..5e073daf3f 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -665,7 +665,6 @@ void CocoaVideo::SetFullscreenMode(const int width, const int height) } [m_window setFrame:screenFrame display:YES]; - [m_window setFrameOrigin:NSMakePoint(0.0f, 0.0f)]; } void CocoaVideo::SetWindowedMode(const int width, const int height) From 1b1195df6a91f67c6403ee82494231ad34651a70 Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Mon, 23 May 2016 21:11:26 -0500 Subject: [PATCH 5/9] - Added limit parameter to A_RadiusGive. - The function ends operation if the number of successfully given actors reaches this count. --- src/thingdef/thingdef_codeptr.cpp | 11 ++++++----- wadsrc/static/actors/actor.txt | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index afbc036a67..04ed1c22ca 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -5635,16 +5635,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive) PARAM_FLOAT (distance); PARAM_INT (flags); PARAM_INT_OPT (amount) { amount = 0; } - PARAM_CLASS_OPT (filter, AActor) { filter = NULL; } + PARAM_CLASS_OPT (filter, AActor) { filter = nullptr; } PARAM_NAME_OPT (species) { species = NAME_None; } PARAM_FLOAT_OPT (mindist) { mindist = 0; } + PARAM_INT_OPT (limit) { limit = 0; } // We need a valid item, valid targets, and a valid range - if (item == NULL || (flags & RGF_MASK) == 0 || !flags || distance <= 0 || mindist >= distance) + if (item == nullptr || (flags & RGF_MASK) == 0 || !flags || distance <= 0 || mindist >= distance) { ACTION_RETURN_INT(0); } - + bool unlimited = (limit <= 0); if (amount == 0) { amount = 1; @@ -5654,7 +5655,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive) if (flags & RGF_MISSILES) { TThinkerIterator it; - while ((thing = it.Next())) + while ((thing = it.Next()) && ((unlimited) || (given < limit))) { given += DoRadiusGive(self, thing, item, amount, distance, flags, filter, species, mindist); } @@ -5666,7 +5667,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive) FMultiBlockThingsIterator it(check, self->X(), self->Y(), mid-distance, mid+distance, distance, false, self->Sector); FMultiBlockThingsIterator::CheckResult cres; - while ((it.Next(&cres))) + while ((it.Next(&cres)) && ((unlimited) || (given < limit))) { given += DoRadiusGive(self, cres.thing, item, amount, distance, flags, filter, species, mindist); } diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index 44ebb1dc32..fbb16dc80b 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -237,7 +237,7 @@ ACTOR Actor native //: Thinker native state A_JumpIfInTargetInventory(class itemtype, int amount, state label, int forward_ptr = AAPTR_DEFAULT); native bool A_GiveToTarget(class itemtype, int amount = 0, int forward_ptr = AAPTR_DEFAULT); native bool A_TakeFromTarget(class itemtype, int amount = 0, int flags = 0, int forward_ptr = AAPTR_DEFAULT); - native int A_RadiusGive(class itemtype, float distance, int flags, int amount = 0, class filter = "None", name species = "None", int mindist = 0); + native int A_RadiusGive(class itemtype, float distance, int flags, int amount = 0, class filter = "None", name species = "None", int mindist = 0, int limit = 0); native state A_CheckSpecies(state jump, name species = "", int ptr = AAPTR_DEFAULT); native void A_CountdownArg(int argnum, state targstate = ""); action native A_CustomMeleeAttack(int damage = 0, sound meleesound = "", sound misssound = "", name damagetype = "none", bool bleed = true); From 3bde8824a37ae4f2e30eb1efe27e58f36e3ade30 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 24 May 2016 09:32:30 +0200 Subject: [PATCH 6/9] - fixed A_Burst's velocity calculation. --- src/thingdef/thingdef_codeptr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 04ed1c22ca..e003277ad6 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -3439,7 +3439,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Burst) if (mo) { - mo->Vel.Z = 4 * (mo->Z() - self->Z()) * self->Height; + mo->Vel.Z = 4 * (mo->Z() - self->Z()) / self->Height; mo->Vel.X = pr_burst.Random2() / 128.; mo->Vel.Y = pr_burst.Random2() / 128.; mo->RenderStyle = self->RenderStyle; From d70601471a70938ecf9ba8e95fafb12fa9d9252d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 24 May 2016 09:37:01 +0200 Subject: [PATCH 7/9] - fixed the spawn position of Strife's sentinel's attack's trail. --- src/g_strife/a_sentinel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_strife/a_sentinel.cpp b/src/g_strife/a_sentinel.cpp index fa99c827f8..91adbb01ec 100644 --- a/src/g_strife/a_sentinel.cpp +++ b/src/g_strife/a_sentinel.cpp @@ -60,7 +60,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SentinelAttack) for (int i = 8; i > 1; --i) { trail = Spawn("SentinelFX1", - self->Vec3Angle(missile->radius*i, missile->Angles.Yaw, missile->Vel.Z / 4 * i), ALLOW_REPLACE); + self->Vec3Angle(missile->radius*i, missile->Angles.Yaw, 32 + missile->Vel.Z / 4 * i), ALLOW_REPLACE); if (trail != NULL) { trail->target = self; From d058820c65368db5de692ca34059cb80b3aea911 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 24 May 2016 10:01:57 +0200 Subject: [PATCH 8/9] - fixed scroll speed calculation for Heretic. --- src/p_mobj.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index fe049bdb49..97167f245b 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -3560,10 +3560,10 @@ void AActor::Tick () scrolltype -= Carry_East5; BYTE dir = HereticScrollDirs[scrolltype / 5]; double carryspeed = HereticSpeedMuls[scrolltype % 5] * (1. / (32 * CARRYFACTOR)); - if (scrolltype<=Carry_East35 && !(i_compatflags&COMPATF_RAVENSCROLL)) + if (scrolltype < 5 && !(i_compatflags&COMPATF_RAVENSCROLL)) { // Use speeds that actually match the scrolling textures! - carryspeed = (1 << ((scrolltype%5) - 1)); + carryspeed = (1 << ((scrolltype % 5) + 15)) / 65536.; } scrollv.X += carryspeed * ((dir & 3) - 1); scrollv.Y += carryspeed * (((dir & 12) >> 2) - 1); From 49234b1fc3cf3a48395f001e07086aa1f520f4ab Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 24 May 2016 13:53:29 +0200 Subject: [PATCH 9/9] - fixed: UpdateRenderSectorList did some bad calculations for checking portal plane order. --- src/p_map.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_map.cpp b/src/p_map.cpp index c5bf741dac..ce3fd9af2d 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -6497,7 +6497,7 @@ void AActor::UpdateRenderSectorList() while (!sec->PortalBlocksMovement(sector_t::ceiling)) { double planeh = sec->GetPortalPlaneZ(sector_t::ceiling); - if (planeh < lasth) break; // broken setup. + if (planeh <= lasth) break; // broken setup. if (Top() + SPRITE_SPACE < planeh) break; lasth = planeh; DVector2 newpos = Pos() + sec->GetPortalDisplacement(sector_t::ceiling); @@ -6508,7 +6508,7 @@ void AActor::UpdateRenderSectorList() while (!sec->PortalBlocksMovement(sector_t::floor)) { double planeh = sec->GetPortalPlaneZ(sector_t::floor); - if (planeh > lasth) break; // broken setup. + if (planeh >= lasth) break; // broken setup. if (Z() - SPRITE_SPACE > planeh) break; lasth = planeh; DVector2 newpos = Pos() + sec->GetPortalDisplacement(sector_t::floor);