mirror of
https://github.com/encounter/SDL.git
synced 2025-12-18 09:25:29 +00:00
Fixed bug 4277 - warnings patch
Sylvain Patch a few warnings when using: -Wmissing-prototypes -Wdocumentation -Wdocumentation-unknown-command They are automatically enabled with -Wall
This commit is contained in:
@@ -2333,6 +2333,30 @@ BlitNtoNKey(SDL_BlitInfo * info)
|
||||
/* Set up some basic variables */
|
||||
ckey &= rgbmask;
|
||||
|
||||
/* Fastpath: same source/destination format, no Amask, bpp 32, loop is vectorized. ~10x faster */
|
||||
if (srcfmt->format == dstfmt->format &&
|
||||
(srcfmt->format == SDL_PIXELFORMAT_RGB888 || srcfmt->format == SDL_PIXELFORMAT_BGR888)) {
|
||||
Uint32 *src32 = (Uint32*)src;
|
||||
Uint32 *dst32 = (Uint32*)dst;
|
||||
srcskip /= sizeof(Uint32);
|
||||
dstskip /= sizeof(Uint32);
|
||||
while (height--) {
|
||||
/* *INDENT-OFF* */
|
||||
DUFFS_LOOP(
|
||||
{
|
||||
Uint32 Pixel = (*src32 == ckey) ? *dst32 : *src32;
|
||||
*dst32 = Pixel;
|
||||
++src32;
|
||||
++dst32;
|
||||
},
|
||||
width);
|
||||
/* *INDENT-ON* */
|
||||
src32 += srcskip;
|
||||
dst32 += dstskip;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
while (height--) {
|
||||
/* *INDENT-OFF* */
|
||||
DUFFS_LOOP(
|
||||
@@ -2380,6 +2404,33 @@ BlitNtoNKeyCopyAlpha(SDL_BlitInfo * info)
|
||||
dstbpp = dstfmt->BytesPerPixel;
|
||||
ckey &= rgbmask;
|
||||
|
||||
/* Fastpath: same source/destination format, with Amask, bpp 32, loop is vectorized. ~10x faster */
|
||||
if (srcfmt->format == dstfmt->format &&
|
||||
(srcfmt->format == SDL_PIXELFORMAT_ARGB8888 ||
|
||||
srcfmt->format == SDL_PIXELFORMAT_ABGR8888 ||
|
||||
srcfmt->format == SDL_PIXELFORMAT_BGRA8888 ||
|
||||
srcfmt->format == SDL_PIXELFORMAT_RGBA8888)) {
|
||||
Uint32 *src32 = (Uint32*)src;
|
||||
Uint32 *dst32 = (Uint32*)dst;
|
||||
srcskip /= sizeof(Uint32);
|
||||
dstskip /= sizeof(Uint32);
|
||||
while (height--) {
|
||||
/* *INDENT-OFF* */
|
||||
DUFFS_LOOP(
|
||||
{
|
||||
Uint32 Pixel = ((*src32 & rgbmask) == ckey) ? *dst32 : *src32;
|
||||
*dst32 = Pixel;
|
||||
++src32;
|
||||
++dst32;
|
||||
},
|
||||
width);
|
||||
/* *INDENT-ON* */
|
||||
src32 += srcskip;
|
||||
dst32 += dstskip;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
while (height--) {
|
||||
/* *INDENT-OFF* */
|
||||
DUFFS_LOOP(
|
||||
|
||||
@@ -37,7 +37,7 @@ SDL_COMPILE_TIME_ASSERT(surface_size_assumptions,
|
||||
/*
|
||||
* Calculate the pad-aligned scanline width of a surface
|
||||
*/
|
||||
int
|
||||
static int
|
||||
SDL_CalculatePitch(Uint32 format, int width)
|
||||
{
|
||||
int pitch;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "SDL_endian.h"
|
||||
#include "SDL_video.h"
|
||||
#include "SDL_pixels_c.h"
|
||||
#include "SDL_yuv_c.h"
|
||||
|
||||
#include "yuv2rgb/yuv_rgb.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user