From 9144fe1e3cb5fdb6360fecea6d6aac64503f4461 Mon Sep 17 00:00:00 2001 From: "Ignacio R. Morelle" Date: Fri, 7 Mar 2014 22:44:26 -0300 Subject: [PATCH] Use blit_surface() instead of SDL_BlitSurface() in the ~BG() implementation 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). --- changelog | 2 ++ src/image_modifications.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog b/changelog index 97b05a6016af..ac762b5ddf8e 100644 --- a/changelog +++ b/changelog @@ -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: diff --git a/src/image_modifications.cpp b/src/image_modifications.cpp index 47a308bc9d2a..f0d43597c417 100644 --- a/src/image_modifications.cpp +++ b/src/image_modifications.cpp @@ -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; }