From 4fbe77fb82f7a5b761fdbfc2e0bf4c9e2c95e15b Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 1 May 2016 16:49:35 -0500 Subject: [PATCH 1/2] Very minor optimization for ACS str(i)cmp - If the two strings compared both point to the same location in memory, then we know they are the same string without having to bother actually comparing their contents. Note that the opposite is not neccessarily true: If they point to two different locations, they could still match a case-sensitive comparison because there are still two ACS string tables: the one that belongs to the map's script and the one that belongs to everything else. --- src/p_acs.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 003138211..032abbc27 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -5567,6 +5567,11 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound) if (argCount >= 2) { const char *a, *b; + // If the string indicies are the same, then they are the same string. + if (args[0] == args[1]) + { + return 0; + } a = FBehavior::StaticLookupString(args[0]); b = FBehavior::StaticLookupString(args[1]); From a576243ff28af07760a504a9a326b51382973b81 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 3 May 2016 10:26:29 +0200 Subject: [PATCH 2/2] - fixed: ThrustThing should add to the velocity, not set it. --- src/p_lnspec.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 2f3052203..103ac1264 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -75,6 +75,10 @@ */ static const BYTE ChangeMap[8] = { 0, 1, 5, 3, 7, 2, 6, 0 }; +int LS_Sector_SetPlaneReflection(line_t *ln, AActor *it, bool backSide, int arg0, int arg1, int arg2, int arg3, int arg4); +int LS_SetGlobalFogParameter(line_t *ln, AActor *it, bool backSide, int arg0, int arg1, int arg2, int arg3, int arg4); + + #define FUNC(a) static int a (line_t *ln, AActor *it, bool backSide, \ int arg0, int arg1, int arg2, int arg3, int arg4) @@ -1128,7 +1132,7 @@ FUNC(LS_Teleport_Line) static void ThrustThingHelper(AActor *it, DAngle angle, double force, INTBOOL nolimit) { - it->VelFromAngle(angle, force); + it->Thrust(angle, force); if (!nolimit) { it->Vel.X = clamp(it->Vel.X, -MAXMOVE, MAXMOVE); @@ -3440,9 +3444,9 @@ static lnSpecFunc LineSpecials[] = /* 154 */ LS_Teleport_NoStop, /* 155 */ LS_NOP, /* 156 */ LS_NOP, - /* 157 */ LS_NOP, // SetGlobalFogParameter // in GZDoom + /* 157 */ LS_SetGlobalFogParameter, /* 158 */ LS_FS_Execute, - /* 159 */ LS_NOP, // Sector_SetPlaneReflection in GZDoom + /* 159 */ LS_Sector_SetPlaneReflection, /* 160 */ LS_NOP, // Sector_Set3DFloor /* 161 */ LS_NOP, // Sector_SetContents /* 162 */ LS_NOP, // Reserved Doom64 branch