Open Source Tomb Raider Engine
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

OpenRaider.h 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. Window *mWindow;
  56. Sound *mSound;
  57. Menu *mMenu;
  58. bool mMapListFilled;
  59. std::vector<char *> mMapList;
  60. private:
  61. void loadPakFolderRecursive(const char *dir);
  62. void fillMapList();
  63. bool mInit;
  64. bool mRunning;
  65. char *mBaseDir;
  66. char *mPakDir;
  67. char *mAudioDir;
  68. char *mDataDir;
  69. KeyboardButton keyBindings[ActionEventCount];
  70. };
  71. #endif