| 53 | } |
| 54 | |
| 55 | std::string ToString( const Tr2BitmapDimensions& desc ) |
| 56 | { |
| 57 | char buf[128]; |
| 58 | switch( desc.GetType() ) |
| 59 | { |
| 60 | case ImageIO::TEX_TYPE_1D: |
| 61 | sprintf_s( buf, "1D %u fmt=%u", desc.GetWidth(), (uint32_t)desc.GetFormat() ); |
| 62 | break; |
| 63 | case ImageIO::TEX_TYPE_2D: |
| 64 | sprintf_s( buf, "2D %ux%u fmt=%u", desc.GetWidth(), desc.GetHeight(), (uint32_t)desc.GetFormat() ); |
| 65 | break; |
| 66 | case ImageIO::TEX_TYPE_3D: |
| 67 | sprintf_s( buf, "3D %ux%ux%u fmt=%u", desc.GetWidth(), desc.GetHeight(), desc.GetDepth(), (uint32_t)desc.GetFormat() ); |
| 68 | break; |
| 69 | case ImageIO::TEX_TYPE_CUBE: |
| 70 | sprintf_s( buf, "Cube %ux%u fmt=%u", desc.GetWidth(), desc.GetHeight(), (uint32_t)desc.GetFormat() ); |
| 71 | break; |
| 72 | default: |
| 73 | strcpy_s( buf, "Invalid type" ); |
| 74 | break; |
| 75 | } |
| 76 | return std::string( buf ); |
| 77 | } |
| 78 | |
| 79 | } |
| 80 | |