diff --git a/Source/Glide64/Config.cpp b/Source/Glide64/Config.cpp index 4558e14ca..a4a387431 100644 --- a/Source/Glide64/Config.cpp +++ b/Source/Glide64/Config.cpp @@ -68,6 +68,7 @@ #include extern HINSTANCE hinstDLL; +extern bool g_ghq_use; extern CriticalSection * g_ProcessDListCS; @@ -796,10 +797,10 @@ void CALL DllConfig(HWND hParent) ReleaseGfx(); rdp_reset(); } - if (g_settings->ghq_use) + if (g_ghq_use) { ext_ghq_shutdown(); - g_settings->ghq_use = 0; + g_ghq_use = false; } } else diff --git a/Source/Glide64/Main.cpp b/Source/Glide64/Main.cpp index 6bac928f1..71e8edda3 100644 --- a/Source/Glide64/Main.cpp +++ b/Source/Glide64/Main.cpp @@ -115,6 +115,7 @@ uint32_t offset_cursor = 0; uint32_t offset_textures = 0; uint32_t offset_texbuf1 = 0; +bool g_ghq_use = false; int capture_screen = 0; std::string capture_path; @@ -653,10 +654,10 @@ int InitGfx() grClipWindow(0, 0, g_settings->scr_res_x(), g_settings->scr_res_y()); rdp.update |= UPDATE_SCISSOR | UPDATE_COMBINE | UPDATE_ZBUF_ENABLED | UPDATE_CULL_MODE; - if (!g_settings->ghq_use) + if (!g_ghq_use) { - g_settings->ghq_use = g_settings->ghq_fltr() != CSettings::TextureFilter_None || g_settings->ghq_enht() != CSettings::TextureEnht_None || g_settings->ghq_hirs() != CSettings::HiResPackFormat_None; - if (g_settings->ghq_use) + g_ghq_use = g_settings->ghq_fltr() != CSettings::TextureFilter_None || g_settings->ghq_enht() != CSettings::TextureEnht_None || g_settings->ghq_hirs() != CSettings::HiResPackFormat_None; + if (g_ghq_use) { /* Plugin path */ int options = g_settings->ghq_fltr() | g_settings->ghq_enht() | g_settings->ghq_cmpr() | g_settings->ghq_hirs(); @@ -701,7 +702,7 @@ int InitGfx() options |= DUMP_TEX; } - g_settings->ghq_use = (int)ext_ghq_init(voodoo.max_tex_size, // max texture width supported by hardware + g_ghq_use = (int)ext_ghq_init(voodoo.max_tex_size, // max texture width supported by hardware voodoo.max_tex_size, // max texture height supported by hardware voodoo.sup_32bit_tex ? 32 : 16, // max texture bpp supported by hardware options, @@ -711,7 +712,7 @@ int InitGfx() DisplayLoadProgress); } } - if (g_settings->ghq_use && strstr(extensions, "TEXMIRROR")) + if (g_ghq_use && strstr(extensions, "TEXMIRROR")) { voodoo.sup_mirroring = 1; } @@ -899,10 +900,10 @@ void CALL CloseDLL(void) { WriteTrace(TraceGlide64, TraceDebug, "-"); - if (g_settings->ghq_use) + if (g_ghq_use) { ext_ghq_shutdown(); - g_settings->ghq_use = 0; + g_ghq_use = false; } if (g_settings) @@ -1152,10 +1153,10 @@ void CALL RomOpen(void) name[strlen(name) - 1] = 0; } - if (g_settings->ghq_use && strcmp(rdp.RomName, name) != 0) + if (g_ghq_use && strcmp(rdp.RomName, name) != 0) { ext_ghq_shutdown(); - g_settings->ghq_use = 0; + g_ghq_use = false; } strcpy(rdp.RomName, name); g_settings->ReadGameSettings(name); diff --git a/Source/Glide64/Settings.cpp b/Source/Glide64/Settings.cpp index a19d05a9a..7a55eb070 100644 --- a/Source/Glide64/Settings.cpp +++ b/Source/Glide64/Settings.cpp @@ -40,7 +40,6 @@ CSettings::CSettings() : m_ghq_enht(TextureEnht_None), m_ghq_cmpr(TextureCompression_S3TC), m_ghq_hirs(HiResPackFormat_None), -ghq_use(0), ghq_enht_cmpr(0), ghq_enht_f16bpp(0), ghq_enht_gz(0), diff --git a/Source/Glide64/Settings.h b/Source/Glide64/Settings.h index 956cc0ae1..7f47a97eb 100644 --- a/Source/Glide64/Settings.h +++ b/Source/Glide64/Settings.h @@ -207,7 +207,6 @@ public: inline TextureEnhancement_t ghq_enht(void) const { return m_ghq_enht; } inline TextureCompression_t ghq_cmpr(void) const { return m_ghq_cmpr; } inline HiResPackFormat_t ghq_hirs(void) const { return m_ghq_hirs; } - int ghq_use; int ghq_enht_cmpr; int ghq_enht_f16bpp; int ghq_enht_gz; diff --git a/Source/Glide64/TexCache.cpp b/Source/Glide64/TexCache.cpp index 17080f517..92878f2bf 100644 --- a/Source/Glide64/TexCache.cpp +++ b/Source/Glide64/TexCache.cpp @@ -60,6 +60,8 @@ uint8_t *texture_buffer = tex1; #include "TexModCI.h" #include "CRC.h" +extern bool g_ghq_use; + typedef struct TEXINFO_t { int real_image_width, real_image_height; // FOR ALIGNMENT PURPOSES ONLY!!! @@ -1255,7 +1257,7 @@ void LoadTex(int id, int tmu) GHQTexInfo ghqTexInfo; memset(&ghqTexInfo, 0, sizeof(GHQTexInfo)); uint32_t g64_crc = cache->crc; - if (g_settings->ghq_use) + if (g_ghq_use) { int bpl; uint8_t* addr = (uint8_t*)(gfx.RDRAM + rdp.addr[rdp.tiles[td].t_mem]); @@ -1579,7 +1581,7 @@ void LoadTex(int id, int tmu) if (GfxInitDone) { - if (g_settings->ghq_use) + if (g_ghq_use) { if (!ghqTexInfo.data) if (!g_settings->ghq_enht_nobg || !rdp.texrecting || (texinfo[id].splits == 1 && texinfo[id].width <= 256))