diff --git a/src/test/SDL_test_imageBlit.c b/src/test/SDL_test_imageBlit.c index 53c2338b74..bf1cf2fce2 100644 --- a/src/test/SDL_test_imageBlit.c +++ b/src/test/SDL_test_imageBlit.c @@ -542,24 +542,13 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlit = { */ SDL_Surface *SDLTest_ImageBlit() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom( (void *)SDLTest_imageBlit.pixel_data, SDLTest_imageBlit.width, SDLTest_imageBlit.height, SDLTest_imageBlit.bytes_per_pixel * 8, SDLTest_imageBlit.width * SDLTest_imageBlit.bytes_per_pixel, -#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - 0xff000000, /* Red bit mask. */ - 0x00ff0000, /* Green bit mask. */ - 0x0000ff00, /* Blue bit mask. */ - 0x000000ff /* Alpha bit mask. */ -#else - 0x000000ff, /* Red bit mask. */ - 0x0000ff00, /* Green bit mask. */ - 0x00ff0000, /* Blue bit mask. */ - 0xff000000 /* Alpha bit mask. */ -#endif - ); + SDL_PIXELFORMAT_RGB24); return surface; } @@ -1027,24 +1016,13 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitColor = { */ SDL_Surface *SDLTest_ImageBlitColor() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom( (void *)SDLTest_imageBlitColor.pixel_data, SDLTest_imageBlitColor.width, SDLTest_imageBlitColor.height, SDLTest_imageBlitColor.bytes_per_pixel * 8, SDLTest_imageBlitColor.width * SDLTest_imageBlitColor.bytes_per_pixel, -#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - 0xff000000, /* Red bit mask. */ - 0x00ff0000, /* Green bit mask. */ - 0x0000ff00, /* Blue bit mask. */ - 0x000000ff /* Alpha bit mask. */ -#else - 0x000000ff, /* Red bit mask. */ - 0x0000ff00, /* Green bit mask. */ - 0x00ff0000, /* Blue bit mask. */ - 0xff000000 /* Alpha bit mask. */ -#endif - ); + SDL_PIXELFORMAT_RGB24); return surface; } @@ -1675,24 +1653,13 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitAlpha = { */ SDL_Surface *SDLTest_ImageBlitAlpha() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom( (void *)SDLTest_imageBlitAlpha.pixel_data, SDLTest_imageBlitAlpha.width, SDLTest_imageBlitAlpha.height, SDLTest_imageBlitAlpha.bytes_per_pixel * 8, SDLTest_imageBlitAlpha.width * SDLTest_imageBlitAlpha.bytes_per_pixel, -#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - 0xff000000, /* Red bit mask. */ - 0x00ff0000, /* Green bit mask. */ - 0x0000ff00, /* Blue bit mask. */ - 0x000000ff /* Alpha bit mask. */ -#else - 0x000000ff, /* Red bit mask. */ - 0x0000ff00, /* Green bit mask. */ - 0x00ff0000, /* Blue bit mask. */ - 0xff000000 /* Alpha bit mask. */ -#endif - ); + SDL_PIXELFORMAT_RGB24); return surface; } diff --git a/src/test/SDL_test_imageBlitBlend.c b/src/test/SDL_test_imageBlitBlend.c index 2f8ddbf322..520cfffdd0 100644 --- a/src/test/SDL_test_imageBlitBlend.c +++ b/src/test/SDL_test_imageBlitBlend.c @@ -582,24 +582,13 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAdd = { */ SDL_Surface *SDLTest_ImageBlitBlendAdd() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom( (void *)SDLTest_imageBlitBlendAdd.pixel_data, SDLTest_imageBlitBlendAdd.width, SDLTest_imageBlitBlendAdd.height, SDLTest_imageBlitBlendAdd.bytes_per_pixel * 8, SDLTest_imageBlitBlendAdd.width * SDLTest_imageBlitBlendAdd.bytes_per_pixel, -#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - 0xff000000, /* Red bit mask. */ - 0x00ff0000, /* Green bit mask. */ - 0x0000ff00, /* Blue bit mask. */ - 0x000000ff /* Alpha bit mask. */ -#else - 0x000000ff, /* Red bit mask. */ - 0x0000ff00, /* Green bit mask. */ - 0x00ff0000, /* Blue bit mask. */ - 0xff000000 /* Alpha bit mask. */ -#endif - ); + SDL_PIXELFORMAT_RGB24); return surface; } @@ -1184,24 +1173,13 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlend = { */ SDL_Surface *SDLTest_ImageBlitBlend() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom( (void *)SDLTest_imageBlitBlend.pixel_data, SDLTest_imageBlitBlend.width, SDLTest_imageBlitBlend.height, SDLTest_imageBlitBlend.bytes_per_pixel * 8, SDLTest_imageBlitBlend.width * SDLTest_imageBlitBlend.bytes_per_pixel, -#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - 0xff000000, /* Red bit mask. */ - 0x00ff0000, /* Green bit mask. */ - 0x0000ff00, /* Blue bit mask. */ - 0x000000ff /* Alpha bit mask. */ -#else - 0x000000ff, /* Red bit mask. */ - 0x0000ff00, /* Green bit mask. */ - 0x00ff0000, /* Blue bit mask. */ - 0xff000000 /* Alpha bit mask. */ -#endif - ); + SDL_PIXELFORMAT_RGB24); return surface; } @@ -1616,24 +1594,13 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendMod = { */ SDL_Surface *SDLTest_ImageBlitBlendMod() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom( (void *)SDLTest_imageBlitBlendMod.pixel_data, SDLTest_imageBlitBlendMod.width, SDLTest_imageBlitBlendMod.height, SDLTest_imageBlitBlendMod.bytes_per_pixel * 8, SDLTest_imageBlitBlendMod.width * SDLTest_imageBlitBlendMod.bytes_per_pixel, -#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - 0xff000000, /* Red bit mask. */ - 0x00ff0000, /* Green bit mask. */ - 0x0000ff00, /* Blue bit mask. */ - 0x000000ff /* Alpha bit mask. */ -#else - 0x000000ff, /* Red bit mask. */ - 0x0000ff00, /* Green bit mask. */ - 0x00ff0000, /* Blue bit mask. */ - 0xff000000 /* Alpha bit mask. */ -#endif - ); + SDL_PIXELFORMAT_RGB24); return surface; } @@ -2431,24 +2398,13 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendNone = { */ SDL_Surface *SDLTest_ImageBlitBlendNone() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom( (void *)SDLTest_imageBlitBlendNone.pixel_data, SDLTest_imageBlitBlendNone.width, SDLTest_imageBlitBlendNone.height, SDLTest_imageBlitBlendNone.bytes_per_pixel * 8, SDLTest_imageBlitBlendNone.width * SDLTest_imageBlitBlendNone.bytes_per_pixel, -#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - 0xff000000, /* Red bit mask. */ - 0x00ff0000, /* Green bit mask. */ - 0x0000ff00, /* Blue bit mask. */ - 0x000000ff /* Alpha bit mask. */ -#else - 0x000000ff, /* Red bit mask. */ - 0x0000ff00, /* Green bit mask. */ - 0x00ff0000, /* Blue bit mask. */ - 0xff000000 /* Alpha bit mask. */ -#endif - ); + SDL_PIXELFORMAT_RGB24); return surface; } @@ -2978,24 +2934,13 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAll = { */ SDL_Surface *SDLTest_ImageBlitBlendAll() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom( (void *)SDLTest_imageBlitBlendAll.pixel_data, SDLTest_imageBlitBlendAll.width, SDLTest_imageBlitBlendAll.height, SDLTest_imageBlitBlendAll.bytes_per_pixel * 8, SDLTest_imageBlitBlendAll.width * SDLTest_imageBlitBlendAll.bytes_per_pixel, -#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - 0xff000000, /* Red bit mask. */ - 0x00ff0000, /* Green bit mask. */ - 0x0000ff00, /* Blue bit mask. */ - 0x000000ff /* Alpha bit mask. */ -#else - 0x000000ff, /* Red bit mask. */ - 0x0000ff00, /* Green bit mask. */ - 0x00ff0000, /* Blue bit mask. */ - 0xff000000 /* Alpha bit mask. */ -#endif - ); + SDL_PIXELFORMAT_RGB24); return surface; } diff --git a/src/test/SDL_test_imagePrimitives.c b/src/test/SDL_test_imagePrimitives.c index ec70fa1ff3..6ef05c5547 100644 --- a/src/test/SDL_test_imagePrimitives.c +++ b/src/test/SDL_test_imagePrimitives.c @@ -506,24 +506,13 @@ static const SDLTest_SurfaceImage_t SDLTest_imagePrimitives = { */ SDL_Surface *SDLTest_ImagePrimitives() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom( (void *)SDLTest_imagePrimitives.pixel_data, SDLTest_imagePrimitives.width, SDLTest_imagePrimitives.height, SDLTest_imagePrimitives.bytes_per_pixel * 8, SDLTest_imagePrimitives.width * SDLTest_imagePrimitives.bytes_per_pixel, -#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - 0xff000000, /* Red bit mask. */ - 0x00ff0000, /* Green bit mask. */ - 0x0000ff00, /* Blue bit mask. */ - 0x000000ff /* Alpha bit mask. */ -#else - 0x000000ff, /* Red bit mask. */ - 0x0000ff00, /* Green bit mask. */ - 0x00ff0000, /* Blue bit mask. */ - 0xff000000 /* Alpha bit mask. */ -#endif - ); + SDL_PIXELFORMAT_RGB24); return surface; } diff --git a/src/test/SDL_test_imagePrimitivesBlend.c b/src/test/SDL_test_imagePrimitivesBlend.c index c3fe053fd5..8ee9f41775 100644 --- a/src/test/SDL_test_imagePrimitivesBlend.c +++ b/src/test/SDL_test_imagePrimitivesBlend.c @@ -679,24 +679,13 @@ static const SDLTest_SurfaceImage_t SDLTest_imagePrimitivesBlend = { */ SDL_Surface *SDLTest_ImagePrimitivesBlend() { - SDL_Surface *surface = SDL_CreateRGBSurfaceFrom( + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormatFrom( (void *)SDLTest_imagePrimitivesBlend.pixel_data, SDLTest_imagePrimitivesBlend.width, SDLTest_imagePrimitivesBlend.height, SDLTest_imagePrimitivesBlend.bytes_per_pixel * 8, SDLTest_imagePrimitivesBlend.width * SDLTest_imagePrimitivesBlend.bytes_per_pixel, -#if (SDL_BYTEORDER == SDL_BIG_ENDIAN) - 0xff000000, /* Red bit mask. */ - 0x00ff0000, /* Green bit mask. */ - 0x0000ff00, /* Blue bit mask. */ - 0x000000ff /* Alpha bit mask. */ -#else - 0x000000ff, /* Red bit mask. */ - 0x0000ff00, /* Green bit mask. */ - 0x00ff0000, /* Blue bit mask. */ - 0xff000000 /* Alpha bit mask. */ -#endif - ); + SDL_PIXELFORMAT_RGB24); return surface; }