]> Shamusworld >> Repos - virtualjaguar/blobdiff - src/gui/profile.cpp
Hotfix for bug #28.
[virtualjaguar] / src / gui / profile.cpp
index 434d01d8ac0918d7d183cb96ab816a3fae99de94..cbb12f47efc7da55c697c34649cb9c573a68e1a1 100644 (file)
@@ -49,6 +49,7 @@ int gamepadIDSlot2;
 int numberOfProfiles;
 int numberOfDevices;
 char deviceNames[MAX_DEVICES][128];
+static int numberOfProfilesSave;
 
 // This is so that new devices have something reasonable to show for default
 uint32_t defaultMap[21] = {
@@ -68,6 +69,7 @@ int FindProfileForDevice(int deviceNum, int preferred, int * found);
 //
 void SaveProfiles(void)
 {
+       numberOfProfilesSave = numberOfProfiles;
        memcpy(&profileBackup, &profile, sizeof(Profile) * MAX_PROFILES);
 }
 
@@ -75,6 +77,7 @@ void SaveProfiles(void)
 void RestoreProfiles(void)
 {
        memcpy(&profile, &profileBackup, sizeof(Profile) * MAX_PROFILES);
+       numberOfProfiles = numberOfProfilesSave;
 }