diff --git a/src/gx/Texture.cpp b/src/gx/Texture.cpp index a8b71ed..a009894 100644 --- a/src/gx/Texture.cpp +++ b/src/gx/Texture.cpp @@ -40,7 +40,7 @@ void AsyncTextureWait(CTexture* texture) { uint32_t CalcLevelCount(uint32_t width, uint32_t height) { uint32_t v2 = width; uint32_t v3 = height; - uint32_t levels = 1; + uint32_t v4 = 1; uint32_t v5; uint32_t v6; @@ -51,7 +51,7 @@ uint32_t CalcLevelCount(uint32_t width, uint32_t height) { while (v2 > 1 || v3 > 1) { v5 = v2 >> 1; - ++levels; + ++v4; v6 = v2 >> 1 < 1; v2 = 1; @@ -67,7 +67,7 @@ uint32_t CalcLevelCount(uint32_t width, uint32_t height) { } } - return levels; + return v4; } uint32_t CalcLevelOffset(uint32_t level, uint32_t width, uint32_t height, uint32_t fourCC) { @@ -84,7 +84,7 @@ uint32_t CalcLevelSize(uint32_t level, uint32_t width, uint32_t height, uint32_t uint32_t v4 = std::max(width >> level, 1u); uint32_t v5 = std::max(height >> level, 1u); - if (fourCC == PIXEL_DXT1 || fourCC == PIXEL_DXT3 || fourCC == PIXEL_DXT5) { + if (fourCC == 0 || fourCC == 1 || fourCC == 7) { if (v4 == 6 * v5) { if (v5 <= 4) { v5 = 4; @@ -104,7 +104,7 @@ uint32_t CalcLevelSize(uint32_t level, uint32_t width, uint32_t height, uint32_t uint32_t size; - if (fourCC == PIXEL_ARGB2565) { + if (fourCC == 9) { uint32_t v6 = v5 * v4; uint32_t v7 = v5 * v4 >> 2; @@ -159,34 +159,23 @@ void FillInSolidTexture(const CImVector& color, CTexture* texture) { uint32_t GetBitDepth(uint32_t fourCC) { switch (fourCC) { - case PIXEL_DXT1: + case 0: return 4; - case PIXEL_DXT3: - case PIXEL_A8: - case PIXEL_DXT5: + case 1: + case 6: + case 7: return 8; - case PIXEL_ARGB8888: + case 2: return 32; - case PIXEL_ARGB1555: - case PIXEL_ARGB4444: - case PIXEL_RGB565: + case 3: + case 4: + case 5: return 16; default: - #ifndef NDEBUG - SErrDisplayError( - 0x85100000, - __FILE__, - __LINE__, - "!\"GetBitDepth(): unhandled format\"", - 0, - 1u, - 1 - ); - #endif return 0; } }