gsdx hack: move m_skip and m_userhacks_skipdraw to GSState level

Avoid to push argument to call IsBadFrame
This commit is contained in:
Gregory Hainaut 2016-05-05 16:22:14 +02:00
parent 21d1bd48ec
commit c8dddfed06
5 changed files with 13 additions and 13 deletions

View File

@ -2582,7 +2582,7 @@ void GSState::SetupCrcHack()
g_crc_region = m_game.region;
}
bool GSState::IsBadFrame(int& skip, int UserHacks_SkipDraw)
bool GSState::IsBadFrame()
{
GSFrameInfo fi;
@ -2595,14 +2595,14 @@ bool GSState::IsBadFrame(int& skip, int UserHacks_SkipDraw)
fi.TZTST = m_context->TEST.ZTST;
#ifdef ENABLE_DYNAMIC_CRC_HACK
bool res=false; if(IsInvokedDynamicCrcHack(fi, skip, g_crc_region, res, m_crc)){ if( !res ) return false; } else
bool res=false; if(IsInvokedDynamicCrcHack(fi, m_skip, g_crc_region, res, m_crc)){ if( !res ) return false; } else
#endif
if(m_gsc && !m_gsc(fi, skip))
if(m_gsc && !m_gsc(fi, m_skip))
{
return false;
}
if(skip == 0 && (UserHacks_SkipDraw > 0) )
if(m_skip == 0 && (m_userhacks_skipdraw > 0) )
{
if(fi.TME)
{
@ -2610,14 +2610,14 @@ bool GSState::IsBadFrame(int& skip, int UserHacks_SkipDraw)
// General, often problematic post processing
if (GSLocalMemory::m_psm[fi.TPSM].depth || GSUtil::HasSharedBits(fi.FBP, fi.FPSM, fi.TBP0, fi.TPSM))
{
skip = UserHacks_SkipDraw;
m_skip = m_userhacks_skipdraw;
}
}
}
if(skip > 0)
if(m_skip > 0)
{
skip--;
m_skip--;
return true;
}

View File

@ -25,7 +25,6 @@
GSRendererHW::GSRendererHW(GSTextureCache* tc)
: m_width(1280)
, m_height(1024)
, m_skip(0)
, m_reset(false)
, m_upscale_multiplier(1)
, m_tc(tc)
@ -33,7 +32,6 @@ GSRendererHW::GSRendererHW(GSTextureCache* tc)
, m_double_downscale(false)
{
m_upscale_multiplier = theApp.GetConfig("upscale_multiplier", 1);
m_userhacks_skipdraw = !!theApp.GetConfig("UserHacks", 0) ? theApp.GetConfig("UserHacks_SkipDraw", 0) : 0;
m_userhacks_align_sprite_X = !!theApp.GetConfig("UserHacks_align_sprite_X", 0) && !!theApp.GetConfig("UserHacks", 0);
m_userhacks_round_sprite_offset = !!theApp.GetConfig("UserHacks", 0) ? theApp.GetConfig("UserHacks_round_sprite_offset", 0) : 0;
m_userhacks_disable_gs_mem_clear = theApp.GetConfig("UserHacks_DisableGsMemClear", 0) && theApp.GetConfig("UserHacks", 0);
@ -353,7 +351,7 @@ void GSRendererHW::RoundSpriteOffset()
void GSRendererHW::Draw()
{
if(m_dev->IsLost() || GSRenderer::IsBadFrame(m_skip, m_userhacks_skipdraw)) {
if(m_dev->IsLost() || IsBadFrame()) {
GL_INS("Warning skipping a draw call (%d)", s_n);
s_n += 3; // Keep it sync with SW renderer
return;

View File

@ -32,10 +32,8 @@ class GSRendererHW : public GSRenderer
private:
int m_width;
int m_height;
int m_skip;
bool m_reset;
int m_upscale_multiplier;
int m_userhacks_skipdraw;
bool m_userhacks_align_sprite_X;
bool m_userhacks_disable_gs_mem_clear;

View File

@ -34,6 +34,7 @@ GSState::GSState()
, m_path3hack(0)
, m_init_read_fifo_supported(false)
, m_gsc(NULL)
, m_skip(0)
, m_q(1.0f)
, m_texflush(true)
, m_vt(this)
@ -45,6 +46,7 @@ GSState::GSState()
m_nativeres = theApp.GetConfig("upscale_multiplier",1) == 1;
m_mipmap = !!theApp.GetConfig("mipmap", 1);
m_NTSC_Saturation = !!theApp.GetConfig("NTSC_Saturation", true);
m_userhacks_skipdraw = !!theApp.GetConfig("UserHacks", 0) ? theApp.GetConfig("UserHacks_SkipDraw", 0) : 0;
s_n = 0;
s_dump = !!theApp.GetConfig("dump", 0);

View File

@ -153,13 +153,15 @@ class GSState : public GSAlignedClass<32>
} m_tr;
protected:
bool IsBadFrame(int& skip, int UserHacks_SkipDraw);
bool IsBadFrame();
void SetupCrcHack();
int UserHacks_WildHack;
bool isPackedUV_HackFlag;
int m_crc_hack_level;
GetSkipCount m_gsc;
int m_skip;
int m_userhacks_skipdraw;
GSVertex m_v;
float m_q;