Make sure to only change the 'joymap' setting if any joysticks

have actually been loaded during the program run.  Otherwise,
it will erase previous mappings.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2286 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2011-11-30 14:57:28 +00:00
parent d35c220953
commit 93a3952317
2 changed files with 6 additions and 1 deletions

View File

@ -22,7 +22,7 @@
#include <cstdlib>
#define STELLA_VERSION "3.5_svn_test2"
#define STELLA_VERSION "3.5_svn_test3"
#define STELLA_BUILD atoi("$Rev$" + 6)
#endif

View File

@ -1649,6 +1649,11 @@ void EventHandler::saveKeyMapping()
void EventHandler::saveJoyMapping()
{
#ifdef JOYSTICK_SUPPORT
// Don't update the joymap at all if it hasn't been modified during the
// program run
if(myNumJoysticks == 0)
return;
// Save the joystick mapping hash table, making sure to update it with
// any changes that have been made during the program run
for(uInt32 i = 0; i < myNumJoysticks; ++i)