Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Avoid C99 code. Amiga's system_directory_delete was broken.
  • Loading branch information
polluks committed Dec 13, 2017
1 parent ad2bb8a commit 30cee84
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
3 changes: 2 additions & 1 deletion plugins/ch376/ch376.c
Expand Up @@ -29,6 +29,7 @@

#include <proto/exec.h>
#include <proto/dos.h>
#include <string.h>

extern struct Library *SysBase;

Expand Down Expand Up @@ -544,7 +545,7 @@ static CH376_BOOL system_directory_delete(CH376_CONTEXT *context, CH376_LOCK roo
dbg_printf("system_directory_delete: %s\n", root_lock);

if(root_lock)
return (DeleteFile(file_name) != 0);
return (DeleteFile(root_lock) != 0);

return CH376_FALSE;
}
Expand Down
24 changes: 13 additions & 11 deletions system_sdl.c
Expand Up @@ -401,18 +401,19 @@ SDL_Surface * flipVert(SDL_Surface* sfc)
sfc->format->BytesPerPixel * 8, sfc->format->Rmask, sfc->format->Gmask,
sfc->format->Bmask, sfc->format->Amask);

if (result == NULL) return NULL;

Uint8* pixels = (Uint8*) sfc->pixels;
Uint8* rpixels = (Uint8*) result->pixels;
if (result)
{
Uint8* pixels = (Uint8*) sfc->pixels;
Uint8* rpixels = (Uint8*) result->pixels;

Uint32 pitch = sfc->pitch;
Uint32 pxlength = pitch*sfc->h;
Uint32 pitch = sfc->pitch;
Uint32 pxlength = pitch*sfc->h;

for(line = 0; line < sfc->h; ++line)
{
Uint32 pos = line * pitch;
memcpy(&rpixels[pos], &pixels[(pxlength-pos)-pitch], pitch);
for(line = 0; line < sfc->h; ++line)
{
Uint32 pos = line * pitch;
memcpy(&rpixels[pos], &pixels[(pxlength-pos)-pitch], pitch);
}
}

return result;
Expand All @@ -427,6 +428,7 @@ void SDL_COMPAT_TakeScreenshot(char *fname)
// Juste pour recuperer les dimensions :/
int g_width = g_screen->w;
int g_height = g_screen->h;
SDL_Surface *flip;

// 24 Bits
SDL_Surface *surf = SDL_CreateRGBSurface(SDL_SWSURFACE, g_width, g_height, 24, RMASK, GMASK, BMASK, 0);
Expand All @@ -436,7 +438,7 @@ void SDL_COMPAT_TakeScreenshot(char *fname)
//SDL_Surface *surf = SDL_CreateRGBSurface(SDL_SWSURFACE, g_width, g_height, 32, RMASK, GMASK, BMASK, AMASK);
//glReadPixels(0, 0, g_width, g_height, GL_RGBA, GL_UNSIGNED_BYTE, surf->pixels);

SDL_Surface *flip = flipVert(surf);
flip = flipVert(surf);
SDL_SaveBMP(flip, fname);

SDL_FreeSurface(flip);
Expand Down

0 comments on commit 30cee84

Please sign in to comment.