MantisBT - Zandronum
View Issue Details
0004471Zandronum[All Projects] Suggestionpublic2025-03-22 12:392025-03-22 14:07
IlyStr 
 
normalfeatureN/A
confirmedbackport later 
MicrosoftWindowsXP/Vista/7
4.0-beta 
 
0004471: Add more math functions to Decorate
I mean

FRandomPick(float[]), RandomPick(int[]),

Cos(float), Sin(float), Tan(float),

ACos(float), ASin(float), ATan(float),

ATan2(float, float) [Alias: VectorAngle(float, float)],

Round(float), Ceil(float), Floor(float),

Min(float[]), Max(float[]), Clamp(float, float, float).

I think it will be easy to implement these functions in Decorate, because C\C++ already has libraries that calculate these functions (except #randompick(#[])).
No tags attached.
Issue History
2025-03-22 12:39IlyStrNew Issue
2025-03-22 13:17IlyStrNote Added: 0024290
2025-03-22 13:20IlyStrNote Edited: 0024290bug_revision_view_page.php?bugnote_id=24290#r14489
2025-03-22 14:07KaminskyNote Added: 0024292
2025-03-22 14:07KaminskyStatusnew => confirmed
2025-03-22 14:07KaminskyResolutionopen => backport later

Notes
(0024290)
IlyStr   
2025-03-22 13:17   
(edited on: 2025-03-22 13:20)
And RandomPick is actually many times more necessary than trigonometry and rounding, because here is a comparison of the same function but only using RandomPick and Random

GZdoom: RandomPick(64, 192)
Za: (128 + ((Random(0, 1)*2)-1)*64)

And this way every function call imitation, the optimization after 3-8 repeats per tic goes somewhere far away...

(0024292)
Kaminsky   
2025-03-22 14:07   
This won't happen until we upgrade our GZDoom base and backport these functions, which won't be until at least 4.0 or later.