[Glide64] Make ghq_cmpr private

This commit is contained in:
zilmar 2017-03-10 08:21:52 +11:00
parent 154099d42f
commit 1412f2a705
5 changed files with 26 additions and 18 deletions

View File

@ -106,14 +106,6 @@ void ConfigCleanup(void)
void CloseConfig();
uint32_t texcmpr[] =
{
//NO_COMPRESSION, //"None"
// NCC_COMPRESSION, //"NCC"
S3TC_COMPRESSION, //"S3TC"
FXT1_COMPRESSION, //"FXT1"
};
uint32_t texhirs[] =
{
NO_HIRESTEXTURES, //"Do not use"
@ -635,7 +627,7 @@ public:
m_cmbTextureCompression.Attach(GetDlgItem(IDC_CMB_TEX_COMPRESS_MEHTOD));
m_cmbTextureCompression.SetItemData(m_cmbTextureCompression.AddString("S3TC"), 0);
m_cmbTextureCompression.SetItemData(m_cmbTextureCompression.AddString("FXT1"), 1);
SetComboBoxIndex(m_cmbTextureCompression, g_settings->ghq_cmpr);
SetComboBoxIndex(m_cmbTextureCompression, g_settings->ghq_cmpr());
tooltip = "Texture cache size:\n\nEnhanced and filtered textures can be cached to aid performance.\nThis setting will adjust how much PC memory will be dedicated for texture cache.\nThis helps boost performance if there are subsequent requests for the same texture (usually the case).\nNormally, 128MB should be more than enough but there is a sweet spot for each game.\nSuper Mario may not need more than 32megs, but Conker streams a lot of textures, so setting 256+ megs can boost performance.\nAdjust accordingly if you are encountering speed issues.\n'0' disables cache.\n\n[Recommended: PC and game dependant]";
TTSetTxt(IDC_TXT_TEXTURE_CACHE, tooltip.c_str());
@ -717,7 +709,7 @@ public:
g_settings->ghq_hirs_cmpr = (int)m_cbxHrsTexCompression.GetCheck() == BST_CHECKED;
g_settings->ghq_hirs_gz = (int)m_cbxHrsCompressCache.GetCheck() == BST_CHECKED;
g_settings->ghq_hirs_let_texartists_fly = (int)m_cbxHrsLetFly.GetCheck() == BST_CHECKED;
g_settings->ghq_cmpr = (int)m_cmbTextureCompression.GetItemData(m_cmbTextureCompression.GetCurSel());
g_settings->SetGhqCmpr((CSettings::TextureCompression_t)m_cmbTextureCompression.GetItemData(m_cmbTextureCompression.GetCurSel()));
g_settings->ghq_cache_save = (int)m_cbxSaveTexCache.GetCheck() == BST_CHECKED;
if (memcmp(&oldsettings, g_settings, sizeof(oldsettings))) //check that settings were changed
{

View File

@ -659,7 +659,7 @@ int InitGfx()
if (g_settings->ghq_use)
{
/* Plugin path */
int options = g_settings->ghq_fltr() | g_settings->ghq_enht() | texcmpr[g_settings->ghq_cmpr] | texhirs[g_settings->ghq_hirs];
int options = g_settings->ghq_fltr() | g_settings->ghq_enht() | g_settings->ghq_cmpr() | texhirs[g_settings->ghq_hirs];
if (g_settings->ghq_enht_cmpr)
{
options |= COMPRESS_TEX;

View File

@ -38,7 +38,7 @@ CSettings::CSettings() :
m_texture_dir(""),
m_ghq_fltr(TextureFilter_None),
m_ghq_enht(TextureEnht_None),
ghq_cmpr(0),
m_ghq_cmpr(TextureCompression_S3TC),
ghq_hirs(0),
ghq_use(0),
ghq_enht_cmpr(0),
@ -137,7 +137,7 @@ void CSettings::RegisterSettings(void)
general_setting(Set_unk_as_red, "unk_as_red", 0);
general_setting(Set_unk_clear, "unk_clear", 0);
general_setting(Set_ghq_fltr, "ghq_fltr", TextureFilter_None);
general_setting(Set_ghq_cmpr, "ghq_cmpr", 0);
general_setting(Set_ghq_cmpr, "ghq_cmpr", TextureCompression_S3TC);
general_setting(Set_ghq_enht, "ghq_enht", TextureEnht_None);
general_setting(Set_ghq_hirs, "ghq_hirs", 0);
general_setting(Set_ghq_enht_cmpr, "ghq_enht_cmpr", 0);
@ -344,6 +344,15 @@ void CSettings::SetGhqEnht(TextureEnhancement_t value)
}
}
void CSettings::SetGhqCmpr(TextureCompression_t value)
{
if (value != m_ghq_cmpr)
{
m_ghq_cmpr = value;
m_dirty = true;
}
}
void CSettings::UpdateFrameBufferBits(uint32_t BitsToAdd, uint32_t BitsToRemove)
{
uint32_t frame_buffer_original = m_frame_buffer;
@ -447,7 +456,7 @@ void CSettings::ReadSettings()
GetSystemSettingSz(m_Set_texture_dir, texture_dir, sizeof(texture_dir));
m_texture_dir = texture_dir;
m_ghq_fltr = (TextureFilter_t)GetSetting(Set_ghq_fltr);
this->ghq_cmpr = (uint8_t)GetSetting(Set_ghq_cmpr);
m_ghq_cmpr = (TextureCompression_t)GetSetting(Set_ghq_cmpr);
m_ghq_enht = (TextureEnhancement_t)GetSetting(Set_ghq_enht);
this->ghq_hirs = (uint8_t)GetSetting(Set_ghq_hirs);
this->ghq_enht_cmpr = GetSetting(Set_ghq_enht_cmpr);
@ -716,7 +725,7 @@ void CSettings::WriteSettings(void)
#endif //_ENDUSER_RELEASE_
SetSetting(Set_ghq_fltr, m_ghq_fltr);
SetSetting(Set_ghq_cmpr, g_settings->ghq_cmpr);
SetSetting(Set_ghq_cmpr, m_ghq_cmpr);
SetSetting(Set_ghq_enht, m_ghq_enht);
SetSetting(Set_ghq_hirs, g_settings->ghq_hirs);
SetSetting(Set_ghq_enht_cmpr, g_settings->ghq_enht_cmpr);

View File

@ -107,6 +107,12 @@ public:
TextureEnht_HQ4X = 0x500,
};
enum TextureCompression_t
{
TextureCompression_S3TC = 0x3000,
TextureCompression_FXT1 = 0x1000,
};
enum SwapMode_t
{
SwapMode_Old = 0,
@ -193,7 +199,7 @@ public:
inline const char * texture_dir(void) const { return m_texture_dir.c_str(); }
inline TextureFilter_t ghq_fltr(void) const { return m_ghq_fltr; }
inline TextureEnhancement_t ghq_enht(void) const { return m_ghq_enht; }
int ghq_cmpr;
inline TextureCompression_t ghq_cmpr(void) const { return m_ghq_cmpr; }
int ghq_hirs;
int ghq_use;
int ghq_enht_cmpr;
@ -263,6 +269,7 @@ public:
void SetBuffClear(bool value);
void SetGhqFltr(TextureFilter_t value);
void SetGhqEnht(TextureEnhancement_t value);
void SetGhqCmpr(TextureCompression_t value);
void UpdateFrameBufferBits(uint32_t BitsToAdd, uint32_t BitsToRemove);
ucode_t DetectUCode(uint32_t uc_crc);
void SetUcode(ucode_t value);
@ -305,6 +312,7 @@ private:
std::string m_texture_dir;
TextureFilter_t m_ghq_fltr;
TextureEnhancement_t m_ghq_enht;
TextureCompression_t m_ghq_cmpr;
ucode_t m_ucode;
StippleMode_t m_stipple_mode;
hacks_t m_hacks;

View File

@ -163,8 +163,7 @@ typedef struct {
uint32_t lr_x;
uint32_t lr_y;
} SCISSOR;
extern uint32_t texcmpr[];
extern uint32_t texhirs[];
typedef struct {