git » fp-git.git » commit 1c24881

added key and timer event handling in input

author ecalot
2004-07-19 13:04:54 UTC
committer ecalot
2004-07-19 13:04:54 UTC
parent 7b151b76ac9b771be53c9b77ebcd32a9e1acfc05

added key and timer event handling in input

FP/src/Makefile +4 -0
FP/src/include/input.h +18 -4

diff --git a/FP/src/Makefile b/FP/src/Makefile
index 774acc1..3ab3104 100644
--- a/FP/src/Makefile
+++ b/FP/src/Makefile
@@ -135,6 +135,10 @@ output.o: out/output.c include/resources.h
 	$(INFO) Compiling main output module...
 	$(CC) -c out/output.c $(OPTIONS)
 
+input.o: out/input.c include/input.h
+	$(INFO) Compiling main input module...
+	$(CC) -c out/input.c $(OPTIONS)
+
 config.o: res/config.c include/resources.h
 	$(INFO) Compiling resource configuration module...
 	$(CC) -c res/config.c $(OPTIONS)
diff --git a/FP/src/include/input.h b/FP/src/include/input.h
index c0bad07..2b9b77a 100644
--- a/FP/src/include/input.h
+++ b/FP/src/include/input.h
@@ -30,14 +30,28 @@ input.h: Free Prince : Input devices handling
   DO NOT remove this copyright notice
 */
 
-/* Deprecated file! */
 #ifndef _INPUT_H_
 #define _INPUT_H_
 
-typedef struct {...} tKey
+typedef enum {none=0,quit,reload,passLevel,showUp,showLeft,showRight,showDown,moreTime,lessTime,addLive,addHitPoint,gotoTitles,kill,resurrect}tAction;
 
-tKey getInput();
-/* Returns the next input (either from the keyboard or joystick or whatever) */
 
+typedef struct {
+	int shiftPressed;
+	int controlPressed;
+	int upPressed;
+	int leftPressed;
+	int rightPressed;
+	tAction actionPerformed;
+} tKey
+
+void inputInitKey(tKey* key);
+int inputGetEvent(tKey* key);
+/* Saves the key status un key (either from the keyboard or joystick or whatever)
+ * returns 1 if a time event is activated or 0 if an action was performed
+ */
+
+void inputStopTimer();
+void inputInitTimer();
 
 #endif