diff --git a/source/blood/src/actor.cpp b/source/blood/src/actor.cpp index f59dafbcd..253b86c0e 100644 --- a/source/blood/src/actor.cpp +++ b/source/blood/src/actor.cpp @@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "build.h" #include "automap.h" -#include "pragmas.h" #include "mmulti.h" #include "savegamehelp.h" diff --git a/source/blood/src/ai.cpp b/source/blood/src/ai.cpp index 48342da01..5bd98c6bc 100644 --- a/source/blood/src/ai.cpp +++ b/source/blood/src/ai.cpp @@ -24,7 +24,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "ns.h" // Must come before everything else! #include "build.h" -#include "pragmas.h" #include "savegamehelp.h" #include "mmulti.h" diff --git a/source/blood/src/aibat.cpp b/source/blood/src/aibat.cpp index 1349267c9..6db80f812 100644 --- a/source/blood/src/aibat.cpp +++ b/source/blood/src/aibat.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "blood.h" diff --git a/source/blood/src/aibeast.cpp b/source/blood/src/aibeast.cpp index 820a6287e..30dd7d47b 100644 --- a/source/blood/src/aibeast.cpp +++ b/source/blood/src/aibeast.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "blood.h" diff --git a/source/blood/src/aiboneel.cpp b/source/blood/src/aiboneel.cpp index 9491e5288..2fccc1674 100644 --- a/source/blood/src/aiboneel.cpp +++ b/source/blood/src/aiboneel.cpp @@ -24,7 +24,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "ns.h" // Must come before everything else! #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "blood.h" diff --git a/source/blood/src/aiburn.cpp b/source/blood/src/aiburn.cpp index 17681f5c7..15ad1528e 100644 --- a/source/blood/src/aiburn.cpp +++ b/source/blood/src/aiburn.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "blood.h" diff --git a/source/blood/src/aicaleb.cpp b/source/blood/src/aicaleb.cpp index 8b276d24b..9bf1c779f 100644 --- a/source/blood/src/aicaleb.cpp +++ b/source/blood/src/aicaleb.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "blood.h" diff --git a/source/blood/src/aicerber.cpp b/source/blood/src/aicerber.cpp index dc16cb11e..7360f6b8c 100644 --- a/source/blood/src/aicerber.cpp +++ b/source/blood/src/aicerber.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "blood.h" diff --git a/source/blood/src/aicult.cpp b/source/blood/src/aicult.cpp index 45eac99a9..e30d85bc7 100644 --- a/source/blood/src/aicult.cpp +++ b/source/blood/src/aicult.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "blood.h" diff --git a/source/blood/src/aigarg.cpp b/source/blood/src/aigarg.cpp index 732ad3e88..b70bc1b6c 100644 --- a/source/blood/src/aigarg.cpp +++ b/source/blood/src/aigarg.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "blood.h" diff --git a/source/blood/src/aighost.cpp b/source/blood/src/aighost.cpp index 7c1aa624a..7b6d39541 100644 --- a/source/blood/src/aighost.cpp +++ b/source/blood/src/aighost.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "blood.h" diff --git a/source/blood/src/aigilbst.cpp b/source/blood/src/aigilbst.cpp index 5629f9d90..1de41c886 100644 --- a/source/blood/src/aigilbst.cpp +++ b/source/blood/src/aigilbst.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "blood.h" diff --git a/source/blood/src/aihand.cpp b/source/blood/src/aihand.cpp index 74b599984..389c6bfab 100644 --- a/source/blood/src/aihand.cpp +++ b/source/blood/src/aihand.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "blood.h" diff --git a/source/blood/src/aihound.cpp b/source/blood/src/aihound.cpp index 1d9136007..790a5180d 100644 --- a/source/blood/src/aihound.cpp +++ b/source/blood/src/aihound.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "blood.h" diff --git a/source/blood/src/aiinnoc.cpp b/source/blood/src/aiinnoc.cpp index 0bf388904..b0595c500 100644 --- a/source/blood/src/aiinnoc.cpp +++ b/source/blood/src/aiinnoc.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "blood.h" diff --git a/source/blood/src/aipod.cpp b/source/blood/src/aipod.cpp index 571fb0404..822b45307 100644 --- a/source/blood/src/aipod.cpp +++ b/source/blood/src/aipod.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "blood.h" diff --git a/source/blood/src/airat.cpp b/source/blood/src/airat.cpp index a6d4eaba7..53198e62d 100644 --- a/source/blood/src/airat.cpp +++ b/source/blood/src/airat.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "blood.h" diff --git a/source/blood/src/aispid.cpp b/source/blood/src/aispid.cpp index f76bc226e..cd34b36e8 100644 --- a/source/blood/src/aispid.cpp +++ b/source/blood/src/aispid.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "blood.h" diff --git a/source/blood/src/aitchern.cpp b/source/blood/src/aitchern.cpp index eba2be772..05cd294b9 100644 --- a/source/blood/src/aitchern.cpp +++ b/source/blood/src/aitchern.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "blood.h" diff --git a/source/blood/src/aiunicult.cpp b/source/blood/src/aiunicult.cpp index 7b2cb59d4..18681a129 100644 --- a/source/blood/src/aiunicult.cpp +++ b/source/blood/src/aiunicult.cpp @@ -26,7 +26,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "raze_sound.h" diff --git a/source/blood/src/aizomba.cpp b/source/blood/src/aizomba.cpp index 65c9143a3..442bdecfa 100644 --- a/source/blood/src/aizomba.cpp +++ b/source/blood/src/aizomba.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "blood.h" diff --git a/source/blood/src/aizombf.cpp b/source/blood/src/aizombf.cpp index 55abdfd88..ee74f601a 100644 --- a/source/blood/src/aizombf.cpp +++ b/source/blood/src/aizombf.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "blood.h" diff --git a/source/blood/src/animatesprite.cpp b/source/blood/src/animatesprite.cpp index 3b942f541..52e48097a 100644 --- a/source/blood/src/animatesprite.cpp +++ b/source/blood/src/animatesprite.cpp @@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "v_font.h" diff --git a/source/blood/src/common_game.h b/source/blood/src/common_game.h index a2b46c658..2556e2336 100644 --- a/source/blood/src/common_game.h +++ b/source/blood/src/common_game.h @@ -24,7 +24,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "build.h" #include -#include "pragmas.h" #include "misc.h" #include "printf.h" #include "v_text.h" diff --git a/source/blood/src/gib.cpp b/source/blood/src/gib.cpp index 28c2422f9..449c6da8b 100644 --- a/source/blood/src/gib.cpp +++ b/source/blood/src/gib.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "blood.h" diff --git a/source/blood/src/hudsprites.cpp b/source/blood/src/hudsprites.cpp index 577aa6e2d..6df0ada96 100644 --- a/source/blood/src/hudsprites.cpp +++ b/source/blood/src/hudsprites.cpp @@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "v_font.h" diff --git a/source/blood/src/prediction.cpp b/source/blood/src/prediction.cpp index 55216b9d0..5d8f877c9 100644 --- a/source/blood/src/prediction.cpp +++ b/source/blood/src/prediction.cpp @@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "v_font.h" diff --git a/source/blood/src/sbar.cpp b/source/blood/src/sbar.cpp index c03f45193..ad1132c62 100644 --- a/source/blood/src/sbar.cpp +++ b/source/blood/src/sbar.cpp @@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "v_font.h" diff --git a/source/blood/src/sectorfx.cpp b/source/blood/src/sectorfx.cpp index c90801127..e103cf760 100644 --- a/source/blood/src/sectorfx.cpp +++ b/source/blood/src/sectorfx.cpp @@ -24,7 +24,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "blood.h" #include "interpolate.h" diff --git a/source/blood/src/trig.cpp b/source/blood/src/trig.cpp index 05f97bc4c..e7e3b878c 100644 --- a/source/blood/src/trig.cpp +++ b/source/blood/src/trig.cpp @@ -23,7 +23,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ //------------------------------------------------------------------------- #include "build.h" -#include "pragmas.h" #include "blood.h" BEGIN_BLD_NS diff --git a/source/blood/src/view.cpp b/source/blood/src/view.cpp index f7bb66c8b..e9fc26292 100644 --- a/source/blood/src/view.cpp +++ b/source/blood/src/view.cpp @@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" #include "mmulti.h" #include "v_font.h" @@ -222,8 +221,8 @@ void CalcOtherPosition(spritetype *pSprite, int *pX, int *pY, int *pZ, int *vsec if (abs(vX)+abs(vY) > abs(dX)+abs(dY)) { *vsectnum = nHSector; - dX -= ksgn(vX)<<6; - dY -= ksgn(vY)<<6; + dX -= Sgn(vX)<<6; + dY -= Sgn(vY)<<6; int nDist; if (abs(vX) > abs(vY)) { @@ -269,8 +268,8 @@ void CalcPosition(spritetype *pSprite, int *pX, int *pY, int *pZ, int *vsectnum, if (abs(vX)+abs(vY) > abs(dX)+abs(dY)) { *vsectnum = nHSector; - dX -= ksgn(vX)<<6; - dY -= ksgn(vY)<<6; + dX -= Sgn(vX)<<6; + dY -= Sgn(vY)<<6; int nDist; if (abs(vX) > abs(vY)) { diff --git a/source/build/include/build.h b/source/build/include/build.h index d9758e06c..86c6308d7 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -21,7 +21,6 @@ static_assert('\xff' == 255, "Char must be unsigned!"); #include "compat.h" #include "palette.h" -#include "pragmas.h" //Make all variables in BUILD.H defined in the ENGINE, //and externed in GAME diff --git a/source/build/include/pragmas.h b/source/build/include/pragmas.h deleted file mode 100644 index 0f417c5e6..000000000 --- a/source/build/include/pragmas.h +++ /dev/null @@ -1,17 +0,0 @@ -// "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman -// Ken Silverman's official web site: "http://www.advsys.net/ken" -// See the included license file "BUILDLIC.TXT" for license info. -// -// This file has been modified from Ken Silverman's original release -// by Jonathon Fowler (jf@jonof.id.au) -// by the EDuke32 team (development@voidpoint.com) - -#include "templates.h" -#ifndef pragmas_h_ -#define pragmas_h_ - -static inline constexpr int ksgn(int32_t a) { return (a > 0) - (a < 0); } - -inline int sgn(int32_t a) { return (a > 0) - (a < 0); } - -#endif // pragmas_h_ diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index 0f350edc6..f8f2fa38e 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -351,7 +351,7 @@ static inline void keepaway(int32_t *x, int32_t *y, int32_t w) { const int32_t x1 = clipit[w].x1, dx = clipit[w].x2-x1; const int32_t y1 = clipit[w].y1, dy = clipit[w].y2-y1; - const int32_t ox = ksgn(-dy), oy = ksgn(dx); + const int32_t ox = Sgn(-dy), oy = Sgn(dx); char first = (abs(dx) <= abs(dy)); do diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index d641ddc78..35d621e9b 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -16,7 +16,6 @@ #include "compat.h" #include "engine_priv.h" #include "palette.h" -#include "pragmas.h" #include "scriptfile.h" #include "gamecvars.h" #include "c_console.h" diff --git a/source/build/src/mdsprite.cpp b/source/build/src/mdsprite.cpp index e052ddda9..c7ebdc803 100644 --- a/source/build/src/mdsprite.cpp +++ b/source/build/src/mdsprite.cpp @@ -4,7 +4,6 @@ #include "compat.h" #include "build.h" -#include "pragmas.h" #include "engine_priv.h" #include "polymost.h" #include "mdsprite.h" diff --git a/source/build/src/voxmodel.cpp b/source/build/src/voxmodel.cpp index ed5ab0b19..a98c8bef3 100644 --- a/source/build/src/voxmodel.cpp +++ b/source/build/src/voxmodel.cpp @@ -4,7 +4,6 @@ #include "compat.h" #include "build.h" -#include "pragmas.h" #include "engine_priv.h" #include "polymost.h" #include "mdsprite.h" diff --git a/source/common/utility/cmdlib.h b/source/common/utility/cmdlib.h index 9c85aa05f..4c4468c98 100644 --- a/source/common/utility/cmdlib.h +++ b/source/common/utility/cmdlib.h @@ -99,5 +99,7 @@ inline void fillshort(void* buff, size_t count, uint16_t clear) } } +template inline constexpr T Sgn(const T& val) { return (val > 0) - (val < 0); } + #endif diff --git a/source/core/gamecontrol.h b/source/core/gamecontrol.h index 2663ea3a3..ebccf2f82 100644 --- a/source/core/gamecontrol.h +++ b/source/core/gamecontrol.h @@ -11,7 +11,6 @@ #include "stats.h" #include "i_time.h" #include "palentry.h" -#include "pragmas.h" extern FString currentGame; extern FString LumpFilter; diff --git a/source/exhumed/src/engine.h b/source/exhumed/src/engine.h index 39d677bed..8226dcc33 100644 --- a/source/exhumed/src/engine.h +++ b/source/exhumed/src/engine.h @@ -20,7 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" -#include "pragmas.h" BEGIN_PS_NS diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 98bc88bc3..51fe6450f 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -1370,7 +1370,7 @@ void movetongue(DDukeActor *actor, int tongue, int jaw) auto q = EGS(s->sectnum, s->x + MulScale(k, bcos(s->ang), 9), s->y + MulScale(k, bsin(s->ang), 9), - s->z + ((k * ksgn(s->zvel)) * abs(s->zvel / 12)), tongue, -40 + (k << 1), + s->z + ((k * Sgn(s->zvel)) * abs(s->zvel / 12)), tongue, -40 + (k << 1), 8, 8, 0, 0, 0, actor, 5); if (q) { @@ -1382,7 +1382,7 @@ void movetongue(DDukeActor *actor, int tongue, int jaw) auto spawned = EGS(s->sectnum, s->x + MulScale(k, bcos(s->ang), 9), s->y + MulScale(k, bsin(s->ang), 9), - s->z + ((k * ksgn(s->zvel)) * abs(s->zvel / 12)), jaw, -40, + s->z + ((k * Sgn(s->zvel)) * abs(s->zvel / 12)), jaw, -40, 32, 32, 0, 0, 0, actor, 5); if (spawned) { @@ -1743,7 +1743,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p { int l = ps[p].posz - s->z; if (abs(l) < (48 << 8)) t[0] = 3; - else s->z += sgn(ps[p].posz - s->z) << shift; // The shift here differs between Duke and RR. + else s->z += Sgn(ps[p].posz - s->z) << shift; // The shift here differs between Duke and RR. } else { @@ -3260,7 +3260,7 @@ void handle_se02(DDukeActor *actor) if (abs(sc->floorheinum - t[5]) < 8) sc->floorheinum = t[5]; - else sc->floorheinum += (sgn(t[5] - sc->floorheinum) << 4); + else sc->floorheinum += (Sgn(t[5] - sc->floorheinum) << 4); } int m = MulScale(s->xvel, bcos(s->ang), 14); @@ -3465,7 +3465,7 @@ void handle_se05(DDukeActor* actor, int FIRELASER) actor->SetOwner(Owner); if (!Owner) return; // Undefined case - was not checked. - s->zvel = ksgn(Owner->s.z - s->z) << 4; + s->zvel = Sgn(Owner->s.z - s->z) << 4; } if (ldist(Owner, actor) < 1024) @@ -3822,23 +3822,23 @@ void handle_se13(DDukeActor* actor) if (actor->spriteextra) { if (abs(t[0] - sc->ceilingz) >= j) - sc->ceilingz += sgn(t[0] - sc->ceilingz) * j; + sc->ceilingz += Sgn(t[0] - sc->ceilingz) * j; else sc->ceilingz = t[0]; } else { if (abs(t[1] - sc->floorz) >= j) - sc->floorz += sgn(t[1] - sc->floorz) * j; + sc->floorz += Sgn(t[1] - sc->floorz) * j; else sc->floorz = t[1]; } } else { if (abs(t[1] - sc->floorz) >= j) - sc->floorz += sgn(t[1] - sc->floorz) * j; + sc->floorz += Sgn(t[1] - sc->floorz) * j; else sc->floorz = t[1]; if (abs(t[0] - sc->ceilingz) >= j) - sc->ceilingz += sgn(t[0] - sc->ceilingz) * j; + sc->ceilingz += Sgn(t[0] - sc->ceilingz) * j; sc->ceilingz = t[0]; } @@ -4374,7 +4374,7 @@ void handle_se21(DDukeActor* actor) if (t[0] == 1) //Decide if the s->sectnum should go up or down { - s->zvel = ksgn(s->z - *lp) * (s->yvel << 4); + s->zvel = Sgn(s->z - *lp) * (s->yvel << 4); t[0]++; } @@ -4676,7 +4676,7 @@ void handle_se32(DDukeActor *actor) t[2] = 0; t[0] = 0; } - else sc->ceilingz += sgn(s->z - sc->ceilingz) * s->yvel; + else sc->ceilingz += Sgn(s->z - sc->ceilingz) * s->yvel; } else { @@ -4687,7 +4687,7 @@ void handle_se32(DDukeActor *actor) t[2] = 0; t[0] = 0; } - else sc->ceilingz += sgn(t[1] - sc->ceilingz) * s->yvel; + else sc->ceilingz += Sgn(t[1] - sc->ceilingz) * s->yvel; } return; } @@ -4701,7 +4701,7 @@ void handle_se32(DDukeActor *actor) callsound(s->sectnum, actor); sc->ceilingz = s->z; } - else sc->ceilingz += sgn(s->z - sc->ceilingz) * s->yvel; + else sc->ceilingz += Sgn(s->z - sc->ceilingz) * s->yvel; } else { @@ -4711,7 +4711,7 @@ void handle_se32(DDukeActor *actor) t[2] = !t[2]; callsound(s->sectnum, actor); } - else sc->ceilingz -= sgn(s->z - t[1]) * s->yvel; + else sc->ceilingz -= Sgn(s->z - t[1]) * s->yvel; } } @@ -4867,7 +4867,7 @@ void handle_se31(DDukeActor* actor, bool choosedir) } else { - int l = sgn(s->z - sec->floorz) * s->yvel; + int l = Sgn(s->z - sec->floorz) * s->yvel; sec->floorz += l; DukeSectIterator it(s->sectnum); @@ -4896,7 +4896,7 @@ void handle_se31(DDukeActor* actor, bool choosedir) } else { - int l = sgn(t[1] - sec->floorz) * s->yvel; + int l = Sgn(t[1] - sec->floorz) * s->yvel; sec->floorz += l; DukeSectIterator it(s->sectnum); @@ -4927,7 +4927,7 @@ void handle_se31(DDukeActor* actor, bool choosedir) } else { - int l = sgn(s->z - sec->floorz) * s->yvel; + int l = Sgn(s->z - sec->floorz) * s->yvel; sec->floorz += l; DukeSectIterator it(s->sectnum); @@ -4955,7 +4955,7 @@ void handle_se31(DDukeActor* actor, bool choosedir) } else { - int l = sgn(s->z - t[1]) * s->yvel; + int l = Sgn(s->z - t[1]) * s->yvel; sec->floorz -= l; DukeSectIterator it(s->sectnum); diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 9b34e6181..1b045ba00 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -1829,7 +1829,7 @@ static void weaponcommon_d(DDukeActor* proj) auto spawned = EGS(s->sectnum, s->x + MulScale(k, bcos(s->ang), 9), s->y + MulScale(k, bsin(s->ang), 9), - s->z + ((k * ksgn(s->zvel)) * abs(s->zvel / 24)), FIRELASER, -40 + (k << 2), + s->z + ((k * Sgn(s->zvel)) * abs(s->zvel / 24)), FIRELASER, -40 + (k << 2), s->xrepeat, s->yrepeat, 0, 0, 0, proj->GetOwner(), 5); spawned->s.cstat = 128; @@ -3482,7 +3482,7 @@ void handle_se06_d(DDukeActor* actor) { if (act2->temp_data[5] == 0) act2->temp_data[5] = dist(act2, actor); - int x = sgn(dist(act2, actor) - act2->temp_data[5]); + int x = Sgn(dist(act2, actor) - act2->temp_data[5]); if (act2->s.extra) x = -x; s->xvel += x; @@ -3819,7 +3819,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel) if (ps[playernum].newOwner != nullptr) goalang = getangle(ps[playernum].oposx - spr->x, ps[playernum].oposy - spr->y); else goalang = getangle(ps[playernum].posx - spr->x, ps[playernum].posy - spr->y); - angdif = ksgn(getincangle(spr->ang, goalang)) << 5; + angdif = Sgn(getincangle(spr->ang, goalang)) << 5; if (angdif > -32 && angdif < 0) { angdif = 0; diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index ba1fab547..ec6450516 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -1446,7 +1446,7 @@ static void weaponcommon_r(DDukeActor *proj) auto x = EGS(s->sectnum, s->x + MulScale(k, bcos(s->ang), 9), s->y + MulScale(k, bsin(s->ang), 9), - s->z + ((k * ksgn(s->zvel)) * abs(s->zvel / 24)), FIRELASER, -40 + (k << 2), + s->z + ((k * Sgn(s->zvel)) * abs(s->zvel / 24)), FIRELASER, -40 + (k << 2), s->xrepeat, s->yrepeat, 0, 0, 0, proj->GetOwner(), 5); x->s.cstat = 128; @@ -3447,7 +3447,7 @@ void handle_se06_r(DDukeActor *actor) { if (act2->temp_data[5] == 0) act2->temp_data[5] = dist(act2, actor); - int x = sgn(dist(act2, actor) - act2->temp_data[5]); + int x = Sgn(dist(act2, actor) - act2->temp_data[5]); if (act2->s.extra) x = -x; s->xvel += x; } @@ -3719,7 +3719,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel) if (ps[pnum].newOwner != nullptr) goalang = getangle(ps[pnum].oposx - spr->x, ps[pnum].oposy - spr->y); else goalang = getangle(ps[pnum].posx - spr->x, ps[pnum].posy - spr->y); - angdif = ksgn(getincangle(spr->ang, goalang)) << 5; + angdif = Sgn(getincangle(spr->ang, goalang)) << 5; if (angdif > -32 && angdif < 0) { angdif = 0; @@ -3735,7 +3735,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel) if (ps[pnum].newOwner != nullptr) goalang = (getangle(ps[pnum].oposx - spr->x, ps[pnum].oposy - spr->y) + 1024) & 2047; else goalang = (getangle(ps[pnum].posx - spr->x, ps[pnum].posy - spr->y) + 1024) & 2047; - angdif = ksgn(getincangle(spr->ang, goalang)) << 5; + angdif = Sgn(getincangle(spr->ang, goalang)) << 5; if (angdif > -32 && angdif < 0) { angdif = 0; diff --git a/source/games/duke/src/duke3d.h b/source/games/duke/src/duke3d.h index 34db4bd52..20af59207 100644 --- a/source/games/duke/src/duke3d.h +++ b/source/games/duke/src/duke3d.h @@ -4,7 +4,6 @@ #include "compat.h" -#include "pragmas.h" #include "polymost.h" #include "gamecvars.h" diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index b88b5f376..a7744cd83 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -1740,14 +1740,14 @@ int ParseState::parse(void) //if (!isPlutoPak() && *insptr == 0) *insptr = 4; j = ((*insptr) - g_sp->xrepeat) << 1; - g_sp->xrepeat += ksgn(j); + g_sp->xrepeat += Sgn(j); insptr++; if ((g_sp->picnum == TILE_APLAYER && g_sp->yrepeat < 36) || *insptr < g_sp->yrepeat || ((g_sp->yrepeat * (tileHeight(g_sp->picnum) + 8)) << 2) < (g_ac->floorz - g_ac->ceilingz)) { j = ((*insptr) - g_sp->yrepeat) << 1; - if (abs(j)) g_sp->yrepeat += ksgn(j); + if (abs(j)) g_sp->yrepeat += Sgn(j); } insptr++; diff --git a/source/games/duke/src/hudweapon_d.cpp b/source/games/duke/src/hudweapon_d.cpp index 30a38ccdf..ba6e3e0a8 100644 --- a/source/games/duke/src/hudweapon_d.cpp +++ b/source/games/duke/src/hudweapon_d.cpp @@ -942,7 +942,7 @@ void displayweapon_d(int snum, double smoothratio) { if (*kb < aplWeaponTotalTime[p->curr_weapon][snum]) { - i = sgn(*kb >> 2); + i = Sgn(*kb >> 2); if (p->ammo_amount[p->curr_weapon] & 1) { hud_drawpal(weapon_xoffset + 30 - look_anghalf, looking_arc + 240 - gun_pos, DEVISTATOR, shade, o | 4, pal); @@ -1003,7 +1003,7 @@ void displayweapon_d(int snum, double smoothratio) { char cycloidy[] = { 0,4,12,24,12,4,0 }; - i = sgn(*kb >> 2); + i = Sgn(*kb >> 2); if (p->hbomb_hold_delay) { diff --git a/source/games/duke/src/prediction.cpp b/source/games/duke/src/prediction.cpp index 01321d01e..61c03059a 100644 --- a/source/games/duke/src/prediction.cpp +++ b/source/games/duke/src/prediction.cpp @@ -406,8 +406,8 @@ void fakedomovethings(void) tempang = syn->avel<<1; if(psectlotag == 2) - myang += (tempang-(tempang>>3))*sgn(doubvel); - else myang += (tempang)*sgn(doubvel); + myang += (tempang-(tempang>>3))*Sgn(doubvel); + else myang += (tempang)*Sgn(doubvel); myang &= 2047; } diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index 8b3ebb8d8..5dc02bcfe 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -945,8 +945,8 @@ static void lotsofpopcorn(DDukeActor *actor, short wallnum, short n) xv = wall[wall[wallnum].point2].x - x1; yv = wall[wall[wallnum].point2].y - y1; - x1 -= ksgn(yv); - y1 += ksgn(xv); + x1 -= Sgn(yv); + y1 += Sgn(xv); xv /= j; yv /= j; diff --git a/source/games/duke/src/spawn.cpp b/source/games/duke/src/spawn.cpp index 21e93b875..b501c95d5 100644 --- a/source/games/duke/src/spawn.cpp +++ b/source/games/duke/src/spawn.cpp @@ -1146,8 +1146,8 @@ void lotsofglass(DDukeActor *actor, int wallnum, int n) xv = wall[wall[wallnum].point2].x - x1; yv = wall[wall[wallnum].point2].y - y1; - x1 -= sgn(yv); - y1 += sgn(xv); + x1 -= Sgn(yv); + y1 += Sgn(xv); xv /= j; yv /= j; diff --git a/source/sw/src/draw.cpp b/source/sw/src/draw.cpp index d95053e62..1fcce58b7 100644 --- a/source/sw/src/draw.cpp +++ b/source/sw/src/draw.cpp @@ -28,7 +28,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms #define QUIET #include "build.h" #include "automap.h" -#include "pragmas.h" #include "names2.h" diff --git a/source/sw/src/game.h b/source/sw/src/game.h index a09400f91..c816967c9 100644 --- a/source/sw/src/game.h +++ b/source/sw/src/game.h @@ -42,7 +42,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms #include "mytypes.h" #include "sounds.h" -#include "pragmas.h" #include "gamecvars.h" #include "raze_sound.h" #include "c_cvars.h" @@ -123,7 +122,6 @@ inline int RANDOM(void) #define PRINT(line,str) DebugPrint(line,str) -#include "pragmas.h" // // Map directions/degrees diff --git a/source/sw/src/interpso.cpp b/source/sw/src/interpso.cpp index e4c745295..cb5ef9e1c 100644 --- a/source/sw/src/interpso.cpp +++ b/source/sw/src/interpso.cpp @@ -27,7 +27,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms #include "ns.h" #include "compat.h" -#include "pragmas.h" #include "game.h" #include "interpso.h"