From 2d1fa497737f798e3d5c2b812c33320548167881 Mon Sep 17 00:00:00 2001 From: "Evgeny Grechnikov (Diamond)" Date: Mon, 7 Sep 2009 20:40:12 +0000 Subject: [PATCH] libimg: small fix in 8bpp -> 24bpp translation git-svn-id: svn://kolibrios.org@1152 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/develop/libraries/libs-dev/libimg/libimg.asm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/programs/develop/libraries/libs-dev/libimg/libimg.asm b/programs/develop/libraries/libs-dev/libimg/libimg.asm index 45c093ad26..95cfc179ba 100644 --- a/programs/develop/libraries/libs-dev/libimg/libimg.asm +++ b/programs/develop/libraries/libs-dev/libimg/libimg.asm @@ -225,6 +225,8 @@ align 16 push ebx mov ebx, [esi + Image.Palette] mov esi, [esi + Image.Data] + sub ecx, 1 + jz .bpp8.last @@: movzx eax, byte [esi] add esi, 1 @@ -233,6 +235,12 @@ align 16 add edi, 3 sub ecx, 1 jnz @b +.bpp8.last: + movzx eax, byte [esi] + mov eax, [ebx + eax*4] + mov [edi], ax + shr eax, 16 + mov [edi+2], al pop ebx ret @@ -1709,7 +1717,7 @@ align 4 export \ lib_init , 'lib_init' , \ - 0x00050005 , 'version' , \ + 0x00050006 , 'version' , \ img.is_img , 'img_is_img' , \ img.info , 'img_info' , \ img.from_file , 'img_from_file' , \