Skip to content

Commit

Permalink
Use blit_surface() instead of SDL_BlitSurface() in the ~BG() implemen…
Browse files Browse the repository at this point in the history
…tation

For some reason, ~BG() used SDL_BlitSurface() directly instead of using
the alternate blit_surface() implementation, unlike every other image
path function type in existence that needs to do blitting.

This works the first time when scaling or cropping an image (say,
"misc/blank-hex.png~BG()~CROP(0,0,34,34)"), but the second time it's
used with different scaling/cropping parameters, it yields the result it
would without ~BG() in the pipeline. This is somehow remedied by this
change, and I don't see any potential issues arising from it anyway
(save for a negligible performance impact on ~BG(), maybe).
  • Loading branch information
irydacea committed Mar 8, 2014
1 parent cfc3879 commit 9144fe1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelog
Expand Up @@ -18,6 +18,8 @@ Version 1.11.11+dev:
* Increased the experience requirement for the Saree from 56 to 64
* Miscellaneous and bug fixes:
* Fix Fisher-Yates implemenation of Lua helper.shuffle (bug #21706)
* Fixed issues with the ~BG() image path function not always working with
cached images.
* Idle controlled sides now serialize as human controlled.

Version 1.11.11:
Expand Down
2 changes: 1 addition & 1 deletion src/image_modifications.cpp
Expand Up @@ -454,7 +454,7 @@ surface background_modification::operator()(const surface &src) const
SDL_FillRect(ret, NULL, SDL_MapRGBA(ret->format, color_.r, color_.g,
color_.b, color_.unused));
SDL_SetAlpha(src, SDL_SRCALPHA, SDL_ALPHA_OPAQUE);
SDL_BlitSurface(src, NULL, ret, NULL);
blit_surface(src, NULL, ret, NULL);
return ret;
}

Expand Down

0 comments on commit 9144fe1

Please sign in to comment.