Was meint ihr dazu?
Why not. Können wir gerne testen.
Apropos testen:
AutoIt
#AutoIt3Wrapper_UseX64=y
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include "..\JIT.au3"
AutoItSetOption("GUIOnEventMode", 1)
Global $hCRT = DllCall("kernel32.dll", "handle", "LoadLibraryW", "wstr", "ucrtbase.dll")[0]
Global $pSin = DllCall("kernel32.dll", "ptr", "GetProcAddress", "handle", $hCRT, "str", "sin")[0]
Global $pCos = DllCall("kernel32.dll", "ptr", "GetProcAddress", "handle", $hCRT, "str", "cos")[0]
Global $pPow = DllCall("kernel32.dll", "ptr", "GetProcAddress", "handle", $hCRT, "str", "pow")[0]
If Not $pSin Or Not $pCos Or Not $pPow Then Exit MsgBox(16, "Fehler", "Math-Pointer nicht gefunden!")
Global $sCode = _
'typedef double (*MathFn1)(double);' & @LF & _
'typedef double (*MathFn2)(double, double);' & @LF & _
'CALLCONV void RenderDwitter(unsigned int* ptr, int iW, int iH,' & @LF & _
' MathFn1 fsin, MathFn1 fcos, MathFn2 fpow, double t) {' & @LF & _
' int i, px, py;' & @LF & _
' double y, k, e, d, q, P;' & @LF & _
' int l = 840, l1 = (l >> 1), l2 = (l >> 2);' & @LF & _
' for (i = iW * iH - 1; i--;) ptr[i] = 0xF0202020;' & @LF & _
' for (i = 20000; i-- > 0; ) {' & @LF & _
' y = (double)i / l;' & @LF & _
' k = (4.0 + fsin(y * 2.0 - t) * 3.0) * fcos((double)i / 29.0);' & @LF & _
' e = y / 8.0 - 11.0;' & @LF & _
' d = fpow(k * k + e * e, 0.66);' & @LF & _
' q = fsin(k * 2.0) + 0.3 / k + fsin(y / 25.0) * k * (9.0 + 4.0 * fsin(e * 9.0 - d * 3.0 + t * 2.0));' & @LF & _
' P = d - t;' & @LF & _
' px = (int)(q * fsin(P) + d * 39.0 - l1);' & @LF & _
' py = (int)(q + 30.0 * fcos(P) + l2);' & @LF & _
' if (px >=0 && px < iW && py >=0 && py <iH)' & @LF & _
' ptr[py * iW + px] = 0xB0FFFFFF;' & @LF & _
' }' & @LF & _
'}'
Global $mCode = _JIT_Compile($sCode, (@AutoItX64 ? "-O3 -ffloat-store" : "-Ofast"))
If @error Then Exit MsgBox(16, "Fehler", "Kompilierung fehlgeschlagen")
_GDIPlus_Startup()
Global $iW = 840, $iH = Int($iW * 9 / 16)
Global $pScan0 = DllStructCreate("ulong rgba[" & $iW * $iH & "]")
Global $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH, $GDIP_PXF32ARGB, $iW * 4, $pScan0)
Global $hGUI = GUICreate("JIT Render https://dwitter.net/d/33997", $iW, $iH)
GUISetState(@SW_SHOW)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
Global $hGfx = _GDIPlus_GraphicsCreateFromHWND($hGUI)
Global $fT = 0.0, $bExit
Do
DllCallAddress("none", $mCode.ptr + $mCode.Funcs["RenderDwitter"], "ptr", DllStructGetPtr($pScan0), _
"int", $iW, _
"int", $iH, _
"ptr", $pSin, _
"ptr", $pCos, _
"ptr", $pPow, _
"double", $fT)
_GDIPlus_GraphicsDrawImageRect($hGfx, $hBitmap, 0, 0, $iW, $iH)
$fT += 0.05
If $bExit Then ExitLoop
Until Not Sleep(10)
_GDIPlus_GraphicsDispose($hGfx)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_Shutdown()
_JIT_Free($mCode)
Func _Exit()
$bExit = True
EndFunc ;==>_Exit_About
Alles anzeigen
Das sollte unter x86 und x64 laufen. Bitte mal testen.
Original JS Code:
Java
l = c.width = 840;
for (i = 2e4; i--; )
y = i / l,
k = (4 + S(y * 2 - t) * 3) * C(i / 29),
e = y / 8 - 11,
d = (k * k + e * e)**0.66,
q = S(k * 2) + 0.3 / k + S(y / 25) * k * (9 + 4 * S(e * 9 - d * 3 + t * 2)),
P = d - t,
px = q * S(P) + d * 39 - l / 2,
py = q + 30 * C(P) + l / 4,
x.fillRect(px, py, 1, 1)
Alles anzeigen