From 6dfbeb241907868b97a0dfbe4559f07876698c4a Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Tue, 17 Oct 2017 03:08:33 -0200 Subject: [PATCH] Disables 256-color image loading again, until a better solution is found. Returns -1 if there's an attempt to load an image in 256-color mode. --- internal/c/parts/video/image/src.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/internal/c/parts/video/image/src.c b/internal/c/parts/video/image/src.c index e0bcabaec..f7d605463 100644 --- a/internal/c/parts/video/image/src.c +++ b/internal/c/parts/video/image/src.c @@ -30,7 +30,9 @@ if ((bpp!=32)&&(bpp!=256)){error(5); return 0;} if (write_page->text){error(5); return 0;} bpp=-1; } -if (!f->len) return -1;//return invalid handle if null length string +if (!f->len) return -1; //return invalid handle if null length string +if (bpp==256) return -1; //return invalid handle if 256-color mode requested (not valid in this version) + //load the file int32 fh,result = 0; int64 lof; @@ -89,28 +91,10 @@ static int32 prevDest; static uint16 scanX, scanY; static uint8 red, green, blue; -if (bpp==256) { - i=func__newimage(x,y,256,1); - if (i==-1){free(pixels); return -1;} - prevDest=func__dest(); - sub__dest(i); +i=func__newimage(x,y,32,1); +if (i==-1){free(pixels); return -1;} +memcpy(img[-i].offset,pixels,x*y*4); - for (scanY=0;scanY