From 76e2925791f1172e4bb2458d67c5f69dc2ee7e19 Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Thu, 19 Jun 2025 13:56:44 +0200 Subject: [PATCH] - [ONGOING] A meitat de arreglar el bug del guardat de GIFs --- data/main.lua | 1 + mini.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/data/main.lua b/data/main.lua index dd0ded3..2d41eab 100644 --- a/data/main.lua +++ b/data/main.lua @@ -8,6 +8,7 @@ function mini.init() p = pal.load("logo.gif") pal.set(p) pal.trans(255) + surf.save(s, "prova.gif") end function mini.update() diff --git a/mini.cpp b/mini.cpp index 56d7679..d94e846 100644 --- a/mini.cpp +++ b/mini.cpp @@ -241,8 +241,8 @@ uint8_t loadsurf(const char* filename) { void savesurf(uint8_t surface, const char* filename, uint8_t *pal, uint8_t colors) { - uint8_t depth=colors; - do { depth = depth >> 1; } while (depth!=0); + uint8_t depth=0; + do { colors = colors >> 1; depth++; } while (colors!=0); gif::gif_t *file = gif::create(filename, surfaces[surface].w, surfaces[surface].h, pal, (pal?depth:0), -1, -1); memcpy(file->frame, surfaces[surface].p, surfaces[surface].w*surfaces[surface].h); gif::addFrame(file, 0);