- [ONGOING] A meitat de arreglar el bug del guardat de GIFs
This commit is contained in:
@@ -8,6 +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")
|
||||||
end
|
end
|
||||||
|
|
||||||
function mini.update()
|
function mini.update()
|
||||||
|
|||||||
4
mini.cpp
4
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)
|
void savesurf(uint8_t surface, const char* filename, uint8_t *pal, uint8_t colors)
|
||||||
{
|
{
|
||||||
uint8_t depth=colors;
|
uint8_t depth=0;
|
||||||
do { depth = depth >> 1; } while (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);
|
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);
|
memcpy(file->frame, surfaces[surface].p, surfaces[surface].w*surfaces[surface].h);
|
||||||
gif::addFrame(file, 0);
|
gif::addFrame(file, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user