mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-09-29 02:08:01 +03:00
Explicitly set pixel format of sdl_display
This shouldn't have any behavioral changes.
This commit is contained in:
+1
-3
@@ -376,9 +376,7 @@ static void fader_in(int n) {
|
||||
static SDL_Surface *src;
|
||||
|
||||
if (n == 0) {
|
||||
src = SDL_CreateRGBSurface(0, sdl_display->w, sdl_display->h,
|
||||
sdl_display->format->BitsPerPixel, 0, 0, 0, 0);
|
||||
|
||||
src = SDL_CreateRGBSurfaceWithFormat(0, sdl_display->w, sdl_display->h, 32, SDL_PIXELFORMAT_RGB888);
|
||||
SDL_Rect r_src = {view_x, view_y, view_w, view_h};
|
||||
SDL_Rect r_dst = {0, 0, view_w, view_h};
|
||||
SDL_BlitSurface(sdl_dib, &r_src, src, &r_dst);
|
||||
|
||||
+1
-1
@@ -263,7 +263,7 @@ void sdl_setWindowSize(int x, int y, int w, int h) {
|
||||
SDL_FreeSurface(sdl_display);
|
||||
if (sdl_texture)
|
||||
SDL_DestroyTexture(sdl_texture);
|
||||
sdl_display = SDL_CreateRGBSurface(0, w, h, 32, 0, 0, 0, 0);
|
||||
sdl_display = SDL_CreateRGBSurfaceWithFormat(0, w, h, 32, SDL_PIXELFORMAT_RGB888);
|
||||
sdl_texture = SDL_CreateTexture(sdl_renderer, sdl_display->format->format,
|
||||
SDL_TEXTUREACCESS_STATIC, w, h);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user