Fix the degenerate case so that we don't crash if zero joypads are detected
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1645 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
6fc28cae8c
commit
fd60a51a95
|
@ -568,16 +568,6 @@ int Search_Devices()
|
||||||
|
|
||||||
int numjoy = SDL_NumJoysticks();
|
int numjoy = SDL_NumJoysticks();
|
||||||
|
|
||||||
if (numjoy == 0)
|
|
||||||
{
|
|
||||||
#ifdef _WIN32
|
|
||||||
MessageBox(NULL, "No Joystick detected!", NULL, MB_ICONWARNING);
|
|
||||||
#else
|
|
||||||
printf("No Joystick detected!\n");
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (joyinfo)
|
if (joyinfo)
|
||||||
{
|
{
|
||||||
delete [] joyinfo;
|
delete [] joyinfo;
|
||||||
|
@ -588,6 +578,16 @@ int Search_Devices()
|
||||||
joyinfo = new CONTROLLER_INFO [numjoy];
|
joyinfo = new CONTROLLER_INFO [numjoy];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (numjoy == 0)
|
||||||
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
MessageBox(NULL, "No Joystick detected!", NULL, MB_ICONWARNING);
|
||||||
|
#else
|
||||||
|
printf("No Joystick detected!\n");
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
fprintf(pFile, "Scanning for devices\n");
|
fprintf(pFile, "Scanning for devices\n");
|
||||||
fprintf(pFile, "¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\n");
|
fprintf(pFile, "¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\n");
|
||||||
|
|
Loading…
Reference in New Issue