include/keyman.h

Go to the documentation of this file.
00001 #ifndef _KEYMAN_H
00002 
00003 #include <SDL/SDL.h>
00004 
00005 #include "utility.h"
00006 #include "camera.h"
00007 #include "settings.h"
00008 #include "globals.h"
00009 
00010 #define MAX_ONE_TIME_KEY_DEPTH 10
00011 #define MAX_KEY_RECS 256
00012 
00013 #include <string>
00014 
00015 using namespace std;
00016 
00017 class KEYREC
00018 {
00019 public:
00020         string name;
00021         int key;
00022 };
00023 
00024 class KEYMAN
00025 {
00026 private:
00027         ofstream error_log;
00028         
00029 public:
00030         int num_keyrecs;
00031         KEYREC keyrec[MAX_KEY_RECS];
00032 
00033         int GetKey(string kn);
00034         string GetKeyName(int kc);
00035         bool keys[1024];
00036         bool lastkeys[1024];
00037 
00038         void KeyDown(int key);
00039         void KeyUp(int key);
00040 
00041         int queuedepth;
00042         int queue[MAX_ONE_TIME_KEY_DEPTH];
00043         void OneTime(int key);
00044 
00045         bool freecam;
00046         
00047 
00048         KEYMAN();
00049         ~KEYMAN();
00050 
00051         void Load();
00052 
00053         void DoOneTimeKeys(CAMERA & cam);
00054         void DoHeldKeys(float timefactor, float fps, CAMERA & cam);
00055 };
00056 
00057 #define _KEYMAN_H
00058 #endif

Generated on Thu Oct 19 04:05:47 2006 by  doxygen 1.4.6