Skip to content

Commit

Permalink
Only blit neutral surfaces.
Browse files Browse the repository at this point in the history
On the Mac loaded images are not in the neutral format causing rendering
glitches when using blit_surface using these images. Test and when
needed convert the image before using it.

Fixes bug #22045.
  • Loading branch information
mordante committed May 18, 2014
1 parent 8f03e00 commit 91da7fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion changelog
@@ -1,4 +1,6 @@
Version 1.11.14+dev:
* Graphics:
* Fixed bug #22045: Only blit neutral surfaces.
* Language and i18n:
* Updated translations: Portuguese
* Miscellaneous and bug fixes:
Expand All @@ -12,7 +14,6 @@ Version 1.11.14+dev:
* Fix bug #22020: make base units with variations help entry clickable
from the 'Unit Description' menu entry or from side pane.


Version 1.11.14:
* Campaigns:
* Son of the Black Eye: minor balance tweaks to scenarios 7, 8 and 14
Expand Down
6 changes: 4 additions & 2 deletions src/sdl_utils.cpp
Expand Up @@ -1892,12 +1892,14 @@ surface create_compatible_surface(const surface &surf, int width, int height)
return s;
}

void blit_surface(const surface& src,
void blit_surface(const surface& surf,
const SDL_Rect* srcrect, surface& dst, const SDL_Rect* dstrect)
{
assert(src);
assert(surf);
assert(dst);

const surface& src = is_neutral(surf) ? surf : make_neutral_surface(surf);

// Get the areas to blit
SDL_Rect dst_rect = create_rect(0, 0, dst->w, dst->h);
if(dstrect) {
Expand Down

0 comments on commit 91da7fe

Please sign in to comment.