diff --git a/src/video_display/gl.c b/src/video_display/gl.c index 00da3fa78..62599e11a 100644 --- a/src/video_display/gl.c +++ b/src/video_display/gl.c @@ -264,6 +264,7 @@ static void gl_load_splashscreen(struct state_gl *s) gl_reconfigure_screen(s); for (int i = 0; i < 2; ++i) { + const char *data = splash_data; memset(s->buffers[i], 0, s->tile->data_len); for (unsigned int y = 0; y < splash_height; ++y) { char *line = s->buffers[i]; @@ -274,7 +275,7 @@ static void gl_load_splashscreen(struct state_gl *s) (s->tile->width - splash_width)/2, s->frame->color_spec); for (unsigned int x = 0; x < splash_width; ++x) { - HEADER_PIXEL(splash_data,line); + HEADER_PIXEL(data,line); line += 4; } } diff --git a/src/video_display/sdl.c b/src/video_display/sdl.c index c97a1caac..091f73623 100644 --- a/src/video_display/sdl.c +++ b/src/video_display/sdl.c @@ -168,10 +168,11 @@ static void loadSplashscreen(struct state_sdl *s) { #endif // load splash data + const char *data = splash_data; for (y_coord = 0; y_coord < splash_height; y_coord++) { for (x_coord = 0; x_coord < splash_width; x_coord++) { - HEADER_PIXEL(splash_data,pixel); + HEADER_PIXEL(data,pixel); Uint32 color = SDL_MapRGB(image->format, pixel[0], pixel[1], pixel[2]); switch(image->format->BytesPerPixel) { diff --git a/src/video_display/splashscreen.h b/src/video_display/splashscreen.h index 980e6c097..a5c405794 100644 --- a/src/video_display/splashscreen.h +++ b/src/video_display/splashscreen.h @@ -1,7 +1,7 @@ /* GIMP header image file format (RGB) */ -static unsigned int splash_width = 339; -static unsigned int splash_height = 195; +static const unsigned int splash_width = 339; +static const unsigned int splash_height = 195; /* Call this macro repeatedly. After each use, the pixel data can be extracted */ @@ -11,7 +11,7 @@ pixel[1] = ((((data[1] - 33) & 0xF) << 4) | ((data[2] - 33) >> 2)); \ pixel[2] = ((((data[2] - 33) & 0x3) << 6) | ((data[3] - 33))); \ data += 4; \ } -static char *splash_data = +static const char * const splash_data = "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"