mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-27 09:44:15 +00:00
Remove depth field from SDL_CreateRGBSurfaceWithFormat and SDL_Create… (#6685)
* Remove depth field from SDL_CreateRGBSurfaceWithFormat and SDL_CreateRGBSurfaceWithFormatFrom * Removed unused 'flags' parameter from SDL_CreateRGBSurface and SDL_CreateRGBSurfaceWithFormat * Removed unused 'flags' parameter from SDL_ConvertSurface and SDL_ConvertSurfaceFormat
This commit is contained in:
@@ -113,7 +113,7 @@ SW_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
}
|
||||
|
||||
texture->driverdata =
|
||||
SDL_CreateRGBSurface(0, texture->w, texture->h, bpp, Rmask, Gmask,
|
||||
SDL_CreateRGBSurface(texture->w, texture->h, bpp, Rmask, Gmask,
|
||||
Bmask, Amask);
|
||||
SDL_SetSurfaceColorMod(texture->driverdata, texture->color.r, texture->color.g, texture->color.b);
|
||||
SDL_SetSurfaceAlphaMod(texture->driverdata, texture->color.a);
|
||||
@@ -405,7 +405,7 @@ SW_RenderCopyEx(SDL_Renderer * renderer, SDL_Surface *surface, SDL_Texture * tex
|
||||
* to clear the pixels in the destination surface. The other steps are explained below.
|
||||
*/
|
||||
if (blendmode == SDL_BLENDMODE_NONE && !isOpaque) {
|
||||
mask = SDL_CreateRGBSurface(0, final_rect->w, final_rect->h, 32,
|
||||
mask = SDL_CreateRGBSurface(final_rect->w, final_rect->h, 32,
|
||||
0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
|
||||
if (mask == NULL) {
|
||||
retval = -1;
|
||||
@@ -419,7 +419,7 @@ SW_RenderCopyEx(SDL_Renderer * renderer, SDL_Surface *surface, SDL_Texture * tex
|
||||
*/
|
||||
if (!retval && (blitRequired || applyModulation)) {
|
||||
SDL_Rect scale_rect = tmp_rect;
|
||||
src_scaled = SDL_CreateRGBSurface(0, final_rect->w, final_rect->h, 32,
|
||||
src_scaled = SDL_CreateRGBSurface(final_rect->w, final_rect->h, 32,
|
||||
0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
|
||||
if (src_scaled == NULL) {
|
||||
retval = -1;
|
||||
@@ -831,7 +831,7 @@ SW_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic
|
||||
|
||||
/* Prevent to do scaling + clipping on viewport boundaries as it may lose proportion */
|
||||
if (dstrect->x < 0 || dstrect->y < 0 || dstrect->x + dstrect->w > surface->w || dstrect->y + dstrect->h > surface->h) {
|
||||
SDL_Surface *tmp = SDL_CreateRGBSurfaceWithFormat(0, dstrect->w, dstrect->h, 0, src->format->format);
|
||||
SDL_Surface *tmp = SDL_CreateRGBSurfaceWithFormat(dstrect->w, dstrect->h, src->format->format);
|
||||
/* Scale to an intermediate surface, then blit */
|
||||
if (tmp) {
|
||||
SDL_Rect r;
|
||||
|
||||
@@ -500,7 +500,7 @@ SDLgfx_rotateSurface(SDL_Surface * src, double angle, int smooth, int flipx, int
|
||||
rz_dst = NULL;
|
||||
if (is8bit) {
|
||||
/* Target surface is 8 bit */
|
||||
rz_dst = SDL_CreateRGBSurfaceWithFormat(0, rect_dest->w, rect_dest->h + GUARD_ROWS, 8, src->format->format);
|
||||
rz_dst = SDL_CreateRGBSurfaceWithFormat(rect_dest->w, rect_dest->h + GUARD_ROWS, src->format->format);
|
||||
if (rz_dst != NULL) {
|
||||
if (src->format->palette) {
|
||||
for (i = 0; i < src->format->palette->ncolors; i++) {
|
||||
@@ -511,7 +511,7 @@ SDLgfx_rotateSurface(SDL_Surface * src, double angle, int smooth, int flipx, int
|
||||
}
|
||||
} else {
|
||||
/* Target surface is 32 bit with source RGBA ordering */
|
||||
rz_dst = SDL_CreateRGBSurface(0, rect_dest->w, rect_dest->h + GUARD_ROWS, 32,
|
||||
rz_dst = SDL_CreateRGBSurface(rect_dest->w, rect_dest->h + GUARD_ROWS, 32,
|
||||
src->format->Rmask, src->format->Gmask,
|
||||
src->format->Bmask, src->format->Amask);
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ int SDL_SW_FillTriangle(SDL_Surface *dst, SDL_Point *d0, SDL_Point *d1, SDL_Poin
|
||||
}
|
||||
|
||||
/* Use an intermediate surface */
|
||||
tmp = SDL_CreateRGBSurfaceWithFormat(0, dstrect.w, dstrect.h, 0, format);
|
||||
tmp = SDL_CreateRGBSurfaceWithFormat(dstrect.w, dstrect.h, format);
|
||||
if (tmp == NULL) {
|
||||
ret = -1;
|
||||
goto end;
|
||||
|
||||
Reference in New Issue
Block a user