Fix SDL_LEAN_AND_MEAN build

This commit is contained in:
Anonymous Maarten
2024-03-11 20:16:20 +01:00
committed by Sam Lantinga
parent d4794cc714
commit bee8a95571
3 changed files with 32 additions and 19 deletions

View File

@@ -364,16 +364,21 @@ static int surface_testCompleteSurfaceConversion(void *arg)
for (i = 0; i < SDL_arraysize(pixel_formats); ++i) {
for (j = 0; j < SDL_arraysize(pixel_formats); ++j) {
fmt1 = SDL_CreatePixelFormat(pixel_formats[i]);
SDL_assert(fmt1 != NULL);
SDLTest_AssertCheck(fmt1 != NULL, "SDL_CreatePixelFormat(%s[0x%08" SDL_PRIx32 "]) should return a non-null pixel format",
SDL_GetPixelFormatName(pixel_formats[i]), pixel_formats[i]);
cvt1 = SDL_ConvertSurface(face, fmt1);
SDL_assert(cvt1 != NULL);
SDLTest_AssertCheck(cvt1 != NULL, "SDL_ConvertSurface(..., %s[0x%08" SDL_PRIx32 "]) should return a non-null surface",
SDL_GetPixelFormatName(pixel_formats[i]), pixel_formats[i]);
fmt2 = SDL_CreatePixelFormat(pixel_formats[j]);
SDL_assert(fmt1 != NULL);
SDLTest_AssertCheck(fmt2 != NULL, "SDL_CreatePixelFormat(%s[0x%08" SDL_PRIx32 "]) should return a non-null pixel format",
SDL_GetPixelFormatName(pixel_formats[i]), pixel_formats[i]);
cvt2 = SDL_ConvertSurface(cvt1, fmt2);
SDL_assert(cvt2 != NULL);
SDLTest_AssertCheck(cvt2 != NULL, "SDL_ConvertSurface(..., %s[0x%08" SDL_PRIx32 "]) should return a non-null surface",
SDL_GetPixelFormatName(pixel_formats[i]), pixel_formats[i]);
if (fmt1->bytes_per_pixel == face->format->bytes_per_pixel &&
if (fmt1 && fmt2 &&
fmt1->bytes_per_pixel == face->format->bytes_per_pixel &&
fmt2->bytes_per_pixel == face->format->bytes_per_pixel &&
(fmt1->Amask != 0) == (face->format->Amask != 0) &&
(fmt2->Amask != 0) == (face->format->Amask != 0)) {