diff options
Diffstat (limited to 'firmware/target/hosted/sdl/system-sdl.c')
-rw-r--r-- | firmware/target/hosted/sdl/system-sdl.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/firmware/target/hosted/sdl/system-sdl.c b/firmware/target/hosted/sdl/system-sdl.c index 6937c373e3..b900d38b43 100644 --- a/firmware/target/hosted/sdl/system-sdl.c +++ b/firmware/target/hosted/sdl/system-sdl.c | |||
@@ -84,6 +84,7 @@ static int sdl_event_thread(void * param) | |||
84 | 84 | ||
85 | SDL_Surface *picture_surface = NULL; | 85 | SDL_Surface *picture_surface = NULL; |
86 | int width, height; | 86 | int width, height; |
87 | int depth; | ||
87 | 88 | ||
88 | /* Try and load the background image. If it fails go without */ | 89 | /* Try and load the background image. If it fails go without */ |
89 | if (background) { | 90 | if (background) { |
@@ -115,9 +116,12 @@ static int sdl_event_thread(void * param) | |||
115 | height = SIM_LCD_HEIGHT; | 116 | height = SIM_LCD_HEIGHT; |
116 | } | 117 | } |
117 | } | 118 | } |
118 | 119 | ||
119 | 120 | depth = LCD_DEPTH; | |
120 | if ((gui_surface = SDL_SetVideoMode(width * display_zoom, height * display_zoom, 24, SDL_HWSURFACE|SDL_DOUBLEBUF)) == NULL) { | 121 | if (depth < 8) |
122 | depth = 16; | ||
123 | |||
124 | if ((gui_surface = SDL_SetVideoMode(width * display_zoom, height * display_zoom, depth, SDL_HWSURFACE|SDL_DOUBLEBUF)) == NULL) { | ||
121 | panicf("%s", SDL_GetError()); | 125 | panicf("%s", SDL_GetError()); |
122 | } | 126 | } |
123 | 127 | ||