Integrated the changes by PheeL for Caanoo support

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1629 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2010-09-29 22:21:25 +00:00
parent dbac6dcfe3
commit bd13dd93b1
12 changed files with 405 additions and 62 deletions

View File

@@ -2,6 +2,7 @@
*/
/* Grafx2 - The Ultimate 256-color bitmap paint program
Copyright 2010 A Filyanov
Copyright 2009 Petter Lindquist
Copyright 2008 Yves Rizoud
Copyright 2008 Franck Charlet
@@ -652,7 +653,7 @@ void Load_image(T_IO_Context *context)
case CONTEXT_SURFACE:
if (Convert_24b_bitmap_to_256(context->Surface->pixels,context->Buffer_image_24b,context->Width,context->Height,context->Palette))
File_error=1;
File_error=1;
break;
}
@@ -977,8 +978,30 @@ void Load_SDL_Image(T_IO_Context *context)
}
else
{
// Hi/Trucolor
Pre_load(context, surface->w, surface->h, file_size ,FORMAT_ALL_IMAGES, PIXEL_SIMPLE, 1);
{
// Hi/Trucolor
///Sorry, but i give up! It needs a hard debug. So, a simply workaround here. Unfortunately it doubling memory usage by conversion surface :(
#if defined(__WIZ__) || defined(__CAANOO__)
SDL_Surface *pNewSurface;
SDL_PixelFormat pixfmt;
#endif
Pre_load(context, surface->w, surface->h, file_size ,FORMAT_ALL_IMAGES, PIXEL_SIMPLE, 1);
#if defined(__WIZ__) || defined(__CAANOO__)
memcpy(&pixfmt, surface->format, sizeof(SDL_PixelFormat));
pixfmt.BitsPerPixel = 32;
pixfmt.BytesPerPixel = 4;
pNewSurface = SDL_ConvertSurface(surface, &pixfmt, SDL_SWSURFACE);
if (pNewSurface == NULL)
{
File_error=1;
return;
}
SDL_FreeSurface(surface);
surface = pNewSurface;
#endif
}
for (y_pos=0; y_pos<context->Height; y_pos++)
{