summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/TextureDecoder.cpp
diff options
context:
space:
mode:
authoromegadox <omegadox@gmail.com>2009-08-11 20:36:13 +0000
committeromegadox <omegadox@gmail.com>2009-08-11 20:36:13 +0000
commit7aede7309f5d8a1b76f0d353bf8ec2c1e8d9753c (patch)
tree168cbee2e4f43785ba32242c4b379f7757d0ff5d /Source/Core/VideoCommon/Src/TextureDecoder.cpp
parentbcf7b2112be4df50a2f845bd2a8d61d933c5d7dc (diff)
GFX: Cleanup - Move OGL's GetBlockHeightInTexels and GetBlockWidthInTexels code into VideoCommon.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3962 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/TextureDecoder.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/TextureDecoder.cpp36
1 files changed, 34 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/Src/TextureDecoder.cpp b/Source/Core/VideoCommon/Src/TextureDecoder.cpp
index ae27a9909a..bb9e8f34d4 100644
--- a/Source/Core/VideoCommon/Src/TextureDecoder.cpp
+++ b/Source/Core/VideoCommon/Src/TextureDecoder.cpp
@@ -93,7 +93,7 @@ u32 TexDecoder_GetSafeTextureHash(const u8 *src, int width, int height, int texf
return hash;
}
-int TexDecoder_GetBlockWidthInTexels(int format)
+int TexDecoder_GetBlockWidthInTexels(u32 format)
{
switch (format)
{
@@ -108,13 +108,29 @@ int TexDecoder_GetBlockWidthInTexels(int format)
case GX_TF_C8: return 8;
case GX_TF_C14X2: return 4;
case GX_TF_CMPR: return 8;
+ case GX_CTF_R4: return 8;
+ case GX_CTF_RA4: return 8;
+ case GX_CTF_RA8: return 4;
+ case GX_CTF_A8: return 8;
+ case GX_CTF_R8: return 8;
+ case GX_CTF_G8: return 8;
+ case GX_CTF_B8: return 8;
+ case GX_CTF_RG8: return 4;
+ case GX_CTF_GB8: return 4;
+ case GX_TF_Z8: return 8;
+ case GX_TF_Z16: return 4;
+ case GX_TF_Z24X8: return 4;
+ case GX_CTF_Z4: return 8;
+ case GX_CTF_Z8M: return 8;
+ case GX_CTF_Z8L: return 8;
+ case GX_CTF_Z16L: return 4;
default:
ERROR_LOG(VIDEO, "Unsupported Texture Format (%08x)! (GetBlockWidthInTexels)", format);
return 8;
}
}
-int TexDecoder_GetBlockHeightInTexels(int format)
+int TexDecoder_GetBlockHeightInTexels(u32 format)
{
switch (format)
{
@@ -129,6 +145,22 @@ int TexDecoder_GetBlockHeightInTexels(int format)
case GX_TF_C8: return 4;
case GX_TF_C14X2: return 4;
case GX_TF_CMPR: return 4;
+ case GX_CTF_R4: return 8;
+ case GX_CTF_RA4: return 4;
+ case GX_CTF_RA8: return 2;
+ case GX_CTF_A8: return 4;
+ case GX_CTF_R8: return 4;
+ case GX_CTF_G8: return 4;
+ case GX_CTF_B8: return 4;
+ case GX_CTF_RG8: return 2;
+ case GX_CTF_GB8: return 2;
+ case GX_TF_Z8: return 4;
+ case GX_TF_Z16: return 2;
+ case GX_TF_Z24X8: return 1;
+ case GX_CTF_Z4: return 8;
+ case GX_CTF_Z8M: return 4;
+ case GX_CTF_Z8L: return 4;
+ case GX_CTF_Z16L: return 2;
default:
ERROR_LOG(VIDEO, "Unsupported Texture Format (%08x)! (GetBlockHeightInTexels)", format);
return 4;