Merge pull request #237 from Clownacy/master

[SDL] Fixes for SDL, and a fix for building under MinGW-w64
This commit is contained in:
ekeeke 2018-07-10 14:07:01 +02:00 committed by GitHub
commit 3f6560ab7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 12 deletions

View File

@ -53,7 +53,7 @@
#define fseeko _fseeki64
#define ftello _ftelli64
#else /* MinGW */
#if !defined(HAVE_FSEEKO)
#if !defined(HAVE_FSEEKO) && !defined(__MINGW64_VERSION_MAJOR)
#define fseeko fseeko64
#define ftello ftello64
#endif

View File

@ -28,7 +28,7 @@
NAME = gen_sdl
CC = gcc
CFLAGS = `sdl-config --cflags` -march=native -O6 -fomit-frame-pointer -Wall -Wno-strict-aliasing -ansi -std=c99 -pedantic-errors
CFLAGS = `sdl-config --cflags` -march=native -O6 -fomit-frame-pointer -Wall -Wno-strict-aliasing -std=c99 -pedantic-errors
#-g -ggdb -pg
#-fomit-frame-pointer
#LDFLAGS = -pg

View File

@ -28,7 +28,7 @@
NAME = gen_sdl2
CC = gcc
CFLAGS = `sdl2-config --cflags` -march=native -O6 -fomit-frame-pointer -Wall -Wno-strict-aliasing -ansi -std=c99 -pedantic-errors
CFLAGS = `sdl2-config --cflags` -march=native -O6 -fomit-frame-pointer -Wall -Wno-strict-aliasing -std=c99 -pedantic-errors
#-g -ggdb -pg
#-fomit-frame-pointer
#LDFLAGS = -pg

View File

@ -244,10 +244,7 @@ static void sdl_video_update()
static void sdl_video_close()
{
if (sdl_video.surf_bitmap)
SDL_FreeSurface(sdl_video.surf_bitmap);
if (sdl_video.surf_screen)
SDL_FreeSurface(sdl_video.surf_screen);
}
/* Timer Sync */

View File

@ -150,7 +150,7 @@ static int sdl_video_init()
}
sdl_video.window = SDL_CreateWindow("Genesis Plus GX", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, VIDEO_WIDTH, VIDEO_HEIGHT, fullscreen);
sdl_video.surf_screen = SDL_GetWindowSurface(sdl_video.window);
sdl_video.surf_bitmap = SDL_CreateRGBSurfaceWithFormat(SDL_SWSURFACE, 720, 576, SDL_BITSPERPIXEL(surface_format), surface_format);
sdl_video.surf_bitmap = SDL_CreateRGBSurfaceWithFormat(0, 720, 576, SDL_BITSPERPIXEL(surface_format), surface_format);
sdl_video.frames_rendered = 0;
SDL_ShowCursor(0);
return 1;
@ -250,10 +250,8 @@ static void sdl_video_update()
static void sdl_video_close()
{
if (sdl_video.surf_bitmap)
SDL_FreeSurface(sdl_video.surf_bitmap);
if (sdl_video.surf_screen)
SDL_FreeSurface(sdl_video.surf_screen);
SDL_DestroyWindow(sdl_video.window);
}
/* Timer Sync */