| 908 | //-------------------------------------------------------------------------------------------------------------------- |
| 909 | |
| 910 | GBitmap *TextureManager::loadBitmap( const char* pTextureKey, bool recurse, bool nocompression ) |
| 911 | { |
| 912 | char fileNameBuffer[512]; |
| 913 | Con::expandPath( fileNameBuffer, sizeof(fileNameBuffer), pTextureKey ); |
| 914 | GBitmap *bmp = NULL; |
| 915 | |
| 916 | // Loop through the supported extensions to find the file. |
| 917 | U32 len = dStrlen(fileNameBuffer); |
| 918 | for (U32 i = 0; i < EXT_ARRAY_SIZE && bmp == NULL; i++) |
| 919 | { |
| 920 | #if defined(TORQUE_OS_IOS) |
| 921 | // check to see if requested no-compression... |
| 922 | if (nocompression && (dStrncmp( extArray[i], ".pvr", 4 ) == 0)) { |
| 923 | continue; |
| 924 | } |
| 925 | #endif |
| 926 | dStrcpy(fileNameBuffer + len, extArray[i]); |
| 927 | |
| 928 | bmp = (GBitmap*)ResourceManager->loadInstance(fileNameBuffer); |
| 929 | |
| 930 | if ( bmp != NULL && (bmp->getWidth() > MaximumProductSupportedTextureWidth || bmp->getHeight() > MaximumProductSupportedTextureHeight) ) |
| 931 | { |
| 932 | Con::warnf( "TextureManager::loadBitmap() - Cannot load bitmap '%s' as its dimensions exceed the maximum product-supported texture dimension.", fileNameBuffer ); |
| 933 | delete bmp; |
| 934 | return NULL; |
| 935 | } |
| 936 | } |
| 937 | |
| 938 | return bmp; |
| 939 | } |
| 940 | |
| 941 | //-------------------------------------------------------------------------------------------------------------------- |
| 942 |
nothing calls this directly
no test coverage detected