From 22005697931c89ea3406999e87c2430ec7227b9c Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 7 Jun 2015 11:31:53 +0300 Subject: [PATCH 01/23] Fixed build on OS X without FMODEx --- src/CMakeLists.txt | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index af1f04f49..782e4bac0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1242,18 +1242,20 @@ if( APPLE ) LINK_FLAGS "-framework Carbon -framework Cocoa -framework IOKit -framework OpenGL" MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/posix/osx/zdoom-info.plist" ) - # Fix fmod link so that it can be found in the app bundle. - find_program( OTOOL otool HINTS "/usr/bin" "${OSX_DEVELOPER_ROOT}/usr/bin" ) - find_program( INSTALL_NAME_TOOL install_name_tool HINTS "/usr/bin" "${OSX_DEVELOPER_ROOT}/usr/bin" ) - execute_process( COMMAND "${OTOOL}" -L "${FMOD_LIBRARY}" - COMMAND grep "libfmodex.dylib (compat" - COMMAND head -n1 - COMMAND awk "{print $1}" - OUTPUT_VARIABLE FMOD_LINK - OUTPUT_STRIP_TRAILING_WHITESPACE ) - add_custom_command( TARGET zdoom POST_BUILD - COMMAND "${INSTALL_NAME_TOOL}" -change "${FMOD_LINK}" @executable_path/../Frameworks/libfmodex.dylib "$" - COMMENT "Relinking FMOD Ex" ) + if( NOT NO_FMOD ) + # Fix fmod link so that it can be found in the app bundle. + find_program( OTOOL otool HINTS "/usr/bin" "${OSX_DEVELOPER_ROOT}/usr/bin" ) + find_program( INSTALL_NAME_TOOL install_name_tool HINTS "/usr/bin" "${OSX_DEVELOPER_ROOT}/usr/bin" ) + execute_process( COMMAND "${OTOOL}" -L "${FMOD_LIBRARY}" + COMMAND grep "libfmodex.dylib (compat" + COMMAND head -n1 + COMMAND awk "{print $1}" + OUTPUT_VARIABLE FMOD_LINK + OUTPUT_STRIP_TRAILING_WHITESPACE ) + add_custom_command( TARGET zdoom POST_BUILD + COMMAND "${INSTALL_NAME_TOOL}" -change "${FMOD_LINK}" @executable_path/../Frameworks/libfmodex.dylib "$" + COMMENT "Relinking FMOD Ex" ) + endif( NOT NO_FMOD ) endif( APPLE ) source_group("Assembly Files\\ia32" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/asm_ia32/.+") From 3b2126ba951be310d9cdef2a6053a5d2a314784b Mon Sep 17 00:00:00 2001 From: "Eevee (Alex Munroe)" Date: Tue, 9 Jun 2015 13:20:10 -0700 Subject: [PATCH 02/23] Don't allow pressing a checkswitchrange switch that's in the floor. --- src/p_switch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_switch.cpp b/src/p_switch.cpp index 5aeff7b46..6ea04593f 100644 --- a/src/p_switch.cpp +++ b/src/p_switch.cpp @@ -181,7 +181,7 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno) } else if ((TexMan.FindSwitch(side->GetTexture(side_t::bottom))) != NULL) { - return (user->z <= open.bottom); + return (user->z < open.bottom); } else if ((flags & ML_3DMIDTEX) || (TexMan.FindSwitch(side->GetTexture(side_t::mid))) != NULL) { @@ -194,7 +194,7 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno) else { // no switch found. Check whether the player can touch either top or bottom texture - return (user->z + user->height >= open.top) || (user->z <= open.bottom); + return (user->z + user->height >= open.top) || (user->z < open.bottom); } } From 911b35370e28af78002cd28268a24e793895ede8 Mon Sep 17 00:00:00 2001 From: "Eevee (Alex Munroe)" Date: Tue, 9 Jun 2015 13:41:48 -0700 Subject: [PATCH 03/23] Let's go wild and do it for the ceiling, too. --- src/p_switch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_switch.cpp b/src/p_switch.cpp index 6ea04593f..1ca4654b5 100644 --- a/src/p_switch.cpp +++ b/src/p_switch.cpp @@ -177,7 +177,7 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno) if ((TexMan.FindSwitch(side->GetTexture(side_t::top))) != NULL) { - return (user->z + user->height >= open.top); + return (user->z + user->height > open.top); } else if ((TexMan.FindSwitch(side->GetTexture(side_t::bottom))) != NULL) { @@ -194,7 +194,7 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno) else { // no switch found. Check whether the player can touch either top or bottom texture - return (user->z + user->height >= open.top) || (user->z < open.bottom); + return (user->z + user->height > open.top) || (user->z < open.bottom); } } From 76c401a41ec655e83f0b375b1c61787fa8b13446 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 18 Jun 2015 10:20:04 +0200 Subject: [PATCH 04/23] - added 'nopushwindowcheck' for Hexen's MAP30 which abuses a glitch with a 'projectile impact' line on a two-sided wall. --- wadsrc/static/compatibility.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index 3a675f275..26f43bb25 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -386,6 +386,7 @@ D62DCA9EC226DE49108D5DD9271F7631 // Cheogsh 2 map04 setthingz 1649 528 } +E89CCC7E155F1032F693359CC219BE6C // hexen.wad map30 B9DFF13207EACAC675C71D82624D0007 // XtheaterIII map01 { DisablePushWindowCheck From 85449a6b8a330b48dfa088a93f4242987ade19fd Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 21 Jun 2015 13:04:47 +0200 Subject: [PATCH 05/23] - fixed: A_BFGSpray checked the spray actor's class for MTHRUSPECIES, not the actual shooter. --- src/g_doom/a_doomweaps.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_doom/a_doomweaps.cpp b/src/g_doom/a_doomweaps.cpp index 6dbf3d1ec..899f1f7d5 100644 --- a/src/g_doom/a_doomweaps.cpp +++ b/src/g_doom/a_doomweaps.cpp @@ -624,7 +624,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BFGSpray) if (spray != NULL) { - if (spray->flags6 & MF6_MTHRUSPECIES && spray->GetSpecies() == linetarget->GetSpecies()) + if (spray->flags6 & MF6_MTHRUSPECIES && self->target->GetSpecies() == linetarget->GetSpecies()) { spray->Destroy(); // [MC] Remove it because technically, the spray isn't trying to "hit" them. continue; From 8670b7ecf79a91cd4d64025bb11393b8b931afb1 Mon Sep 17 00:00:00 2001 From: Edward Richardson Date: Thu, 25 Jun 2015 12:53:46 +1200 Subject: [PATCH 06/23] Use puff decal with MF7_FORCEDECAL --- src/p_map.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/p_map.cpp b/src/p_map.cpp index 197525aa4..26312d922 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -4275,11 +4275,16 @@ void P_RailAttack(AActor *source, int damage, int offset_xy, fixed_t offset_z, i // Spawn a decal or puff at the point where the trace ended. if (trace.HitType == TRACE_HitWall) { - SpawnShootDecal(source, trace); + AActor* puff = NULL; + if (puffclass != NULL && puffDefaults->flags3 & MF3_ALWAYSPUFF) { - P_SpawnPuff(source, puffclass, trace.X, trace.Y, trace.Z, (source->angle + angleoffset) - ANG90, 1, 0); + puff = P_SpawnPuff(source, puffclass, trace.X, trace.Y, trace.Z, (source->angle + angleoffset) - ANG90, 1, 0); } + if (puff != NULL && puffDefaults->flags7 & MF7_FORCEDECAL && puff->DecalGenerator) + SpawnShootDecal(puff, trace); + else + SpawnShootDecal(source, trace); } if (thepuff != NULL) From 2a69ae2a434e00c2c5543ecd9b37dd3b5cb04aba Mon Sep 17 00:00:00 2001 From: Edward Richardson Date: Thu, 25 Jun 2015 13:57:36 +1200 Subject: [PATCH 07/23] Change all float calcs in rails to doubles --- src/p_effect.cpp | 50 +++++++++++++++---------------- src/p_effect.h | 2 +- src/p_enemy.cpp | 2 +- src/p_local.h | 2 +- src/p_map.cpp | 10 +++---- src/thingdef/thingdef_codeptr.cpp | 14 ++++----- 6 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/p_effect.cpp b/src/p_effect.cpp index 1b7ce0bc8..db3129521 100644 --- a/src/p_effect.cpp +++ b/src/p_effect.cpp @@ -586,12 +586,12 @@ void P_DrawSplash2 (int count, fixed_t x, fixed_t y, fixed_t z, angle_t angle, i } } -void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end, int color1, int color2, float maxdiff, int flags, const PClass *spawnclass, angle_t angle, int duration, float sparsity, float drift, int SpiralOffset) +void P_DrawRailTrail(AActor *source, const TVector3 &start, const TVector3 &end, int color1, int color2, double maxdiff, int flags, const PClass *spawnclass, angle_t angle, int duration, double sparsity, double drift, int SpiralOffset) { double length, lengthsquared; int steps, i; - FAngle deg; - FVector3 step, dir, pos, extend; + TAngle deg; + TVector3 step, dir, pos, extend; bool fullbright; dir = end - start; @@ -615,9 +615,9 @@ void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end // The railgun's sound is special. It gets played from the // point on the slug's trail that is closest to the hearing player. AActor *mo = players[consoleplayer].camera; - FVector3 point; + TVector3 point; double r; - float dirz; + double dirz; if (abs(mo->x - FLOAT2FIXED(start.X)) < 20 * FRACUNIT && (mo->y - FLOAT2FIXED(start.Y)) < 20 * FRACUNIT) @@ -630,7 +630,7 @@ void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end // Only consider sound in 2D (for now, anyway) // [BB] You have to divide by lengthsquared here, not multiply with it. - r = ((start.Y - FIXED2FLOAT(mo->y)) * (-dir.Y) - (start.X - FIXED2FLOAT(mo->x)) * (dir.X)) / lengthsquared; + r = ((start.Y - FIXED2DBL(mo->y)) * (-dir.Y) - (start.X - FIXED2DBL(mo->x)) * (dir.X)) / lengthsquared; r = clamp(r, 0., 1.); dirz = dir.Z; @@ -662,7 +662,7 @@ void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end minelem = fabs(dir[i]); } } - FVector3 tempvec(0,0,0); + TVector3 tempvec(0, 0, 0); tempvec[epos] = 1; extend = tempvec - (dir | tempvec) * dir; // @@ -673,16 +673,16 @@ void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end // Create the outer spiral. if (color1 != -1 && (!r_rail_smartspiral || color2 == -1) && r_rail_spiralsparsity > 0 && (spawnclass == NULL)) { - FVector3 spiral_step = step * r_rail_spiralsparsity * sparsity; + TVector3 spiral_step = step * r_rail_spiralsparsity * sparsity; int spiral_steps = (int)(steps * r_rail_spiralsparsity / sparsity); color1 = color1 == 0 ? -1 : ParticleColor(color1); pos = start; - deg = FAngle(SpiralOffset); + deg = TAngle(SpiralOffset); for (i = spiral_steps; i; i--) { particle_t *p = NewParticle (); - FVector3 tempvec; + TVector3 tempvec; if (!p) return; @@ -695,7 +695,7 @@ void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end p->size = 3; p->bright = fullbright; - tempvec = FMatrix3x3(dir, deg) * extend; + tempvec = TMatrix3x3(dir, deg) * extend; p->velx = FLOAT2FIXED(tempvec.X * drift)>>4; p->vely = FLOAT2FIXED(tempvec.Y * drift)>>4; p->velz = FLOAT2FIXED(tempvec.Z * drift)>>4; @@ -704,7 +704,7 @@ void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end p->y = FLOAT2FIXED(tempvec.Y); p->z = FLOAT2FIXED(tempvec.Z); pos += spiral_step; - deg += FAngle(r_rail_spiralsparsity * 14); + deg += TAngle(r_rail_spiralsparsity * 14); if (color1 == -1) { @@ -729,18 +729,18 @@ void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end // Create the inner trail. if (color2 != -1 && r_rail_trailsparsity > 0 && spawnclass == NULL) { - FVector3 trail_step = step * r_rail_trailsparsity * sparsity; + TVector3 trail_step = step * r_rail_trailsparsity * sparsity; int trail_steps = xs_FloorToInt(steps * r_rail_trailsparsity / sparsity); color2 = color2 == 0 ? -1 : ParticleColor(color2); - FVector3 diff(0, 0, 0); + TVector3 diff(0, 0, 0); pos = start; for (i = trail_steps; i; i--) { // [XA] inner trail uses a different default duration (33). int innerduration = (duration == 0) ? 33 : duration; - particle_t *p = JitterParticle (innerduration, drift); + particle_t *p = JitterParticle (innerduration, (float)drift); if (!p) return; @@ -749,14 +749,14 @@ void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end { int rnd = M_Random (); if (rnd & 1) - diff.X = clamp (diff.X + ((rnd & 8) ? 1 : -1), -maxdiff, maxdiff); + diff.X = clamp(diff.X + ((rnd & 8) ? 1 : -1), -maxdiff, maxdiff); if (rnd & 2) - diff.Y = clamp (diff.Y + ((rnd & 16) ? 1 : -1), -maxdiff, maxdiff); + diff.Y = clamp(diff.Y + ((rnd & 16) ? 1 : -1), -maxdiff, maxdiff); if (rnd & 4) - diff.Z = clamp (diff.Z + ((rnd & 32) ? 1 : -1), -maxdiff, maxdiff); + diff.Z = clamp(diff.Z + ((rnd & 32) ? 1 : -1), -maxdiff, maxdiff); } - FVector3 postmp = pos + diff; + TVector3 postmp = pos + diff; p->size = 2; p->x = FLOAT2FIXED(postmp.X); @@ -791,9 +791,9 @@ void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end if (sparsity < 1) sparsity = 32; - FVector3 trail_step = (step / 3) * sparsity; + TVector3 trail_step = (step / 3) * sparsity; int trail_steps = (int)((steps * 3) / sparsity); - FVector3 diff(0, 0, 0); + TVector3 diff(0, 0, 0); pos = start; for (i = trail_steps; i; i--) @@ -802,13 +802,13 @@ void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end { int rnd = pr_railtrail(); if (rnd & 1) - diff.X = clamp (diff.X + ((rnd & 8) ? 1 : -1), -maxdiff, maxdiff); + diff.X = clamp(diff.X + ((rnd & 8) ? 1 : -1), -maxdiff, maxdiff); if (rnd & 2) - diff.Y = clamp (diff.Y + ((rnd & 16) ? 1 : -1), -maxdiff, maxdiff); + diff.Y = clamp(diff.Y + ((rnd & 16) ? 1 : -1), -maxdiff, maxdiff); if (rnd & 4) - diff.Z = clamp (diff.Z + ((rnd & 32) ? 1 : -1), -maxdiff, maxdiff); + diff.Z = clamp(diff.Z + ((rnd & 32) ? 1 : -1), -maxdiff, maxdiff); } - FVector3 postmp = pos + diff; + TVector3 postmp = pos + diff; AActor *thing = Spawn (spawnclass, FLOAT2FIXED(postmp.X), FLOAT2FIXED(postmp.Y), FLOAT2FIXED(postmp.Z), ALLOW_REPLACE); if (thing) diff --git a/src/p_effect.h b/src/p_effect.h index 6ca9dfea9..11116e8a3 100644 --- a/src/p_effect.h +++ b/src/p_effect.h @@ -88,7 +88,7 @@ void P_RunEffects (void); void P_RunEffect (AActor *actor, int effects); -void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end, int color1, int color2, float maxdiff = 0, int flags = 0, const PClass *spawnclass = NULL, angle_t angle = 0, int duration = 35, float sparsity = 1.0, float drift = 1.0, int SpiralOffset = 270); +void P_DrawRailTrail(AActor *source, const TVector3 &start, const TVector3 &end, int color1, int color2, double maxdiff = 0, int flags = 0, const PClass *spawnclass = NULL, angle_t angle = 0, int duration = 35, double sparsity = 1.0, double drift = 1.0, int SpiralOffset = 270); void P_DrawSplash (int count, fixed_t x, fixed_t y, fixed_t z, angle_t angle, int kind); void P_DrawSplash2 (int count, fixed_t x, fixed_t y, fixed_t z, angle_t angle, int updown, int kind); void P_DisconnectEffect (AActor *actor); diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 10c4704d4..5291101a5 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -2931,7 +2931,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MonsterRail) if (linetarget == NULL) { // We probably won't hit the target, but aim at it anyway so we don't look stupid. - FVector2 xydiff(self->target->x - self->x, self->target->y - self->y); + TVector2 xydiff(self->target->x - self->x, self->target->y - self->y); double zdiff = (self->target->z + (self->target->height>>1)) - (self->z + (self->height>>1) - self->floorclip); self->pitch = int(atan2(zdiff, xydiff.Length()) * ANGLE_180 / -M_PI); diff --git a/src/p_local.h b/src/p_local.h index b62836c17..686e0ee13 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -475,7 +475,7 @@ void P_TraceBleed (int damage, AActor *target); // random direction version bool P_HitFloor (AActor *thing); bool P_HitWater (AActor *thing, sector_t *sec, fixed_t splashx = FIXED_MIN, fixed_t splashy = FIXED_MIN, fixed_t splashz=FIXED_MIN, bool checkabove = false, bool alert = true); void P_CheckSplash(AActor *self, fixed_t distance); -void P_RailAttack (AActor *source, int damage, int offset_xy, fixed_t offset_z = 0, int color1 = 0, int color2 = 0, float maxdiff = 0, int flags = 0, const PClass *puff = NULL, angle_t angleoffset = 0, angle_t pitchoffset = 0, fixed_t distance = 8192*FRACUNIT, int duration = 0, float sparsity = 1.0, float drift = 1.0, const PClass *spawnclass = NULL, int SpiralOffset = 270); // [RH] Shoot a railgun +void P_RailAttack (AActor *source, int damage, int offset_xy, fixed_t offset_z = 0, int color1 = 0, int color2 = 0, double maxdiff = 0, int flags = 0, const PClass *puff = NULL, angle_t angleoffset = 0, angle_t pitchoffset = 0, fixed_t distance = 8192*FRACUNIT, int duration = 0, double sparsity = 1.0, double drift = 1.0, const PClass *spawnclass = NULL, int SpiralOffset = 270); // [RH] Shoot a railgun enum // P_RailAttack / A_RailAttack / A_CustomRailgun / P_DrawRailTrail flags { diff --git a/src/p_map.cpp b/src/p_map.cpp index 26312d922..d5745523c 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -4150,12 +4150,12 @@ static ETraceStatus ProcessRailHit(FTraceResults &res, void *userdata) // // //========================================================================== -void P_RailAttack(AActor *source, int damage, int offset_xy, fixed_t offset_z, int color1, int color2, float maxdiff, int railflags, const PClass *puffclass, angle_t angleoffset, angle_t pitchoffset, fixed_t distance, int duration, float sparsity, float drift, const PClass *spawnclass, int SpiralOffset) +void P_RailAttack(AActor *source, int damage, int offset_xy, fixed_t offset_z, int color1, int color2, double maxdiff, int railflags, const PClass *puffclass, angle_t angleoffset, angle_t pitchoffset, fixed_t distance, int duration, double sparsity, double drift, const PClass *spawnclass, int SpiralOffset) { fixed_t vx, vy, vz; angle_t angle, pitch; fixed_t x1, y1; - FVector3 start, end; + TVector3 start, end; FTraceResults trace; fixed_t shootz; @@ -4304,9 +4304,9 @@ void P_RailAttack(AActor *source, int damage, int offset_xy, fixed_t offset_z, i } // Draw the slug's trail. - end.X = FIXED2FLOAT(trace.X); - end.Y = FIXED2FLOAT(trace.Y); - end.Z = FIXED2FLOAT(trace.Z); + end.X = FIXED2DBL(trace.X); + end.Y = FIXED2DBL(trace.Y); + end.Z = FIXED2DBL(trace.Z); P_DrawRailTrail(source, start, end, color1, color2, maxdiff, railflags, spawnclass, source->angle + angleoffset, duration, sparsity, drift, SpiralOffset); } diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 15d8291fc..54bbe68d3 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -1502,14 +1502,14 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RailAttack) ACTION_PARAM_COLOR(Color1, 3); ACTION_PARAM_COLOR(Color2, 4); ACTION_PARAM_INT(Flags, 5); - ACTION_PARAM_FLOAT(MaxDiff, 6); + ACTION_PARAM_DOUBLE(MaxDiff, 6); ACTION_PARAM_CLASS(PuffType, 7); ACTION_PARAM_ANGLE(Spread_XY, 8); ACTION_PARAM_ANGLE(Spread_Z, 9); ACTION_PARAM_FIXED(Range, 10); ACTION_PARAM_INT(Duration, 11); - ACTION_PARAM_FLOAT(Sparsity, 12); - ACTION_PARAM_FLOAT(DriftSpeed, 13); + ACTION_PARAM_DOUBLE(Sparsity, 12); + ACTION_PARAM_DOUBLE(DriftSpeed, 13); ACTION_PARAM_CLASS(SpawnClass, 14); ACTION_PARAM_FIXED(Spawnofs_Z, 15); ACTION_PARAM_INT(SpiralOffset, 16); @@ -1566,14 +1566,14 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomRailgun) ACTION_PARAM_COLOR(Color2, 3); ACTION_PARAM_INT(Flags, 4); ACTION_PARAM_INT(aim, 5); - ACTION_PARAM_FLOAT(MaxDiff, 6); + ACTION_PARAM_DOUBLE(MaxDiff, 6); ACTION_PARAM_CLASS(PuffType, 7); ACTION_PARAM_ANGLE(Spread_XY, 8); ACTION_PARAM_ANGLE(Spread_Z, 9); ACTION_PARAM_FIXED(Range, 10); ACTION_PARAM_INT(Duration, 11); - ACTION_PARAM_FLOAT(Sparsity, 12); - ACTION_PARAM_FLOAT(DriftSpeed, 13); + ACTION_PARAM_DOUBLE(Sparsity, 12); + ACTION_PARAM_DOUBLE(DriftSpeed, 13); ACTION_PARAM_CLASS(SpawnClass, 14); ACTION_PARAM_FIXED(Spawnofs_Z, 15); ACTION_PARAM_INT(SpiralOffset, 16); @@ -1612,7 +1612,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomRailgun) if (linetarget == NULL && aim) { // We probably won't hit the target, but aim at it anyway so we don't look stupid. - FVector2 xydiff(self->target->x - self->x, self->target->y - self->y); + TVector2 xydiff(self->target->x - self->x, self->target->y - self->y); double zdiff = (self->target->z + (self->target->height>>1)) - (self->z + (self->height>>1) - self->floorclip); self->pitch = int(atan2(zdiff, xydiff.Length()) * ANGLE_180 / -M_PI); From 0fa0dc5f9e81c1b9acf3a720cc6921e958584410 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 30 Jun 2015 13:01:48 -0500 Subject: [PATCH 08/23] Add support for alias parameter substitution in quoted strings - For backward compatibility, you need to indicate that substitution is allowed in the string by prepending it with a % character: alias asay "say %\"%1\"" The above will substitute the alias parameter. alias asay "say \"%1\"" The above will not substitute the alias parameter but use the string literal "%1" directly. --- src/c_dispatch.cpp | 60 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 45 insertions(+), 15 deletions(-) diff --git a/src/c_dispatch.cpp b/src/c_dispatch.cpp index d72993cb7..8ddd022e9 100644 --- a/src/c_dispatch.cpp +++ b/src/c_dispatch.cpp @@ -1076,7 +1076,8 @@ FString BuildString (int argc, FString *argv) // %x or %{x} in the command line with argument x. If argument x does not // exist, then the empty string is substituted in its place. // -// Substitution is not done inside of quoted strings. +// Substitution is not done inside of quoted strings, unless that string is +// prepended with a % character. // // To avoid a substitution, use %%. The %% will be replaced by a single %. // @@ -1091,19 +1092,12 @@ FString SubstituteAliasParams (FString &command, FCommandLine &args) char *p = command.LockBuffer(), *start = p; unsigned long argnum; FString buf; + bool inquote = false; while (*p != '\0') { - if (*p == '%' && ((p[1] >= '0' && p[1] <= '9') || p[1] == '{' || p[1] == '%')) + if (p[0] == '%' && ((p[1] >= '0' && p[1] <= '9') || p[1] == '{')) { - if (p[1] == '%') - { - // Do not substitute. Just collapse to a single %. - buf.AppendCStrPart (start, p - start + 1); - start = p = p + 2; - continue; - } - // Do a substitution. Output what came before this. buf.AppendCStrPart (start, p - start); @@ -1115,14 +1109,50 @@ FString SubstituteAliasParams (FString &command, FCommandLine &args) } p = (start += (p[1] == '{' && *start == '}')); } - else if (*p == '"') + else if (p[0] == '%' && p[1] == '%') { - // Don't substitute inside quoted strings. - p++; - while (*p != '\0' && (*p != '"' || *(p-1) == '\\')) + // Do not substitute. Just collapse to a single %. + buf.AppendCStrPart (start, p - start + 1); + start = p = p + 2; + continue; + } + else if (p[0] == '%' && p[1] == '"') + { + // Collapse %" to " and remember that we're in a quote so when we + // see a " character again, we don't start skipping below. + if (!inquote) + { + inquote = true; + buf.AppendCStrPart(start, p - start); + start = p + 1; + } + else + { + inquote = false; + } + p += 2; + } + else if (p[0] == '\\' && p[1] == '"') + { + p += 2; + } + else if (p[0] == '"') + { + // Don't substitute inside quoted strings if it didn't start + // with a %" + if (!inquote) + { p++; - if (*p != '\0') + while (*p != '\0' && (*p != '"' || *(p-1) == '\\')) + p++; + if (*p != '\0') + p++; + } + else + { + inquote = false; p++; + } } else { From 9edf409ea21794195e223b6afbdf148c14395453 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 30 Jun 2015 13:11:33 -0500 Subject: [PATCH 09/23] Add British English "translation", because u's matter --- wadsrc/static/language.eng | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 wadsrc/static/language.eng diff --git a/wadsrc/static/language.eng b/wadsrc/static/language.eng new file mode 100644 index 000000000..172cd2b4f --- /dev/null +++ b/wadsrc/static/language.eng @@ -0,0 +1,25 @@ +/* British English */ + +[eng] + +GOTARMOR = "Picked up the armour."; +GOTMEGA = "Picked up the MegaArmour!"; +GOTARMBONUS = "Picked up an armour bonus."; + +SCORE_COLOR = "COLOUR"; + +TAG_SHADOWARMOR = "Shadow Armour"; +TAG_METALARMOR = "Metal Armour"; +TAG_LEATHER = "Leather Armour"; +TAG_ARMORER = "Armourer"; + +TXT_ARMOR1 = "MESH ARMOUR"; + +TXT_METALARMOR = "You picked up the Metal Armour."; +TXT_LEATHERARMOR = "You picked up the Leather Armour."; +TXT_SHADOWARMOR = "You picked up the Shadow armour."; + +GOTCHEXARMOR = "Picked up the Chex(R) Armour."; +GOTSUPERCHEXARMOR = "Picked up the Super Chex(R) Armour!"; + +OB_BIPEDICUS2 = "%o was slimed by an armoured bipedicus."; From 3adda344b6178f78e28df0eb35beb6601b08f7ce Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Mon, 6 Jul 2015 02:58:01 -0400 Subject: [PATCH 10/23] - Missing common resolution 1680x1050 added to resolution list of SDL and Cocoa. --- src/posix/cocoa/i_video.mm | 1 + src/posix/sdl/sdlvideo.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index 29e6bf4d4..410a106f5 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -339,6 +339,7 @@ VideoModes[] = { 1600, 900 }, // 16:9 { 1600, 1000 }, // 16:10 { 1600, 1200 }, + { 1680, 1050 }, // 16:10 { 1920, 1080 }, { 1920, 1200 }, { 2048, 1536 }, diff --git a/src/posix/sdl/sdlvideo.cpp b/src/posix/sdl/sdlvideo.cpp index 76191e1a9..9da52c2dd 100644 --- a/src/posix/sdl/sdlvideo.cpp +++ b/src/posix/sdl/sdlvideo.cpp @@ -178,6 +178,7 @@ static MiniModeInfo WinModes[] = { 1600, 900 }, // 16:9 { 1600, 1000 }, // 16:10 { 1600, 1200 }, + { 1680, 1050 }, // 16:10 { 1920, 1080 }, { 1920, 1200 }, { 2048, 1536 }, From 9e1a82a83046178bc0509e07caf9667b3ad6e057 Mon Sep 17 00:00:00 2001 From: Marrub Date: Fri, 10 Jul 2015 08:45:15 +0000 Subject: [PATCH 11/23] fix menus muting themselves when the volume is changed --- src/sound/oalsound.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sound/oalsound.cpp b/src/sound/oalsound.cpp index 447de49f9..662e426e6 100644 --- a/src/sound/oalsound.cpp +++ b/src/sound/oalsound.cpp @@ -924,6 +924,8 @@ void OpenALSoundRenderer::SetSfxVolume(float volume) schan = schan->NextChan; } + alProcessUpdatesSOFT(); + getALError(); } From eeaea59828d4522b3e24272f5de0a0d1d2a34c12 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 13 Jul 2015 08:42:42 +0200 Subject: [PATCH 12/23] - fixed: FTagManager::RemoveSectorTags must check if the StartForSector array is large enough to contain the sector whose information is to be removed. --- src/p_tags.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_tags.cpp b/src/p_tags.cpp index c08caec8f..99796e269 100644 --- a/src/p_tags.cpp +++ b/src/p_tags.cpp @@ -98,7 +98,7 @@ void FTagManager::AddSectorTag(int sector, int tag) void FTagManager::RemoveSectorTags(int sect) { - if (startForSector.Size() > 0) + if (startForSector.Size() > sect) { int start = startForSector[sect]; if (start >= 0) From fe2e293d026a2eafd9393ace445fdf1452cdbc44 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 13 Jul 2015 09:08:08 +0200 Subject: [PATCH 13/23] - added some error checks for trying to create unsupported animations for textures with full path names. --- src/textures/animations.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/textures/animations.cpp b/src/textures/animations.cpp index 0290a293f..b9f4382a6 100644 --- a/src/textures/animations.cpp +++ b/src/textures/animations.cpp @@ -395,6 +395,11 @@ void FTextureManager::ParseAnim (FScanner &sc, int usetype) } else if (sc.Compare ("range")) { + if (picnum.Exists() && Texture(picnum)->Name.IsEmpty()) + { + // long texture name: We cannot do ranged anims on these because they have no defined order + sc.ScriptError ("You cannot use \"range\" for long texture names."); + } if (defined == 2) { sc.ScriptError ("You cannot use \"pic\" and \"range\" together in a single animation."); @@ -456,12 +461,20 @@ FAnimDef *FTextureManager::ParseRangeAnim (FScanner &sc, FTextureID picnum, int type = FAnimDef::ANIM_Forward; framenum = ParseFramenum (sc, picnum, usetype, missing); + ParseTime (sc, min, max); - if (framenum == picnum || !picnum.Exists()) + if (framenum == picnum || !picnum.Exists() || !framenum.Exists()) { return NULL; // Animation is only one frame or does not exist } + + if (Texture(framenum)->Name.IsEmpty()) + { + // long texture name: We cannot do ranged anims on these because they have no defined order + sc.ScriptError ("You cannot use \"range\" for long texture names."); + } + if (framenum < picnum) { type = FAnimDef::ANIM_Backward; @@ -570,7 +583,7 @@ void FTextureManager::ParseTime (FScanner &sc, DWORD &min, DWORD &max) void FTextureManager::ParseWarp(FScanner &sc) { - const BITFIELD texflags = TEXMAN_Overridable | TEXMAN_TryAny | TEXMAN_ShortNameOnly; + const BITFIELD texflags = TEXMAN_Overridable | TEXMAN_TryAny; bool isflat = false; bool type2 = sc.Compare ("warp2"); // [GRB] sc.MustGetString (); @@ -591,8 +604,16 @@ void FTextureManager::ParseWarp(FScanner &sc) FTextureID picnum = CheckForTexture (sc.String, isflat ? FTexture::TEX_Flat : FTexture::TEX_Wall, texflags); if (picnum.isValid()) { + FTexture *warper = Texture(picnum); + if (warper->Name.IsEmpty()) + { + // long texture name: We cannot do warps on these due to the way the texture manager implements warping as a texture replacement. + sc.ScriptError ("You cannot use \"warp\" for long texture names."); + } + + // don't warp a texture more than once if (!warper->bWarped) { From 585366f8720256019d8da801717e8e56f9de00d7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 15 Jul 2015 09:08:15 +0200 Subject: [PATCH 14/23] - fixed signedness warning. --- src/p_tags.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_tags.cpp b/src/p_tags.cpp index 99796e269..15528378b 100644 --- a/src/p_tags.cpp +++ b/src/p_tags.cpp @@ -98,7 +98,7 @@ void FTagManager::AddSectorTag(int sector, int tag) void FTagManager::RemoveSectorTags(int sect) { - if (startForSector.Size() > sect) + if (startForSector.Size() > (unsigned int)sect) { int start = startForSector[sect]; if (start >= 0) From b5033d29401d4f53d8ee5216d82ecec3c7b5d3a4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 15 Jul 2015 09:11:08 +0200 Subject: [PATCH 15/23] - fixed a bad check from pull request #325. --- 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 5a39d7dbb..49493667e 100644 --- a/src/g_mapinfo.cpp +++ b/src/g_mapinfo.cpp @@ -318,7 +318,7 @@ FString level_info_t::LookupLevelName() checkstring[0] = '\0'; } thename = strstr (lookedup, checkstring); - if (thename == NULL || thename == lookedup) + if (thename == NULL) { thename = lookedup; } From 19d15d7fc8c9b0aef52db971a24e421aebfd8e31 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 15 Jul 2015 09:25:04 +0200 Subject: [PATCH 16/23] - fixed: Levels could be exited multiple times, triggering special exit actions for each one. --- src/g_level.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/g_level.cpp b/src/g_level.cpp index 713205f6f..899f96d4f 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -533,6 +533,10 @@ void G_ChangeLevel(const char *levelname, int position, int flags, int nextSkill Printf (TEXTCOLOR_RED "Unloading scripts cannot exit the level again.\n"); return; } + if (gameaction == ga_completed) // do not exit multiple times. + { + return; + } if (levelname == NULL || *levelname == 0) { From 1e4bec25c530f197baa730046bb3e6a536bcaf4e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 15 Jul 2015 10:15:12 +0200 Subject: [PATCH 17/23] - fixed the distance check for unblocking overlapping monsters. It tested for half the radius as distance threshold when it should have used the full radius --- 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 d5745523c..fca43c120 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -1064,8 +1064,8 @@ bool PIT_CheckThing(AActor *thing, FCheckPosition &tm) { unblocking = true; } - else if (abs(thing->x - tm.thing->x) < (thing->radius+tm.thing->radius)/2 && - abs(thing->y - tm.thing->y) < (thing->radius+tm.thing->radius)/2) + else if (abs(thing->x - tm.thing->x) < (thing->radius+tm.thing->radius) && + abs(thing->y - tm.thing->y) < (thing->radius+tm.thing->radius)) { fixed_t newdist = P_AproxDistance(thing->x - tm.x, thing->y - tm.y); From c677dd37f5ee02d126244f1d15f5854b64edb885 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 15 Jul 2015 12:53:58 +0200 Subject: [PATCH 18/23] - changed I_PrintStr so that it doesn't add everything to the RichEdit control right away. The RichEdit control can become quite slow with large amounts of text being added constantly. Since anything that gets added while the game is running can't be seen anyway unless a fatal error is produced, it buffers the text locally now, without any processing, and only adds it to the RichEdit control in case a fatal error causes the control to be displayed again. --- src/win32/i_main.cpp | 5 +++++ src/win32/i_system.cpp | 30 +++++++++++++++++++++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/win32/i_main.cpp b/src/win32/i_main.cpp index ea167428f..8b6521ad5 100644 --- a/src/win32/i_main.cpp +++ b/src/win32/i_main.cpp @@ -106,6 +106,7 @@ LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM); void CreateCrashLog (char *custominfo, DWORD customsize, HWND richedit); void DisplayCrashLog (); extern BYTE *ST_Util_BitsForBitmap (BITMAPINFO *bitmap_info); +void I_FlushBufferedConsoleStuff(); // PUBLIC FUNCTION PROTOTYPES ---------------------------------------------- @@ -128,6 +129,7 @@ HANDLE MainThread; DWORD MainThreadID; HANDLE StdOut; bool FancyStdOut, AttachedStdOut; +bool ConWindowHidden; // The main window HWND Window; @@ -644,6 +646,7 @@ void I_SetWndProc() SetWindowLongPtr (Window, GWLP_USERDATA, 1); SetWindowLongPtr (Window, GWLP_WNDPROC, (WLONG_PTR)WndProc); ShowWindow (ConWindow, SW_HIDE); + ConWindowHidden = true; ShowWindow (GameTitleWindow, SW_HIDE); I_InitInput (Window); } @@ -675,8 +678,10 @@ void RestoreConView() SetWindowLongPtr (Window, GWLP_WNDPROC, (WLONG_PTR)LConProc); ShowWindow (ConWindow, SW_SHOW); + ConWindowHidden = false; ShowWindow (GameTitleWindow, SW_SHOW); I_ShutdownInput (); // Make sure the mouse pointer is available. + I_FlushBufferedConsoleStuff(); // Make sure the progress bar isn't visible. if (StartScreen != NULL) { diff --git a/src/win32/i_system.cpp b/src/win32/i_system.cpp index 1d2bae8e1..6d8fb8595 100644 --- a/src/win32/i_system.cpp +++ b/src/win32/i_system.cpp @@ -132,6 +132,7 @@ extern bool FancyStdOut; extern HINSTANCE g_hInst; extern FILE *Logfile; extern bool NativeMouse; +extern bool ConWindowHidden; // PUBLIC DATA DEFINITIONS ------------------------------------------------- @@ -912,12 +913,11 @@ void ToEditControl(HWND edit, const char *buf, wchar_t *wbuf, int bpos) // //========================================================================== -void I_PrintStr(const char *cp) +static void DoPrintStr(const char *cp, HWND edit, HANDLE StdOut) { - if (ConWindow == NULL && StdOut == NULL) + if (edit == NULL && StdOut == NULL) return; - HWND edit = ConWindow; char buf[256]; wchar_t wbuf[countof(buf)]; int bpos = 0; @@ -1049,6 +1049,30 @@ void I_PrintStr(const char *cp) } } +static TArray bufferedConsoleStuff; + +void I_PrintStr(const char *cp) +{ + if (ConWindowHidden) + { + bufferedConsoleStuff.Push(cp); + DoPrintStr(cp, NULL, StdOut); + } + else + { + DoPrintStr(cp, ConWindow, StdOut); + } +} + +void I_FlushBufferedConsoleStuff() +{ + for (unsigned i = 0; i < bufferedConsoleStuff.Size(); i++) + { + DoPrintStr(bufferedConsoleStuff[i], ConWindow, NULL); + } + bufferedConsoleStuff.Clear(); +} + //========================================================================== // // SetQueryIWAD From 47303b26c76fda45aa5b64b6594fda6b0d2950d7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 15 Jul 2015 14:09:21 +0200 Subject: [PATCH 19/23] - define GET_XBUTTON_WPARAM for MinGW in all file which need it. --- src/win32/i_input.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/win32/i_input.cpp b/src/win32/i_input.cpp index a26ff320e..941fc15de 100644 --- a/src/win32/i_input.cpp +++ b/src/win32/i_input.cpp @@ -110,6 +110,11 @@ #include "rawinput.h" +// Compensate for w32api's lack +#ifndef GET_XBUTTON_WPARAM +#define GET_XBUTTON_WPARAM(wParam) (HIWORD(wParam)) +#endif + #ifdef _DEBUG #define INGAME_PRIORITY_CLASS NORMAL_PRIORITY_CLASS From add52d48cdd194c8b2d89fc486bd0eb13e8ee0d7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 15 Jul 2015 14:44:37 +0200 Subject: [PATCH 20/23] - fixed: INPUT_XInput must also be available when compiling without XInput support so that the corresponding JoyDevice can be accessed. --- src/win32/i_input.h | 17 +++++++++-------- src/win32/i_xinput.cpp | 2 ++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/win32/i_input.h b/src/win32/i_input.h index b0d409844..c0de97e63 100644 --- a/src/win32/i_input.h +++ b/src/win32/i_input.h @@ -47,6 +47,15 @@ FString I_GetFromClipboard (bool windows_has_no_selection_clipboard); void I_GetEvent(); +enum +{ + INPUT_DIJoy, + INPUT_XInput, + INPUT_RawPS2, + NUM_JOYDEVICES +}; + + #ifdef USE_WINDOWS_DWORD #include "m_joy.h" @@ -121,14 +130,6 @@ public: virtual IJoystickConfig *Rescan() = 0; }; -enum -{ - INPUT_DIJoy, - INPUT_XInput, - INPUT_RawPS2, - NUM_JOYDEVICES -}; - extern FJoystickCollection *JoyDevices[NUM_JOYDEVICES]; void I_StartupMouse(); diff --git a/src/win32/i_xinput.cpp b/src/win32/i_xinput.cpp index 5a02d7af4..3d85f48a0 100644 --- a/src/win32/i_xinput.cpp +++ b/src/win32/i_xinput.cpp @@ -789,6 +789,8 @@ void I_StartupXInput() #else // NO_XINPUT +#include "i_input.h" + void I_StartupXInput() { JoyDevices[INPUT_XInput] = NULL; From 99683f0e7d63700d7ee49c1a4140b4cca76a1d8d Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Thu, 16 Jul 2015 19:43:30 +0200 Subject: [PATCH 21/23] - Fixed a KEYCONF parser issue with empty lines. The code attempted to access an array outside its bounds when it tried to parse empty lines. Discovered with the Address Sanitizer. --- src/keysections.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/keysections.cpp b/src/keysections.cpp index 8d23c9582..1ae87958c 100644 --- a/src/keysections.cpp +++ b/src/keysections.cpp @@ -177,6 +177,11 @@ void D_LoadWadSettings () { cmd[i] = conf[i]; } + if (i == 0) + { + conf++; + continue; + } cmd[i] = 0; conf += i; if (*conf == '\n') From 1bd23150aa4a50bde99298aa9669505ab1f974fc Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Thu, 16 Jul 2015 19:46:54 +0200 Subject: [PATCH 22/23] - Fixed an uninitialized variable in stairs code. 'floor->m_Hexencrush' was left uninitialized in all the floor movers after the first one. --- src/p_floor.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/p_floor.cpp b/src/p_floor.cpp index 97e23571b..9e7806039 100644 --- a/src/p_floor.cpp +++ b/src/p_floor.cpp @@ -727,6 +727,7 @@ bool EV_BuildStairs (int tag, DFloor::EStair type, line_t *line, floor->m_Type = DFloor::buildStair; //jff 3/31/98 do not leave uninited //jff 2/27/98 fix uninitialized crush field floor->m_Crush = (!usespecials && speed == 4*FRACUNIT) ? 10 : -1; + floor->m_Hexencrush = false; floor->m_ResetCount = reset; // [RH] Tics until reset (0 if never) floor->m_OrgDist = sec->floorplane.d; // [RH] Height to reset to } From f57e23989be272512a02ecfb1f027a5646184b42 Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Thu, 16 Jul 2015 19:54:27 +0200 Subject: [PATCH 23/23] - Fixed a dangerous typo in xs_Float code. The function 'xs_CeilToUInt' would call itself, leading to infinite loop, due to a typo. It should call 'xs_CeilToInt' instead. --- src/xs_Float.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xs_Float.h b/src/xs_Float.h index 19300b2fc..1f57f9205 100644 --- a/src/xs_Float.h +++ b/src/xs_Float.h @@ -209,7 +209,7 @@ finline static uint32 xs_FloorToUInt(real64 val) finline static uint32 xs_CeilToUInt(real64 val) { - return (uint32)xs_CeilToUInt(val); + return (uint32)xs_CeilToInt(val); } finline static uint32 xs_RoundToUInt(real64 val)