mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-11 13:58:13 +00:00
Cleaned up various type conversion issues
This makes sure SDL_PixelFormatEnum flows through the internal code correctly, as well as fixing a number of other minor issues.
This commit is contained in:
@@ -368,7 +368,7 @@ static SDL_RenderCommand *AllocateRenderCommand(SDL_Renderer *renderer)
|
||||
renderer->render_commands_pool = retval->next;
|
||||
retval->next = NULL;
|
||||
} else {
|
||||
retval = SDL_calloc(1, sizeof(*retval));
|
||||
retval = (SDL_RenderCommand *)SDL_calloc(1, sizeof(*retval));
|
||||
if (!retval) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -897,8 +897,8 @@ static void SDL_CalculateSimulatedVSyncInterval(SDL_Renderer *renderer, SDL_Wind
|
||||
SDL_Renderer *SDL_CreateRendererWithProperties(SDL_PropertiesID props)
|
||||
{
|
||||
#ifndef SDL_RENDER_DISABLED
|
||||
SDL_Window *window = SDL_GetProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, NULL);
|
||||
SDL_Surface *surface = SDL_GetProperty(props, SDL_PROP_RENDERER_CREATE_SURFACE_POINTER, NULL);
|
||||
SDL_Window *window = (SDL_Window *)SDL_GetProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, NULL);
|
||||
SDL_Surface *surface = (SDL_Surface *)SDL_GetProperty(props, SDL_PROP_RENDERER_CREATE_SURFACE_POINTER, NULL);
|
||||
const char *name = SDL_GetStringProperty(props, SDL_PROP_RENDERER_CREATE_NAME_STRING, NULL);
|
||||
SDL_Renderer *renderer = NULL;
|
||||
const int n = SDL_GetNumRenderDrivers();
|
||||
@@ -1238,7 +1238,7 @@ static Uint32 GetClosestSupportedFormat(SDL_Renderer *renderer, Uint32 format)
|
||||
SDL_Texture *SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_PropertiesID props)
|
||||
{
|
||||
SDL_Texture *texture;
|
||||
Uint32 format = (Uint32)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER, SDL_PIXELFORMAT_UNKNOWN);
|
||||
SDL_PixelFormatEnum format = (SDL_PixelFormatEnum)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER, SDL_PIXELFORMAT_UNKNOWN);
|
||||
int access = (int)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER, SDL_TEXTUREACCESS_STATIC);
|
||||
int w = (int)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER, 0);
|
||||
int h = (int)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER, 0);
|
||||
@@ -1399,7 +1399,7 @@ SDL_Texture *SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *s
|
||||
SDL_bool needAlpha;
|
||||
SDL_bool direct_update;
|
||||
int i;
|
||||
Uint32 format = SDL_PIXELFORMAT_UNKNOWN;
|
||||
SDL_PixelFormatEnum format = SDL_PIXELFORMAT_UNKNOWN;
|
||||
SDL_Texture *texture;
|
||||
SDL_PropertiesID surface_props, props;
|
||||
SDL_Colorspace surface_colorspace = SDL_COLORSPACE_UNKNOWN;
|
||||
@@ -2359,7 +2359,7 @@ SDL_Texture *SDL_GetRenderTarget(SDL_Renderer *renderer)
|
||||
if (renderer->target == renderer->logical_target) {
|
||||
return NULL;
|
||||
} else {
|
||||
return SDL_GetProperty(SDL_GetTextureProperties(renderer->target), SDL_PROP_TEXTURE_PARENT_POINTER, renderer->target);
|
||||
return (SDL_Texture *)SDL_GetProperty(SDL_GetTextureProperties(renderer->target), SDL_PROP_TEXTURE_PARENT_POINTER, renderer->target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4084,7 +4084,7 @@ static int SDLCALL SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer,
|
||||
s.h *= -1;
|
||||
s.y -= s.h;
|
||||
}
|
||||
SDL_RenderTextureRotated(renderer, texture, &s, &d, 0, NULL, flags);
|
||||
SDL_RenderTextureRotated(renderer, texture, &s, &d, 0, NULL, (SDL_FlipMode)flags);
|
||||
}
|
||||
|
||||
#if DEBUG_SW_RENDER_GEOMETRY
|
||||
|
Reference in New Issue
Block a user