(986a3bf)
#include "resources/sdlgfxblitfunc.h"
#include "utils/cast.h"
#include "utils/checkutils.h"
#include <SDL_video.h>
#include "debug.h"
Go to the source code of this file.
|
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) |
|
int | SDLgfxBlitRGBA (const SDL_Surface *const src, const SDL_Rect *const srcrect, SDL_Surface *const dst, const SDL_Rect *const dstrect) |
|
◆ GFX_DUFFS_LOOP4
#define GFX_DUFFS_LOOP4 |
( |
|
pixel_copy_increment, |
|
|
|
width |
|
) |
| |
Value: int n = ((width) + 3) / 4; \
switch ((width) & 3) \
{ \
case 0: do { \
pixel_copy_increment; \
case 3: pixel_copy_increment; \
case 2: pixel_copy_increment; \
case 1: pixel_copy_increment; \
default: ; \
} while (--n > 0 ); \
}
Definition at line 43 of file sdlgfxblitfunc.cpp.
◆ _SDL_gfxBlitBlitterRGBA()
static void _SDL_gfxBlitBlitterRGBA |
( |
const SDL_gfxBlitInfo *const |
info | ) |
|
|
static |
Definition at line 337 of file sdlgfxblitfunc.cpp.
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 |
bool info(InputEvent &event)
unsigned int GFX_ALPHA_ADJUST_ARRAY[256]
#define GFX_DUFFS_LOOP4(pixel_copy_increment, width)
References anonymous_namespace{sdlgfxblitfunc.cpp}::GFX_ALPHA_ADJUST_ARRAY, GFX_DUFFS_LOOP4, and Actions::info().
Referenced by _SDL_gfxBlitRGBACall().
◆ _SDL_gfxBlitRGBACall()
static int _SDL_gfxBlitRGBACall |
( |
const SDL_Surface *const |
src, |
|
|
const SDL_Rect *const |
srcrect, |
|
|
const SDL_Surface *const |
dst, |
|
|
const SDL_Rect *const |
dstrect |
|
) |
| |
|
static |
Definition at line 393 of file sdlgfxblitfunc.cpp.
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;
static void _SDL_gfxBlitBlitterRGBA(const SDL_gfxBlitInfo *const info)
References _SDL_gfxBlitBlitterRGBA(), CAST_S32, and Actions::info().
Referenced by SDLgfxBlitRGBA().
◆ SDLgfxBlitRGBA()
int SDLgfxBlitRGBA |
( |
const SDL_Surface *const |
src, |
|
|
const SDL_Rect *const |
srcrect, |
|
|
SDL_Surface *const |
dst, |
|
|
const SDL_Rect *const |
dstrect |
|
) |
| |