Merge pull request #407 from SnowyMouse/master
Handle missing background.bmp
This commit is contained in:
commit
2f2e469790
@ -1160,6 +1160,12 @@ void run_gui(bool is_running)
|
|||||||
static SDL_Surface *converted_background = NULL;
|
static SDL_Surface *converted_background = NULL;
|
||||||
if (!converted_background) {
|
if (!converted_background) {
|
||||||
SDL_Surface *background = SDL_LoadBMP(resource_path("background.bmp"));
|
SDL_Surface *background = SDL_LoadBMP(resource_path("background.bmp"));
|
||||||
|
|
||||||
|
/* Create a blank background if background.bmp could not be loaded */
|
||||||
|
if (!background) {
|
||||||
|
background = SDL_CreateRGBSurface(0, 160, 144, 8, 0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
SDL_SetPaletteColors(background->format->palette, gui_palette, 0, 4);
|
SDL_SetPaletteColors(background->format->palette, gui_palette, 0, 4);
|
||||||
converted_background = SDL_ConvertSurface(background, pixel_format, 0);
|
converted_background = SDL_ConvertSurface(background, pixel_format, 0);
|
||||||
SDL_LockSurface(converted_background);
|
SDL_LockSurface(converted_background);
|
||||||
|
Loading…
Reference in New Issue
Block a user