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.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 <sstream>
  10. #include <string>
  11. #include <vector>
  12. #include "Console.h"
  13. #include "Game.h"
  14. #include "Menu.h"
  15. #include "Sound.h"
  16. #include "Window.h"
  17. /*!
  18. * \brief Main Game Singleton
  19. */
  20. class OpenRaider {
  21. public:
  22. /*!
  23. * \brief Constructs an object of OpenRaider
  24. */
  25. OpenRaider();
  26. /*!
  27. * \brief Deconstructs an object of OpenRaider
  28. */
  29. ~OpenRaider();
  30. int initialize();
  31. /*!
  32. * \brief Load the configuration file
  33. * \returns 0 on success
  34. */
  35. int loadConfig(const char *config);
  36. int command(std::string &command);
  37. int command(const char *command);
  38. void run();
  39. void frame();
  40. void handleKeyboard(KeyboardButton key, bool pressed);
  41. void handleText(char *text, bool notFinished);
  42. void handleMouseClick(unsigned int x, unsigned int y, KeyboardButton button, bool released);
  43. void handleMouseMotion(int xrel, int yrel);
  44. void handleMouseScroll(int xrel, int yrel);
  45. //! \fixme should be private
  46. char *mBaseDir;
  47. char *mPakDir;
  48. char *mAudioDir;
  49. char *mDataDir;
  50. private:
  51. int command(std::stringstream &command);
  52. char *expandDirectoryNames(const char *s);
  53. int help(std::string &cmd);
  54. int set(std::stringstream &command);
  55. int bind(const char *action, const char *key);
  56. bool mRunning;
  57. bool mFPS;
  58. KeyboardButton keyBindings[ActionEventCount];
  59. };
  60. OpenRaider &getOpenRaider();
  61. #endif