From 64cb7589e85351fe18ba48a0b10c4c045381c2f6 Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Sun, 22 Jan 2023 00:46:28 +0100 Subject: [PATCH] Make alpha cube root faster by declaring LUT as "static const". --- language.version | 4 ++-- zscript/swwm_common_fx.zsc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/language.version b/language.version index 8a07d55a2..ce24c6bfc 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r745 \cu(Sat 21 Jan 01:09:46 CET 2023)\c-"; -SWWM_SHORTVER="\cw1.3pre r745 \cu(2023-01-21 01:09:46)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r746 \cu(Sun 22 Jan 00:46:28 CET 2023)\c-"; +SWWM_SHORTVER="\cw1.3pre r746 \cu(2023-01-22 00:46:28)\c-"; diff --git a/zscript/swwm_common_fx.zsc b/zscript/swwm_common_fx.zsc index eeda44ee1..968e9bd29 100644 --- a/zscript/swwm_common_fx.zsc +++ b/zscript/swwm_common_fx.zsc @@ -984,7 +984,7 @@ Class SWWMPickupFlash : SWWMNonInteractiveActor // needed since cube roots scale very badly when there's thousands of these on the map private static double AlphaCubeRoot( double alpha ) { - double lut[256] = + static const double lut[] = { 0.000000000, 0.250244738, 0.297592823, 0.329340597, 0.353899503, 0.374203165, 0.391654181, 0.407042226, 0.420859807, 0.433436601, 0.445005066, 0.455735780, 0.465757939, 0.475171947, 0.484057512, 0.492479061,