@@ -1175,7 +1175,28 @@ bool TextureSource::generateImagePart(std::string part_of_name,
11751175 core::rect<s32>(pos_from, dim),
11761176 video::SColor(255,255,255,255),
11771177 NULL);*/
1178- blit_with_alpha (image, baseimg, pos_from, pos_to, dim);
1178+
1179+ core::dimension2d<u32 > dim_dst = baseimg->getDimension ();
1180+ if (dim == dim_dst) {
1181+ blit_with_alpha (image, baseimg, pos_from, pos_to, dim);
1182+ } else if (dim.Width * dim.Height < dim_dst.Width * dim_dst.Height ) {
1183+ // Upscale overlying image
1184+ video::IImage* scaled_image = m_device->getVideoDriver ()->
1185+ createImage (video::ECF_A8R8G8B8, dim_dst);
1186+ image->copyToScaling (scaled_image);
1187+
1188+ blit_with_alpha (scaled_image, baseimg, pos_from, pos_to, dim_dst);
1189+ scaled_image->drop ();
1190+ } else {
1191+ // Upscale base image
1192+ video::IImage* scaled_base = m_device->getVideoDriver ()->
1193+ createImage (video::ECF_A8R8G8B8, dim);
1194+ baseimg->copyToScaling (scaled_base);
1195+ baseimg->drop ();
1196+ baseimg = scaled_base;
1197+
1198+ blit_with_alpha (image, baseimg, pos_from, pos_to, dim);
1199+ }
11791200 }
11801201 // cleanup
11811202 image->drop ();
0 commit comments