- [FIX] No guardava be els GIFs sense paleta

This commit is contained in:
2025-06-19 17:48:56 +02:00
parent 76e2925791
commit 0471bcbdda
2 changed files with 2 additions and 2 deletions

View File

@@ -8,7 +8,7 @@ function mini.init()
p = pal.load("logo.gif") p = pal.load("logo.gif")
pal.set(p) pal.set(p)
pal.trans(255) pal.trans(255)
surf.save(s, "prova.gif") --surf.save(s, "prova.gif", p)
end end
function mini.update() function mini.update()

View File

@@ -243,7 +243,7 @@ void savesurf(uint8_t surface, const char* filename, uint8_t *pal, uint8_t color
{ {
uint8_t depth=0; uint8_t depth=0;
do { colors = colors >> 1; depth++; } while (colors!=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); gif::gif_t *file = gif::create(filename, surfaces[surface].w, surfaces[surface].h, pal, (pal?depth:8), -1, -1);
memcpy(file->frame, surfaces[surface].p, surfaces[surface].w*surfaces[surface].h); memcpy(file->frame, surfaces[surface].p, surfaces[surface].w*surfaces[surface].h);
gif::addFrame(file, 0); gif::addFrame(file, 0);
gif::close(file); gif::close(file);