Reverted r3063 as the last revision obsoleted it and it was causing suspend/resume issues with the software renderer, removed an unnecessary GSclose() and ResetDevice() call each

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3068 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
sudonim1 2010-05-23 17:26:37 +00:00
parent ab77eb4646
commit 4a427059d8
6 changed files with 23 additions and 16 deletions

View File

@ -137,16 +137,16 @@ EXPORT_C GSclose()
{
if( !s_gs ) return;
s_gs->ResetDevice();
delete s_gs->m_dev;
s_gs->m_dev = NULL;
s_gs->m_wnd.Detach();
delete s_gs;
s_gs = NULL;
}
static INT32 _GSopen(void* dsp, char* title, int renderer)
{
GSclose();
GSDevice* dev = NULL;
if( renderer == -1 )
@ -156,6 +156,16 @@ static INT32 _GSopen(void* dsp, char* title, int renderer)
try
{
if (s_renderer != renderer)
{
// Emulator has made a render change request, which requires a completely
// new s_gs -- if the emu doesn't save/restore the GS state across this
// GSopen call then they'll get corrupted graphics, but that's not my problem.
delete s_gs;
s_gs = NULL;
}
switch(renderer)
{
default:
@ -233,7 +243,6 @@ static INT32 _GSopen(void* dsp, char* title, int renderer)
EXPORT_C_(INT32) GSopen2( void* dsp, INT32 flags )
{
GSclose();
int renderer = theApp.GetConfig("renderer", 0);
if( flags & 4 )
{
@ -250,7 +259,6 @@ EXPORT_C_(INT32) GSopen2( void* dsp, INT32 flags )
EXPORT_C_(INT32) GSopen(void* dsp, char* title, int mt)
{
GSclose();
int renderer;
// Legacy GUI expects to acquire vsync from the configuration files.
@ -368,7 +376,6 @@ EXPORT_C_(int) GSfreeze(int mode, GSFreezeData* data)
}
else if(mode == FREEZE_LOAD)
{
s_gs->ResetDevice();
return s_gs->Defrost(data);
}

View File

@ -45,7 +45,7 @@ GSDevice::GSDevice()
GSDevice::~GSDevice()
{
for_each(m_pool.begin(), m_pool.end(), delete_object());
m_pool.clear();
delete m_backbuffer;
delete m_merge;
delete m_weavebob;

View File

@ -52,12 +52,14 @@ GSRenderer::GSRenderer()
GSRenderer::~GSRenderer()
{
if(m_dev)
/*if(m_dev)
{
m_dev->Reset(1, 1);
delete m_dev;
}
m_dev->Reset(1, 1, GSDevice::Windowed);
}*/
_aligned_free( m_tex_buff );
delete m_dev;
}
bool GSRenderer::CreateWnd(const string& title, int w, int h)

View File

@ -455,7 +455,7 @@ protected:
void Reset()
{
// TODO: GSreset can come from the main thread too => crash
m_tc->RemoveAll();
// m_tc->RemoveAll();
m_reset = true;

View File

@ -35,7 +35,6 @@ class GSTexture11 : public GSTexture
public:
explicit GSTexture11(ID3D11Texture2D* texture);
virtual ~GSTexture11() {};
bool Update(const GSVector4i& r, const void* data, int pitch);
bool Map(GSMap& m, const GSVector4i* r);

View File

@ -32,6 +32,5 @@ protected:
void Read(Target* t, const GSVector4i& r);
public:
virtual ~GSTextureCache11() {};
GSTextureCache11(GSRenderer* r);
};