emu: SDL style fixes
These should be quite obvious and will make the SDL2 patch easier to read then doing it inline there. Signed-off-by: Julian Andres Klode <julian.klode@canonical.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
parent
afdef4a563
commit
d131335d4e
@ -1613,7 +1613,7 @@ AC_CHECK_LIB([SDL], [SDL_Init], [LIBSDL="-lSDL"],
|
|||||||
[fi]
|
[fi]
|
||||||
|
|
||||||
if test x"enable_grub_emu_sdl" = xyes && test x"$grub_emu_sdl_excuse" != x ; then
|
if test x"enable_grub_emu_sdl" = xyes && test x"$grub_emu_sdl_excuse" != x ; then
|
||||||
AC_MSG_ERROR([SDL support for grub-emu was explicitly requested but can't be compiled ($grub_emu_sdl_excuse)])
|
AC_MSG_ERROR([SDL support for grub-emu was explicitly requested but can't be compiled ($grub_emu_sdl_excuse)])
|
||||||
fi
|
fi
|
||||||
if test x"$grub_emu_sdl_excuse" = x ; then
|
if test x"$grub_emu_sdl_excuse" = x ; then
|
||||||
enable_grub_emu_sdl=yes
|
enable_grub_emu_sdl=yes
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
GRUB_MOD_LICENSE ("GPLv3+");
|
GRUB_MOD_LICENSE ("GPLv3+");
|
||||||
|
|
||||||
static SDL_Surface *window = 0;
|
static SDL_Surface *window = NULL;
|
||||||
static struct grub_video_render_target *sdl_render_target;
|
static struct grub_video_render_target *sdl_render_target;
|
||||||
static struct grub_video_mode_info mode_info;
|
static struct grub_video_mode_info mode_info;
|
||||||
|
|
||||||
@ -40,10 +40,10 @@ grub_video_sdl_set_palette (unsigned int start, unsigned int count,
|
|||||||
static grub_err_t
|
static grub_err_t
|
||||||
grub_video_sdl_init (void)
|
grub_video_sdl_init (void)
|
||||||
{
|
{
|
||||||
window = 0;
|
window = NULL;
|
||||||
|
|
||||||
if (SDL_Init (SDL_INIT_VIDEO) < 0)
|
if (SDL_Init (SDL_INIT_VIDEO) < 0)
|
||||||
return grub_error (GRUB_ERR_BAD_DEVICE, "Couldn't init SDL: %s",
|
return grub_error (GRUB_ERR_BAD_DEVICE, "could not init SDL: %s",
|
||||||
SDL_GetError ());
|
SDL_GetError ());
|
||||||
|
|
||||||
grub_memset (&mode_info, 0, sizeof (mode_info));
|
grub_memset (&mode_info, 0, sizeof (mode_info));
|
||||||
@ -55,7 +55,7 @@ static grub_err_t
|
|||||||
grub_video_sdl_fini (void)
|
grub_video_sdl_fini (void)
|
||||||
{
|
{
|
||||||
SDL_Quit ();
|
SDL_Quit ();
|
||||||
window = 0;
|
window = NULL;
|
||||||
|
|
||||||
grub_memset (&mode_info, 0, sizeof (mode_info));
|
grub_memset (&mode_info, 0, sizeof (mode_info));
|
||||||
|
|
||||||
@ -96,10 +96,10 @@ grub_video_sdl_setup (unsigned int width, unsigned int height,
|
|||||||
flags |= SDL_DOUBLEBUF;
|
flags |= SDL_DOUBLEBUF;
|
||||||
|
|
||||||
window = SDL_SetVideoMode (width, height, depth, flags | SDL_HWSURFACE);
|
window = SDL_SetVideoMode (width, height, depth, flags | SDL_HWSURFACE);
|
||||||
if (! window)
|
if (window == NULL)
|
||||||
window = SDL_SetVideoMode (width, height, depth, flags | SDL_SWSURFACE);
|
window = SDL_SetVideoMode (width, height, depth, flags | SDL_SWSURFACE);
|
||||||
if (! window)
|
if (window == NULL)
|
||||||
return grub_error (GRUB_ERR_BAD_DEVICE, "Couldn't open window: %s",
|
return grub_error (GRUB_ERR_BAD_DEVICE, "could not open window: %s",
|
||||||
SDL_GetError ());
|
SDL_GetError ());
|
||||||
|
|
||||||
grub_memset (&sdl_render_target, 0, sizeof (sdl_render_target));
|
grub_memset (&sdl_render_target, 0, sizeof (sdl_render_target));
|
||||||
@ -191,7 +191,7 @@ static grub_err_t
|
|||||||
grub_video_sdl_swap_buffers (void)
|
grub_video_sdl_swap_buffers (void)
|
||||||
{
|
{
|
||||||
if (SDL_Flip (window) < 0)
|
if (SDL_Flip (window) < 0)
|
||||||
return grub_error (GRUB_ERR_BAD_DEVICE, "couldn't swap buffers: %s",
|
return grub_error (GRUB_ERR_BAD_DEVICE, "could not swap buffers: %s",
|
||||||
SDL_GetError ());
|
SDL_GetError ());
|
||||||
return GRUB_ERR_NONE;
|
return GRUB_ERR_NONE;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user