summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/TextureDecoder.cpp
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2011-03-21 05:46:33 +0000
committerJordan Woyak <jordan.woyak@gmail.com>2011-03-21 05:46:33 +0000
commit068855bbd641efd0d941c2005fb4f33459e32b03 (patch)
treeeae52d160f4001a2bdf68a7d3cf70d6e9ec5fd91 /Source/Core/VideoCommon/Src/TextureDecoder.cpp
parent8eaed1c105d2ecd3c63cc728eee8bc1a493a27db (diff)
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
Diffstat (limited to 'Source/Core/VideoCommon/Src/TextureDecoder.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/TextureDecoder.cpp45
1 files changed, 22 insertions, 23 deletions
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: