Re-added prefix handling for named texture lookups for image asset fields

Changed render-out of shape preview images to use png
Added filter against previewCache folder
This commit is contained in:
JeffR 2025-05-28 17:47:23 -05:00
parent 0fa8b97f91
commit 8ed3bab44c
7 changed files with 10 additions and 20 deletions

View file

@ -626,28 +626,13 @@ const char* ShapeAsset::generateCachedPreviewImage(S32 resolution, String overri
delete imposterCap;
delete shape;
String dumpPath = String(mFilePath) + "_Preview.dds";
String dumpPath = String(mFilePath) + ".png";
char* returnBuffer = Con::getReturnBuffer(128);
dSprintf(returnBuffer, 128, "%s", dumpPath.c_str());
/*FileStream stream;
if (stream.open(dumpPath, Torque::FS::File::Write))
destBmp.writeBitmap("png", stream);
stream.close();*/
imposter->writeBitmap("png", dumpPath);
DDSFile* ddsDest = DDSFile::createDDSFileFromGBitmap(imposter);
ImageUtil::ddsCompress(ddsDest, GFXFormatBC2);
// Finally save the imposters to disk.
FileStream fs;
if (fs.open(returnBuffer, Torque::FS::File::Write))
{
ddsDest->write(fs);
fs.close();
}
delete ddsDest;
delete imposter;
delete imposterNrml;