[Scummvm-cvs-logs] CVS: scummvm/bs2/driver keyboard.cpp,1.4,1.5 keyboard.h,1.1,1.2
Torbj?rn Andersson
eriktorbjorn at users.sourceforge.net
Mon Sep 22 23:31:08 CEST 2003
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/bs2 credits.h,1.2,1.3 function.cpp,1.11,1.12 sword2.cpp,1.33,1.34
- Next message: [Scummvm-cvs-logs] CVS: scummvm/bs2/driver d_draw.cpp,1.21,1.22 driver96.h,1.38,1.39
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/bs2/driver
In directory sc8-pr-cvs1:/tmp/cvs-serv6395
Modified Files:
keyboard.cpp keyboard.h
Log Message:
cleanup
Index: keyboard.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/keyboard.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- keyboard.cpp 16 Sep 2003 09:57:57 -0000 1.4
+++ keyboard.cpp 23 Sep 2003 06:30:52 -0000 1.5
@@ -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);
-
-}
-
-void GetKeyStatus(_drvKeyStatus *s)
+ keyBacklog--;
-{
- // Flush key buffer
- s->pBacklog = &keyBacklog;
- s->pPointer = &keyPointer;
- s->pBuffer = keyBuffer;
+ return RD_OK;
}
-
Index: keyboard.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/keyboard.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- keyboard.h 28 Jul 2003 01:47:40 -0000 1.1
+++ keyboard.h 23 Sep 2003 06:30:52 -0000 1.2
@@ -40,7 +40,6 @@
#ifndef KEYBOARD_H
#define KEYBOARD_H
-
void WriteKey(char key); // Adds a keypress to the buffer
#endif
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/bs2 credits.h,1.2,1.3 function.cpp,1.11,1.12 sword2.cpp,1.33,1.34
- Next message: [Scummvm-cvs-logs] CVS: scummvm/bs2/driver d_draw.cpp,1.21,1.22 driver96.h,1.38,1.39
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list