Always write png instead of jpg.
This commit is contained in:
parent
815c19e893
commit
f718110834
|
@ -118,24 +118,16 @@ std::shared_ptr<TextureData> TextureBuilder::combine(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// write a .png iff we need transparency in the destination texture
|
|
||||||
bool png = includeAlphaChannel;
|
|
||||||
|
|
||||||
std::vector<char> imgBuffer;
|
std::vector<char> imgBuffer;
|
||||||
int res;
|
int res;
|
||||||
if (png) {
|
res = stbi_write_png_to_func(
|
||||||
res = stbi_write_png_to_func(
|
WriteToVectorContext,
|
||||||
WriteToVectorContext,
|
&imgBuffer,
|
||||||
&imgBuffer,
|
width,
|
||||||
width,
|
height,
|
||||||
height,
|
channels,
|
||||||
channels,
|
mergedPixels.data(),
|
||||||
mergedPixels.data(),
|
width * channels);
|
||||||
width * channels);
|
|
||||||
} else {
|
|
||||||
res = stbi_write_jpg_to_func(
|
|
||||||
WriteToVectorContext, &imgBuffer, width, height, channels, mergedPixels.data(), 80);
|
|
||||||
}
|
|
||||||
if (!res) {
|
if (!res) {
|
||||||
fmt::printf("Warning: failed to generate merge texture '%s'.\n", mergedFilename);
|
fmt::printf("Warning: failed to generate merge texture '%s'.\n", mergedFilename);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
Loading…
Reference in New Issue