mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-27 21:48:29 +00:00
Updated structure and field names for consistency
Type names are camel case and field names are snake case except for fields ending in id, which are capitalized. Fixes https://github.com/libsdl-org/SDL/issues/6955
This commit is contained in:
@@ -143,8 +143,8 @@ static int SW_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture,
|
||||
src = (Uint8 *)pixels;
|
||||
dst = (Uint8 *)surface->pixels +
|
||||
rect->y * surface->pitch +
|
||||
rect->x * surface->format->BytesPerPixel;
|
||||
length = (size_t)rect->w * surface->format->BytesPerPixel;
|
||||
rect->x * surface->format->bytes_per_pixel;
|
||||
length = (size_t)rect->w * surface->format->bytes_per_pixel;
|
||||
for (row = 0; row < rect->h; ++row) {
|
||||
SDL_memcpy(dst, src, length);
|
||||
src += pitch;
|
||||
@@ -163,7 +163,7 @@ static int SW_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture,
|
||||
|
||||
*pixels =
|
||||
(void *)((Uint8 *)surface->pixels + rect->y * surface->pitch +
|
||||
rect->x * surface->format->BytesPerPixel);
|
||||
rect->x * surface->format->bytes_per_pixel);
|
||||
*pitch = surface->pitch;
|
||||
return 0;
|
||||
}
|
||||
@@ -363,7 +363,7 @@ static int SW_RenderCopyEx(SDL_Renderer *renderer, SDL_Surface *surface, SDL_Tex
|
||||
SDL_GetSurfaceColorMod(src, &rMod, &gMod, &bMod);
|
||||
|
||||
/* SDLgfx_rotateSurface only accepts 32-bit surfaces with a 8888 layout. Everything else has to be converted. */
|
||||
if (src->format->BitsPerPixel != 32 || SDL_PIXELLAYOUT(src->format->format) != SDL_PACKEDLAYOUT_8888 || !src->format->Amask) {
|
||||
if (src->format->bits_per_pixel != 32 || SDL_PIXELLAYOUT(src->format->format) != SDL_PACKEDLAYOUT_8888 || !src->format->Amask) {
|
||||
blitRequired = SDL_TRUE;
|
||||
}
|
||||
|
||||
@@ -486,7 +486,7 @@ static int SW_RenderCopyEx(SDL_Renderer *renderer, SDL_Surface *surface, SDL_Tex
|
||||
* to be created. This makes all source pixels opaque and the colors get copied correctly.
|
||||
*/
|
||||
SDL_Surface *src_rotated_rgb;
|
||||
int f = SDL_GetPixelFormatEnumForMasks(src_rotated->format->BitsPerPixel,
|
||||
int f = SDL_GetPixelFormatEnumForMasks(src_rotated->format->bits_per_pixel,
|
||||
src_rotated->format->Rmask,
|
||||
src_rotated->format->Gmask,
|
||||
src_rotated->format->Bmask,
|
||||
@@ -995,7 +995,7 @@ static SDL_Surface *SW_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *
|
||||
|
||||
pixels = (void *)((Uint8 *)surface->pixels +
|
||||
rect->y * surface->pitch +
|
||||
rect->x * surface->format->BytesPerPixel);
|
||||
rect->x * surface->format->bytes_per_pixel);
|
||||
|
||||
return SDL_DuplicatePixels(rect->w, rect->h, surface->format->format, SDL_COLORSPACE_SRGB, pixels, surface->pitch);
|
||||
}
|
||||
|
Reference in New Issue
Block a user