From 290e62f179a86328f90aaac3c87d4d640637dec6 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Tue, 22 Feb 2022 18:01:39 -0800 Subject: Remove casts to integers for texture and EFB formats The only remaining casts for these types that I know of are in TextureInfo (where format_name is set to the int version of the format, and since that affects filenames and probably would break resource packs, I'm not changing it) and in TextureDecoder_Common's TexDecoder_DrawOverlay, which will be handled separately. --- Source/Core/VideoCommon/TextureDecoder_Common.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'Source/Core/VideoCommon/TextureDecoder_Common.cpp') diff --git a/Source/Core/VideoCommon/TextureDecoder_Common.cpp b/Source/Core/VideoCommon/TextureDecoder_Common.cpp index 798496ac6d..bc2de947ea 100644 --- a/Source/Core/VideoCommon/TextureDecoder_Common.cpp +++ b/Source/Core/VideoCommon/TextureDecoder_Common.cpp @@ -50,8 +50,7 @@ int TexDecoder_GetTexelSizeInNibbles(TextureFormat format) case TextureFormat::XFB: return 4; default: - PanicAlertFmt("Invalid Texture Format ({:#X})! (GetTexelSizeInNibbles)", - static_cast(format)); + PanicAlertFmt("Invalid Texture Format {}! (GetTexelSizeInNibbles)", format); return 1; } } @@ -90,8 +89,7 @@ int TexDecoder_GetBlockWidthInTexels(TextureFormat format) case TextureFormat::XFB: return 16; default: - PanicAlertFmt("Invalid Texture Format ({:#X})! (GetBlockWidthInTexels)", - static_cast(format)); + PanicAlertFmt("Invalid Texture Format {}! (GetBlockWidthInTexels)", format); return 8; } } @@ -125,8 +123,7 @@ int TexDecoder_GetBlockHeightInTexels(TextureFormat format) case TextureFormat::XFB: return 1; default: - PanicAlertFmt("Invalid Texture Format ({:#X})! (GetBlockHeightInTexels)", - static_cast(format)); + PanicAlertFmt("Invalid Texture Format {}! (GetBlockHeightInTexels)", format); return 4; } } @@ -160,8 +157,7 @@ int TexDecoder_GetEFBCopyBlockWidthInTexels(EFBCopyFormat format) case EFBCopyFormat::XFB: return 16; default: - PanicAlertFmt("Invalid EFB Copy Format ({:#X})! (GetEFBCopyBlockWidthInTexels)", - static_cast(format)); + PanicAlertFmt("Invalid EFB Copy Format {}! (GetEFBCopyBlockWidthInTexels)", format); return 8; } } @@ -195,8 +191,7 @@ int TexDecoder_GetEFBCopyBlockHeightInTexels(EFBCopyFormat format) case EFBCopyFormat::XFB: return 1; default: - PanicAlertFmt("Invalid EFB Copy Format ({:#X})! (GetEFBCopyBlockHeightInTexels)", - static_cast(format)); + PanicAlertFmt("Invalid EFB Copy Format {}! (GetEFBCopyBlockHeightInTexels)", format); return 4; } } @@ -247,8 +242,7 @@ TextureFormat TexDecoder_GetEFBCopyBaseFormat(EFBCopyFormat format) case EFBCopyFormat::XFB: return TextureFormat::XFB; default: - PanicAlertFmt("Invalid EFB Copy Format ({:#X})! (GetEFBCopyBaseFormat)", - static_cast(format)); + PanicAlertFmt("Invalid EFB Copy Format ()! (GetEFBCopyBaseFormat)", format); return static_cast(format); } } -- cgit v1.2.3