Made the GSdx render switch thing a bit cleaner, moved it where it belongs

and changed the hotkey to F9. (Sure hope no plugin uses that yet :p )

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@698 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2 2009-03-06 10:04:32 +00:00
parent 5d971b5931
commit 9a89523532
4 changed files with 37 additions and 22 deletions

View File

@ -50,6 +50,7 @@ PcsxConfig Config;
u32 BiosVersion;
char CdromId[12];
static int g_Pcsx2Recording = 0; // true 1 if recording video and sound
bool renderswitch = 0;
const char *LabelAuthors = { N_(
"PCSX2, a PS2 emulator\n\n"
@ -650,7 +651,25 @@ void ProcessFKeys(int fkey, int shift)
case 8:
GSmakeSnapshot( SNAPSHOTS_DIR "/" );
break;
case 9: //gsdx "on the fly" renderer switching
if (!renderswitch) {
StateRecovery::MakeGsOnly();
g_EmulationInProgress = false;
CloseGS();
renderswitch = true; //go to dx9 sw
StateRecovery::Recover();
HostGui::BeginExecution(); //also sets g_EmulationInProgress to true later
}
else {
StateRecovery::MakeGsOnly();
g_EmulationInProgress = false;
CloseGS();
renderswitch = false; //return to default renderer
StateRecovery::Recover();
HostGui::BeginExecution(); //also sets g_EmulationInProgress to true later
}
break;
#ifdef PCSX2_DEVBUILD
case 11:

View File

@ -849,6 +849,21 @@ void ClosePlugins( bool closegs )
}
}
//used to close the GS plugin window and pads, to switch gsdx renderer
void CloseGS()
{
if( CHECK_MULTIGS ) mtgsWaitGS();
CLOSE_PLUGIN( PAD1 );
CLOSE_PLUGIN( PAD2 );
if( OpenStatus.GS )
{
gsClose();
OpenStatus.GS = false;
}
}
void ReleasePlugins()
{
if (!loadp) return;

View File

@ -32,6 +32,7 @@ void ReleasePlugins();
int OpenPlugins(const char* pTitleFilename);
void ClosePlugins( bool closegs );
void CloseGS();
int InitPlugins();
void ShutdownPlugins();

View File

@ -27,8 +27,6 @@
static bool sinit = false;
bool UseGui = true;
bool nDisableSC = false; // screensaver
bool renderswitch = 0;
// This instance is not modified by command line overrides so
// that command line plugins and stuff won't be saved into the
@ -431,7 +429,7 @@ namespace HostGui
case VK_F1: case VK_F2: case VK_F3: case VK_F4:
case VK_F5: case VK_F6: case VK_F7: case VK_F8:
case VK_F9: case VK_F10: case VK_F12:
case VK_F9: case VK_F10: case VK_F11: case VK_F12:
try
{
ProcessFKeys(ev->key-VK_F1 + 1, shiftkey);
@ -446,24 +444,6 @@ namespace HostGui
}
break;
case VK_F11: //gsdx "on the fly" renderer switching
if (!renderswitch) {
StateRecovery::MakeGsOnly();
g_EmulationInProgress = false;
ClosePlugins( 1 );
renderswitch = true; //go to dx9 sw
StateRecovery::Recover();
HostGui::BeginExecution(); //also sets g_EmulationInProgress to true later
}
else {
StateRecovery::MakeGsOnly();
g_EmulationInProgress = false;
ClosePlugins( 1 );
renderswitch = false; //return to default renderer
StateRecovery::Recover();
HostGui::BeginExecution(); //also sets g_EmulationInProgress to true later
}
break;
case VK_TAB:
CycleFrameLimit(0);
break;