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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. void handleMouseClick(unsigned int x, unsigned int y, MouseButton button, bool released);
  55. void handleMouseMotion(int xrel, int yrel);
  56. Window *mWindow;
  57. Sound *mSound;
  58. Menu *mMenu;
  59. bool mMapListFilled;
  60. std::vector<char *> mMapList;
  61. private:
  62. void loadPakFolderRecursive(const char *dir);
  63. void fillMapList();
  64. bool mInit;
  65. bool mRunning;
  66. char *mBaseDir;
  67. char *mPakDir;
  68. char *mAudioDir;
  69. char *mDataDir;
  70. KeyboardButton keyBindings[ActionEventCount];
  71. };
  72. #endif