This commit is contained in:
2026-09-16 20:53:06 +02:00
parent 1697016838
commit b2b9ee6946
4 changed files with 7 additions and 6 deletions
+2 -2
View File
@@ -39,8 +39,8 @@ void init() {
void render_frame(double dt) {
time += dt;
double x = 0.5 + __builtin_cos(2.0 * PI / 10.0 * time) * 0.5;
double y = 0.5 + __builtin_sin(2.0 * PI / 10.0 * time) * 0.5;
double x = 0.5 + cos(2.0 * PI / 10.0 * time) * 0.5;
double y = 0.5 + sin(2.0 * PI / 10.0 * time) * 0.5;
pos.x = x * (WIDTH - SQ_SIZE);
pos.y = y * (HEIGHT - SQ_SIZE);
+1 -1
View File
@@ -51,7 +51,7 @@ async function init() {
instance.exports.render_frame(dt);
ctx.putImageData(image, 0, 0);
window.requestAnimationFrame(render);
};
};
window.requestAnimationFrame(render);
}
+3 -3
View File
@@ -1,6 +1,6 @@
#include "math.h"
// Definition of math functions needed for fdlibm
inline double fabs(double x) { return __builtin_fabs(x); }
inline double floor(double x) { return __builtin_floor(x); }
inline double copysign(double x, double y) { return __builtin_copysign(x, y); }
double fabs(double x) { return __builtin_fabs(x); }
double floor(double x) { return __builtin_floor(x); }
double copysign(double x, double y) { return __builtin_copysign(x, y); }
+1
View File
@@ -5,6 +5,7 @@
double fabs(double x);
double floor(double x);
double copysign(double x, double y);
// Provided by fdlibm
double cos(double x);
double sin(double x);