MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / getImageInfo

Method getImageInfo

Engine/source/T3D/assets/ImageAsset.cpp:358–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356}
357
358const char* ImageAsset::getImageInfo()
359{
360 if (mIsValidImage)
361 {
362 static const U32 bufSize = 2048;
363 char* returnBuffer = Con::getReturnBuffer(bufSize);
364
365 GFXTexHandle newTex = TEXMGR->createTexture(mImagePath, &GFXStaticTextureSRGBProfile);
366 if (newTex)
367 {
368 dSprintf(returnBuffer, bufSize, "%s %d %d %d", GFXStringTextureFormat[newTex->getFormat()], newTex->getHeight(), newTex->getWidth(), newTex->getDepth());
369 newTex = nullptr;
370 }
371 else
372 {
373 dSprintf(returnBuffer, bufSize, "ImageAsset::getImageInfo() - Failed to get image info for %s", getAssetId());
374 }
375
376 return returnBuffer;
377 }
378
379 return "";
380}
381
382const char* ImageAsset::getImageTypeNameFromType(ImageAsset::ImageTypes type)
383{

Callers 1

ImageAsset.cppFile · 0.80

Calls 7

getReturnBufferFunction · 0.85
dSprintfFunction · 0.85
createTextureMethod · 0.45
getFormatMethod · 0.45
getHeightMethod · 0.45
getWidthMethod · 0.45
getDepthMethod · 0.45

Tested by

no test coverage detected