37 PRAGMA48(GCC diagnostic ignored
"-Wshadow")
38 #include <SDL_video.h>
43 #define GFX_DUFFS_LOOP4(pixel_copy_increment, width) \
44 int n = ((width) + 3) / 4; \
45 switch ((width) & 3) \
48 pixel_copy_increment; \
49 case 3: pixel_copy_increment; \
50 case 2: pixel_copy_increment; \
51 case 1: pixel_copy_increment; \
339 const int width =
info->d_width;
340 int height =
info->d_height;
341 Uint8 *src =
info->s_pixels;
342 const int srcskip =
info->s_skip;
343 Uint8 *dst =
info->d_pixels;
344 const int dstskip =
info->d_skip;
345 const SDL_PixelFormat *
const srcfmt =
info->src;
347 while ((height--) != 0)
362 pixel = *(
reinterpret_cast<uint32_t *
>(src));
363 sR = ((pixel & srcfmt->Rmask) >> srcfmt->Rshift);
364 sG = ((pixel & srcfmt->Gmask) >> srcfmt->Gshift);
365 sB = ((pixel & srcfmt->Bmask) >> srcfmt->Bshift);
366 sA = ((pixel & srcfmt->Amask) >> srcfmt->Ashift);
368 pixel = *(
reinterpret_cast<uint32_t *
>(dst));
370 dG = ((pixel & 0xff00U) >> 8);
371 dB = ((pixel & 0xff0000U) >> 16);
372 dA = ((pixel & 0xff000000U) >> 24);
375 dR = (((sR - dR) * (sAA)) / 255) + dR;
376 dG = (((sG - dG) * (sAA)) / 255) + dG;
377 dB = (((sB - dB) * (sAA)) / 255) + dB;
380 *(
reinterpret_cast<uint32_t *
>(dst)) = dR |
394 const SDL_Rect *
const srcrect,
395 const SDL_Surface *
const dst,
396 const SDL_Rect *
const dstrect)
401 if ((srcrect->w != 0U) && (srcrect->h != 0U))
403 SDL_gfxBlitInfo
info;
408 info.s_pixels =
static_cast<Uint8 *
>(src->pixels) + src->offset +
409 static_cast<Uint16
>(srcrect->y) * src->pitch +
410 static_cast<Uint16
>(srcrect->x) * src->format->BytesPerPixel;
411 info.s_width = srcrect->w;
412 info.s_height = srcrect->h;
414 src->format->BytesPerPixel);
415 info.d_pixels =
static_cast<Uint8 *
>(dst->pixels) + dst->offset +
416 static_cast<Uint16
>(dstrect->y) * dst->pitch +
417 static_cast<Uint16
>(dstrect->x) * dst->format->BytesPerPixel;
418 info.d_width = dstrect->w;
419 info.d_height = dstrect->h;
421 dst->format->BytesPerPixel);
422 info.aux_data =
nullptr;
423 info.src = src->format;
424 info.table =
nullptr;
425 info.dst = dst->format;
438 const SDL_Rect *
const srcrect,
439 SDL_Surface *
const dst,
440 const SDL_Rect *
const dstrect)
452 if (src ==
nullptr ||
462 if (dstrect ==
nullptr)
477 if (srcrect !=
nullptr)
484 maxw = src->w - srcx;
490 maxh = src->h - srcy;
505 const SDL_Rect *
const clip = &dst->clip_rect;
516 dx = dr.x + w - clip->x - clip->w;
527 dy = dr.y + h - clip->y - clip->h;
#define reportAlways(...)
#define A_DEFAULT_COPY(func)
bool info(InputEvent &event)
unsigned int GFX_ALPHA_ADJUST_ARRAY[256]
static void _SDL_gfxBlitBlitterRGBA(const SDL_gfxBlitInfo *const info)
static int _SDL_gfxBlitRGBACall(const SDL_Surface *const src, const SDL_Rect *const srcrect, const SDL_Surface *const dst, const SDL_Rect *const dstrect)
#define GFX_DUFFS_LOOP4(pixel_copy_increment, width)
int SDLgfxBlitRGBA(const SDL_Surface *const src, const SDL_Rect *const srcrect, SDL_Surface *const dst, const SDL_Rect *const dstrect)