From 068855bbd641efd0d941c2005fb4f33459e32b03 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Mon, 21 Mar 2011 05:46:33 +0000 Subject: Moved per-game graphics configuration to the game-list right click menu. It will be too difficult to make the "profiles" drop-down thing work with 3-state vs 2-state checkboxes. The per-game settings now have "undetermined" states, except for the radio buttons(I'll fix that later). It's super hacky right now. Video config (probably all config stuff) could be redone. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7386 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/VideoCommon/Src/TextureDecoder.cpp | 45 +++++++++++++------------- 1 file changed, 22 insertions(+), 23 deletions(-) (limited to 'Source/Core/VideoCommon/Src/TextureDecoder.cpp') diff --git a/Source/Core/VideoCommon/Src/TextureDecoder.cpp b/Source/Core/VideoCommon/Src/TextureDecoder.cpp index 85872a8b0e..3399d5f429 100644 --- a/Source/Core/VideoCommon/Src/TextureDecoder.cpp +++ b/Source/Core/VideoCommon/Src/TextureDecoder.cpp @@ -685,17 +685,13 @@ PC_TexFormat GetPC_TexFormat(int texformat, int tlutfmt) return PC_TEX_FMT_NONE; } -//switch endianness, unswizzle -//TODO: to save memory, don't blindly convert everything to argb8888 -//also ARGB order needs to be swapped later, to accommodate modern hardware better -//need to add DXT support too -PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt) +inline void SetOpenMPThreadCount(int width, int height) { #ifdef _OPENMP - //Dont use multithreading in small Textures - if ((width > 127 && height > 127) && g_ActiveConfig.bOMPDecoder) + // Dont use multithreading in small Textures + if (g_ActiveConfig.bOMPDecoder && width > 127 && height > 127) { - //don't span to many threads they will kill the rest of the emu :) + // don't span to many threads they will kill the rest of the emu :) omp_set_num_threads((cpu_info.num_cores + 2) / 3); } else @@ -703,8 +699,19 @@ PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int heigh omp_set_num_threads(1); } #endif - int Wsteps4 = (width + 3) / 4; - int Wsteps8 = (width + 7) / 8; +} + +//switch endianness, unswizzle +//TODO: to save memory, don't blindly convert everything to argb8888 +//also ARGB order needs to be swapped later, to accommodate modern hardware better +//need to add DXT support too +PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int height, int texformat, int tlutaddr, int tlutfmt) +{ + SetOpenMPThreadCount(width, height); + + const int Wsteps4 = (width + 3) / 4; + const int Wsteps8 = (width + 7) / 8; + switch (texformat) { case GX_TF_C4: @@ -967,19 +974,11 @@ PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int heigh PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int height, int texformat, int tlutaddr, int tlutfmt) { -#ifdef _OPENMP - if ((width > 127 && height > 127) && g_ActiveConfig.bOMPDecoder) - { - //don't span to many threads they will kill the rest of the emu :) - omp_set_num_threads((cpu_info.num_cores + 2) / 3); - } - else - { - omp_set_num_threads(1); - } -#endif - int Wsteps4 = (width + 3) / 4; - int Wsteps8 = (width + 7) / 8; + SetOpenMPThreadCount(width, height); + + const int Wsteps4 = (width + 3) / 4; + const int Wsteps8 = (width + 7) / 8; + switch (texformat) { case GX_TF_C4: -- cgit v1.2.3