Fix save key settings bug. Destructor of my global key lists were getting called

before DirectInput destructor.  How rude...
This commit is contained in:
DJRobX 2007-10-31 09:30:11 +00:00
parent fca8f9f480
commit aa77ce816d
3 changed files with 6 additions and 5 deletions

View File

@ -86,7 +86,7 @@ static int joyDebug = 0;
static int axisNumber = 0;
KeyList joypad[JOYPADS * KEYS_PER_PAD + MOTION_KEYS];
//KeyList joypad[JOYPADS * KEYS_PER_PAD + MOTION_KEYS];
USHORT defvalues[JOYPADS * KEYS_PER_PAD + MOTION_KEYS] =
@ -151,7 +151,7 @@ void winReadKeys()
winReadKey("Motion_Down", joypad[MOTION(KEY_DOWN)]);
}
void winSaveKey(char *name, KeyList &value)
void winSaveKey(char *name, KeyList& value)
{
CString txtKeys;

View File

@ -45,8 +45,9 @@ enum {
};
class Input {
public:
KeyList joypaddata[JOYPADS * KEYS_PER_PAD + MOTION_KEYS];
Input() {};
virtual ~Input() {};
@ -63,4 +64,6 @@ class Input {
virtual void saveSettings() = 0;
};
#define joypad theApp.input->joypaddata
#endif

View File

@ -31,8 +31,6 @@
static char THIS_FILE[] = __FILE__;
#endif
extern KeyList joypad[JOYPADS * KEYS_PER_PAD + MOTION_KEYS];
// Todo: Expand UI to allow user to enter multiple keys here.
int TempReadFirst(KeyList &Key)