Open Source Tomb Raider Engine
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

OpenRaider.h 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*!
  2. * \file include/OpenRaider.h
  3. * \brief Main Game Object
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _OPENRAIDER_H_
  8. #define _OPENRAIDER_H_
  9. #include <vector>
  10. #include "Menu.h"
  11. #include "Sound.h"
  12. #include "Window.h"
  13. /*!
  14. * \brief Main Game Singleton
  15. */
  16. class OpenRaider {
  17. public:
  18. typedef enum {
  19. menu = 0,
  20. console,
  21. forward,
  22. backward,
  23. left,
  24. right,
  25. jump,
  26. crouch,
  27. use,
  28. holster,
  29. ActionEventCount // Should always be at the end
  30. } ActionEvents;
  31. /*!
  32. * \brief Constructs an object of OpenRaider
  33. */
  34. OpenRaider();
  35. /*!
  36. * \brief Deconstructs an object of OpenRaider
  37. */
  38. ~OpenRaider();
  39. /*!
  40. * \brief Load the configuration file
  41. * \returns 0 on success
  42. */
  43. int loadConfig(const char *config);
  44. int command(const char *command);
  45. int command(const char *command, std::vector<char *> *args);
  46. char *expandDirectoryNames(const char *s);
  47. int set(const char *var, const char *value);
  48. int bind(const char *action, const char *key);
  49. int bind(ActionEvents action, const char *key);
  50. int initialize();
  51. void run();
  52. void handleKeyboard(KeyboardButton key, bool pressed);
  53. void handleText(char *text, bool notFinished);
  54. Window *mWindow;
  55. Sound *mSound;
  56. Menu *mMenu;
  57. bool mMapListFilled;
  58. std::vector<char *> mMapList;
  59. private:
  60. void loadPakFolderRecursive(const char *dir);
  61. void fillMapList();
  62. bool mInit;
  63. bool mRunning;
  64. char *mBaseDir;
  65. char *mPakDir;
  66. char *mAudioDir;
  67. char *mDataDir;
  68. KeyboardButton keyBindings[ActionEventCount];
  69. };
  70. #endif