From f114edae9a6a84c1b618dd36c4e4a73c39c6abb8 Mon Sep 17 00:00:00 2001 From: Lizzy Fleckenstein Date: Sun, 12 Apr 2026 21:24:29 +0200 Subject: fmt/nut: remove unused test code --- src/fmt/nut.c | 53 ----------------------------------------------------- 1 file changed, 53 deletions(-) (limited to 'src/fmt') 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 -#include -#include - -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); -}*/ -- cgit v1.2.3