Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed picking blit function when RLE fails
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Dec 7, 2008
1 parent 031386f commit 59d361b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/video/SDL_blit.h
Expand Up @@ -52,6 +52,7 @@
#define SDL_COPY_RLE_DESIRED 0x00001000
#define SDL_COPY_RLE_COLORKEY 0x00002000
#define SDL_COPY_RLE_ALPHAKEY 0x00004000
#define SDL_COPY_RLE_MASK (SDL_COPY_RLE_DESIRED|SDL_COPY_RLE_COLORKEY|SDL_COPY_RLE_ALPHAKEY)

/* SDL blit CPU flags */
#define SDL_CPU_ANY 0x00000000
Expand Down
2 changes: 1 addition & 1 deletion src/video/SDL_blit_0.c
Expand Up @@ -465,7 +465,7 @@ SDL_CalculateBlit0(SDL_Surface * surface)
} else {
which = surface->map->dst->format->BytesPerPixel;
}
switch (surface->map->info.flags) {
switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
case 0:
return bitmap_blit[which];

Expand Down
2 changes: 1 addition & 1 deletion src/video/SDL_blit_1.c
Expand Up @@ -532,7 +532,7 @@ SDL_CalculateBlit1(SDL_Surface * surface)
} else {
which = dstfmt->BytesPerPixel;
}
switch (surface->map->info.flags) {
switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
case 0:
return one_blit[which];

Expand Down
2 changes: 1 addition & 1 deletion src/video/SDL_blit_A.c
Expand Up @@ -2153,7 +2153,7 @@ SDL_CalculateBlitA(SDL_Surface * surface)
SDL_PixelFormat *sf = surface->format;
SDL_PixelFormat *df = surface->map->dst->format;

switch (surface->map->info.flags) {
switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
case SDL_COPY_BLEND:
/* Per-pixel alpha blits */
switch (df->BytesPerPixel) {
Expand Down
2 changes: 1 addition & 1 deletion src/video/SDL_blit_N.c
Expand Up @@ -2430,7 +2430,7 @@ SDL_CalculateBlitN(SDL_Surface * surface)
return (NULL);
}

switch (surface->map->info.flags) {
switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) {
case 0:
blitfun = NULL;
if (dstfmt->BitsPerPixel == 8) {
Expand Down
2 changes: 1 addition & 1 deletion src/video/SDL_surface.c
Expand Up @@ -548,7 +548,7 @@ SDL_GetSurfaceScaleMode(SDL_Surface * surface, int *scaleMode)
return 0;
}

switch (surface->map->info.flags & (SDL_COPY_NEAREST)) {
switch (surface->map->info.flags & SDL_COPY_NEAREST) {
case SDL_COPY_NEAREST:
*scaleMode = SDL_TEXTURESCALEMODE_FAST;
break;
Expand Down

0 comments on commit 59d361b

Please sign in to comment.