diff options
| author | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2026-04-12 21:24:29 +0200 |
|---|---|---|
| committer | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2026-04-12 21:24:29 +0200 |
| commit | f114edae9a6a84c1b618dd36c4e4a73c39c6abb8 (patch) | |
| tree | b54a36a7c8c8c69259228cb1522a0726f922fb43 /src | |
| parent | 171ee405f9e4a390fb760b72daa9ff8015c89e2a (diff) | |
| download | animtool-f114edae9a6a84c1b618dd36c4e4a73c39c6abb8.tar.xz | |
fmt/nut: remove unused test code
Diffstat (limited to 'src')
| -rw-r--r-- | src/fmt/nut.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/src/fmt/nut.c b/src/fmt/nut.c index f9ca9fd..886a054 100644 --- a/src/fmt/nut.c +++ b/src/fmt/nut.c @@ -254,56 +254,3 @@ void nut_write_end(struct nut_writer *wr) free(index.ptr); } - -/* -#include <inttypes.h> -#include <unistd.h> -#include <time.h> - -int main() -{ - unsigned int fps = 20; - unsigned int size[2] = { 200, 200 }; - - //FILE *f = fopen("test.nut", "wb"); - //if (!f) { - // fprintf(stderr, "failed to open output\n"); - // return EXIT_FAILURE; - //} - - struct nut_writer writer; - nut_write_start(&writer, stdout, fps, size); - - struct timespec ts; - clock_gettime(CLOCK_REALTIME, &ts); - - size_t n_pixels = size[0] * size[1]; - size_t frame_size = n_pixels * 4; - void *frame_buf = malloc(frame_size); - - for (unsigned int stage = 0;; stage++) { - uint32_t color = htole32((0xff << 24) | (0xff << ((stage%3)*8))); - for (size_t i = 0; i < n_pixels; i++) - ((uint32_t *)frame_buf)[i] = color; - for (unsigned int frame = 0; frame < fps; frame++) { - struct timespec ts_now; - clock_gettime(CLOCK_REALTIME, &ts_now); - - double e_time = (double) (ts_now.tv_nsec - ts.tv_nsec) / 1000000000.0 + - (ts_now.tv_sec - ts.tv_sec); - double p_time = stage + (double) frame / fps; - double ahead = p_time - e_time - 5.0; - if (ahead > 0.0) - usleep(ahead * 1000000.0); - - nut_write_frame(&writer, frame_buf); - } - } - free(frame_buf); - - nut_write_end(&writer); - - fflush(stdout); - - //fclose(f); -}*/ |
