From 7a9f89b95d80b57978945bcd8692b9bce86ff7da Mon Sep 17 00:00:00 2001 From: Christoph Oelckers <coelckers@users.noreply.github.com> Date: Thu, 8 Sep 2022 01:10:39 +0200 Subject: [PATCH] - removed obsolete scripting exports. --- source/core/gamecontrol.cpp | 29 ------------------- wadsrc/static/zscript/games/duke/ui/menu.zs | 2 +- wadsrc/static/zscript/games/duke/ui/sbar_d.zs | 2 +- wadsrc/static/zscript/games/duke/ui/sbar_r.zs | 2 +- .../static/zscript/games/exhumed/ui/menu.zs | 2 +- .../static/zscript/games/exhumed/ui/sbar.zs | 2 +- wadsrc/static/zscript/games/sw/ui/sbar.zs | 2 +- wadsrc/static/zscript/razebase.zs | 4 +-- 8 files changed, 7 insertions(+), 38 deletions(-) diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index a8d130f6d..e9e03fb53 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -1519,35 +1519,6 @@ DEFINE_ACTION_FUNCTION(_Raze, PlayerName) ACTION_RETURN_STRING(unsigned(index) >= MAXPLAYERS ? "" : PlayerName(index)); } -DEFINE_ACTION_FUNCTION_NATIVE(_Raze, bsin, bsin) -{ - PARAM_PROLOGUE; - PARAM_INT(v); - PARAM_INT(shift); - ACTION_RETURN_INT(bsin(v, shift)); -} - -DEFINE_ACTION_FUNCTION_NATIVE(_Raze, bcos, bcos) -{ - PARAM_PROLOGUE; - PARAM_INT(v); - PARAM_INT(shift); - ACTION_RETURN_INT(bcos(v, shift)); -} - -int raze_getangle(double x, double y) -{ - return VecToAngle(x, y).Buildang(); -} - -DEFINE_ACTION_FUNCTION_NATIVE(_Raze, getangle, raze_getangle) -{ - PARAM_PROLOGUE; - PARAM_FLOAT(x); - PARAM_FLOAT(y); - ACTION_RETURN_INT(raze_getangle(x, y)); -} - DEFINE_ACTION_FUNCTION_NATIVE(_Raze, GetBuildTime, I_GetBuildTime) { ACTION_RETURN_INT(I_GetBuildTime()); diff --git a/wadsrc/static/zscript/games/duke/ui/menu.zs b/wadsrc/static/zscript/games/duke/ui/menu.zs index 69ff20ebf..18f55d06d 100644 --- a/wadsrc/static/zscript/games/duke/ui/menu.zs +++ b/wadsrc/static/zscript/games/duke/ui/menu.zs @@ -137,7 +137,7 @@ class ListMenuItemDukeLogo : ListMenuItem if (gameinfo.gametype & GAMEFLAG_PLUTOPAK) { let mclock = MSTimeF() * 120 / 1000; - int light = 223 + Raze.bsin(mclock * 16, -9); + int light = 223 + Raze.bsin(mclock * 16) >> 9; let pe = Color(255, light, light, light); Screen.DrawTexture(TexMan.CheckForTexture("MENUPLUTOPAKSPRITE"), false, x + 100, 36, DTA_FullscreenScale, FSMode_Fit320x200Top, DTA_Color, pe, DTA_CenterOffsetRel, true); } diff --git a/wadsrc/static/zscript/games/duke/ui/sbar_d.zs b/wadsrc/static/zscript/games/duke/ui/sbar_d.zs index 6e2f3df65..7e3b43a0c 100644 --- a/wadsrc/static/zscript/games/duke/ui/sbar_d.zs +++ b/wadsrc/static/zscript/games/duke/ui/sbar_d.zs @@ -147,7 +147,7 @@ class DukeStatusBar : DukeCommonStatusBar { int s = -8; if (hud_flashing && p.last_extra > Duke.MaxPlayerHealth()) - s += Raze.bsin(Raze.GetBuildTime() << 5, -10); + s += Raze.bsin(Raze.GetBuildTime() << 5) >> 10; int intens = clamp(255 - 6 * s, 0, 255); format = String.Format("%d", p.last_extra); DrawString(numberFont, format, (25, texty), DI_TEXT_ALIGN_LEFT, Font.CR_UNTRANSLATED, intens / 255., 0, 0); diff --git a/wadsrc/static/zscript/games/duke/ui/sbar_r.zs b/wadsrc/static/zscript/games/duke/ui/sbar_r.zs index d215c3992..35cbd0c6a 100644 --- a/wadsrc/static/zscript/games/duke/ui/sbar_r.zs +++ b/wadsrc/static/zscript/games/duke/ui/sbar_r.zs @@ -94,7 +94,7 @@ class RedneckStatusBar : DukeCommonStatusBar { int s = -8; if (hud_flashing && p.last_extra > Duke.MaxPlayerHealth()) - s += Raze.bsin(Raze.GetBuildTime() << 5, -10); + s += Raze.bsin(Raze.GetBuildTime() << 5) >> 10; int intens = clamp(255 - 6 * s, 0, 255); format = String.Format("%d", p.last_extra); DrawString(numberFont, format, (26.5, -numberFont.mFont.GetHeight() * scale + 4), DI_TEXT_ALIGN_LEFT, Font.CR_UNTRANSLATED, intens / 255., 0, 0, (scale, scale)); diff --git a/wadsrc/static/zscript/games/exhumed/ui/menu.zs b/wadsrc/static/zscript/games/exhumed/ui/menu.zs index 51410eafa..a4bab15b7 100644 --- a/wadsrc/static/zscript/games/exhumed/ui/menu.zs +++ b/wadsrc/static/zscript/games/exhumed/ui/menu.zs @@ -110,7 +110,7 @@ class ListMenuItemExhumedTextItem : ListMenuItemTextItem double y = mYpos + v.y / 2; int shade; - if (selected) shade = Raze.bsin(now * 16 * 120 / 1000, -9); + if (selected) shade = Raze.bsin(now * 16 * 120 / 1000) >> 9; else if (Selectable()) shade = 0; else shade = 25; let color = Raze.shadeToLight(shade); diff --git a/wadsrc/static/zscript/games/exhumed/ui/sbar.zs b/wadsrc/static/zscript/games/exhumed/ui/sbar.zs index c0cc54e29..8545c8729 100644 --- a/wadsrc/static/zscript/games/exhumed/ui/sbar.zs +++ b/wadsrc/static/zscript/games/exhumed/ui/sbar.zs @@ -259,7 +259,7 @@ class ExhumedStatusBar : RazeStatusBar { int s = -8; if (hud_flashing && pp.nHealth > 800) - s += Raze.bsin(PlayClock << 5, -10); + s += Raze.bsin(PlayClock << 5) >> 10; int intens = clamp(255 - 4 * s, 0, 255); format = String.Format("%d", pp.nHealth >> 3); DrawString(numberFont, format, (13, -numberFont.mFont.GetHeight() + 3), DI_TEXT_ALIGN_LEFT, Font.CR_UNTRANSLATED, intens / 255.); diff --git a/wadsrc/static/zscript/games/sw/ui/sbar.zs b/wadsrc/static/zscript/games/sw/ui/sbar.zs index f3feb4f6b..ef61e1d2d 100644 --- a/wadsrc/static/zscript/games/sw/ui/sbar.zs +++ b/wadsrc/static/zscript/games/sw/ui/sbar.zs @@ -751,7 +751,7 @@ class SWStatusBar : RazeStatusBar { int s = -8; if (hud_flashing && Health > MaxHealth) - s += Raze.bsin(PlayClock << 5, -10); + s += Raze.bsin(PlayClock << 5) >> 10; int intens = clamp(255 - 4 * s, 0, 255); let pe = Color(255, intens, intens, intens); format = String.Format("%d", Health); diff --git a/wadsrc/static/zscript/razebase.zs b/wadsrc/static/zscript/razebase.zs index 33e715112..426b935b9 100644 --- a/wadsrc/static/zscript/razebase.zs +++ b/wadsrc/static/zscript/razebase.zs @@ -142,9 +142,7 @@ struct Raze native static Color shadeToLight(int shade); native static String PlayerName(int i); - native static int bsin(int angle, int shift = 0); - native static int bcos(int angle, int shift = 0); - native static int getangle(double x, double y); + static int bsin(int angle) { return int(sin(angle * (360. / 2048)) * 16384); } native static TextureID PickTexture(TextureID texid); native static int GetBuildTime(); native static Font PickBigFont(String cmptext = "");