Open Source Tomb Raider Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

OpenRaider.h 1.9KB

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