mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
Merge pull request #765 from Azaezel/alpha40/previewSizeSlimdown
bump down saveScaledImage default to 256
This commit is contained in:
commit
bf1e8705ac
2 changed files with 3 additions and 3 deletions
|
|
@ -1362,7 +1362,7 @@ DefineEngineFunction( getBitmapInfo, String, ( const char *filename ),,
|
||||||
image->getFormat());
|
image->getFormat());
|
||||||
}
|
}
|
||||||
|
|
||||||
DefineEngineFunction(saveScaledImage, bool, (const char* bitmapSource, const char* bitmapDest, S32 resolutionSize), ("", "", 512),
|
DefineEngineFunction(saveScaledImage, bool, (const char* bitmapSource, const char* bitmapDest, S32 resolutionSize), ("", "", 256),
|
||||||
"Loads an image from the source path, and scales it down to the target resolution before"
|
"Loads an image from the source path, and scales it down to the target resolution before"
|
||||||
"Saving it out to the destination path.\n")
|
"Saving it out to the destination path.\n")
|
||||||
{
|
{
|
||||||
|
|
@ -1419,7 +1419,7 @@ DefineEngineFunction(saveScaledImage, bool, (const char* bitmapSource, const cha
|
||||||
image->extrudeMipLevels();
|
image->extrudeMipLevels();
|
||||||
|
|
||||||
U32 mipCount = image->getNumMipLevels();
|
U32 mipCount = image->getNumMipLevels();
|
||||||
U32 targetMips = mFloor(mLog2((F32)resolutionSize)) + 1;
|
U32 targetMips = mFloor(mLog2((F32)(resolutionSize ? resolutionSize : 256))) + 1;
|
||||||
|
|
||||||
if (mipCount > targetMips)
|
if (mipCount > targetMips)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,7 @@ function AssetBrowser::buildImageAssetPreview(%this, %assetDef, %previewData, %f
|
||||||
{
|
{
|
||||||
displayEditorLoadingGui("Generating Image Asset Preview...");
|
displayEditorLoadingGui("Generating Image Asset Preview...");
|
||||||
|
|
||||||
%success = saveScaledImage(%assetDef.getImagePath(), %previewFilePath);
|
%success = saveScaledImage(%assetDef.getImagePath(), %previewFilePath, EditorSettings.value("Assets/Browser/PreviewImageSize"));
|
||||||
|
|
||||||
if(%success)
|
if(%success)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue