diff options
author | Torbjörn Andersson | 2003-09-23 06:30:52 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2003-09-23 06:30:52 +0000 |
commit | c7b8a6c01bd74ea6770a6aee65aa1a82f71fbb84 (patch) | |
tree | a08537dc374046aba6a70008090760a5755426c9 | |
parent | f8591911abe8ce21e4136bf0c63fa6a14c61ee4c (diff) | |
download | scummvm-rg350-c7b8a6c01bd74ea6770a6aee65aa1a82f71fbb84.tar.gz scummvm-rg350-c7b8a6c01bd74ea6770a6aee65aa1a82f71fbb84.tar.bz2 scummvm-rg350-c7b8a6c01bd74ea6770a6aee65aa1a82f71fbb84.zip |
cleanup
svn-id: r10367
-rw-r--r-- | sword2/driver/keyboard.cpp | 50 | ||||
-rw-r--r-- | sword2/driver/keyboard.h | 1 |
2 files changed, 14 insertions, 37 deletions
diff --git a/sword2/driver/keyboard.cpp b/sword2/driver/keyboard.cpp index 8f2ad39db9..6babe45ed4 100644 --- a/sword2/driver/keyboard.cpp +++ b/sword2/driver/keyboard.cpp @@ -63,61 +63,39 @@ #include "stdafx.h" #include "driver96.h" -uint8 keyBacklog = 0; // The number of key presses waiting to be processed. -uint8 keyPointer = 0; // Index of the next key to read from the buffer. -char keyBuffer[MAX_KEY_BUFFER]; // The keyboard buffer +uint8 keyBacklog = 0; // The number of key presses waiting to be processed. +uint8 keyPointer = 0; // Index of the next key to read from the buffer. +char keyBuffer[MAX_KEY_BUFFER]; // The keyboard buffer - -void WriteKey(char key) -{ - if (keyBuffer && keyBacklog < MAX_KEY_BUFFER) - { +void WriteKey(char key) { + if (keyBuffer && keyBacklog < MAX_KEY_BUFFER) { keyBuffer[(keyPointer + keyBacklog) % MAX_KEY_BUFFER] = key; - keyBacklog += 1; + keyBacklog++; } } - - -BOOL KeyWaiting(void) - -{ - +BOOL KeyWaiting(void) { if (keyBacklog) - return(TRUE); - else - return(FALSE); + return TRUE; + return FALSE; } -int32 ReadKey(char *key) - -{ +int32 ReadKey(char *key) { if (!keyBacklog) - return(RDERR_NOKEYWAITING); + return RDERR_NOKEYWAITING; if (key == NULL) - return(RDERR_INVALIDPOINTER); + return RDERR_INVALIDPOINTER; *key = keyBuffer[keyPointer++]; if (keyPointer == MAX_KEY_BUFFER) keyPointer = 0; - keyBacklog -= 1; - - return(RD_OK); + keyBacklog--; + return RD_OK; } - -void GetKeyStatus(_drvKeyStatus *s) - -{ - // Flush key buffer - s->pBacklog = &keyBacklog; - s->pPointer = &keyPointer; - s->pBuffer = keyBuffer; -} - diff --git a/sword2/driver/keyboard.h b/sword2/driver/keyboard.h index 56bfad7333..fb181a384d 100644 --- a/sword2/driver/keyboard.h +++ b/sword2/driver/keyboard.h @@ -40,7 +40,6 @@ #ifndef KEYBOARD_H #define KEYBOARD_H - void WriteKey(char key); // Adds a keypress to the buffer #endif |