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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 command(const char *command, std::vector<char *> *args);
  47. char *expandDirectoryNames(const char *s);
  48. int set(const char *var, const char *value);
  49. int bind(const char *action, const char *key);
  50. int bind(ActionEvents action, const char *key);
  51. int initialize();
  52. void run();
  53. void handleKeyboard(KeyboardButton key, bool pressed);
  54. void handleText(char *text, bool notFinished);
  55. void handleMouseClick(unsigned int x, unsigned int y, MouseButton button, bool released);
  56. void handleMouseMotion(int xrel, int yrel);
  57. Window *mWindow;
  58. Sound *mSound;
  59. Menu *mMenu;
  60. Console *mConsole;
  61. bool mMapListFilled;
  62. std::vector<char *> mMapList;
  63. private:
  64. void loadPakFolderRecursive(const char *dir);
  65. void fillMapList();
  66. bool mInit;
  67. bool mRunning;
  68. char *mBaseDir;
  69. char *mPakDir;
  70. char *mAudioDir;
  71. char *mDataDir;
  72. KeyboardButton keyBindings[ActionEventCount];
  73. };
  74. #endif