Skip to content

Commit

Permalink
Surface2to3: Need to set surface w and h if changed, not assert.
Browse files Browse the repository at this point in the history
sdl12-compat creates the video surface with 0x0 dimensions until it gets
further through initialization, and sdl2-compat and SDL3 need to catch
up with their internal state later.
  • Loading branch information
icculus committed Jan 22, 2025
1 parent c8cedca commit 0af491c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sdl2_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -2753,8 +2753,8 @@ static SDL_Surface *Surface2to3(SDL2_Surface *surface)
* The application might have changed memory allocation, e.g.:
* https://github.com/libsdl-org/SDL_ttf/blob/7e4a456bf463b887b94c191030dd742d7654d6ff/SDL_ttf.c#L1476-L1478
*/
SDL_assert(surface->w == surface3->w);
SDL_assert(surface->h == surface3->h);
surface3->w = surface->w;
surface3->h = surface->h;
surface3->flags &= ~(surface->flags & SHARED_SURFACE_FLAGS);
surface3->flags |= (surface->flags & SHARED_SURFACE_FLAGS);
surface3->pixels = surface->pixels;
Expand Down

0 comments on commit 0af491c

Please sign in to comment.