Update combine_image.cpp

This commit is contained in:
GenevensiS
2024-09-17 10:22:54 +02:00
parent c956901a37
commit 488e54fed2
+2 -6
View File
@@ -107,12 +107,8 @@ void combine_image_do(Image& a, Image b) {
void combine_image(Image& a, const Image& b, ImageCombine combine) {
// Images must have same size
assert(a.GetWidth() == b.GetWidth());
assert(a.GetHeight() == b.GetHeight());
// Copy alpha channel?
if (b.HasAlpha()) {
if (!a.HasAlpha()) a.InitAlpha();
memcpy(a.GetAlpha(), b.GetAlpha(), a.GetWidth() * a.GetHeight());
if (a.GetWidth() != b.GetWidth() || a.GetHeight() != b.GetHeight()) {
throw Error(_ERROR_("images used for combine blending must have the same size"));
}
// Combine image data, by dispatching to combineImageDo
switch(combine) {