BsPlatformInfoRTTI.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsRTTIType.h"
  4. #include "BsPlatformInfo.h"
  5. namespace BansheeEngine
  6. {
  7. class BS_ED_EXPORT PlatformInfoRTTI : public RTTIType <PlatformInfo, IReflectable, PlatformInfoRTTI>
  8. {
  9. private:
  10. WString& getDefines(PlatformInfo* obj) { return obj->defines; }
  11. void setDefines(PlatformInfo* obj, WString& val) { obj->defines = val; }
  12. PlatformType& getType(PlatformInfo* obj) { return obj->type; }
  13. void setType(PlatformInfo* obj, PlatformType& val) { obj->type = val; }
  14. WeakResourceHandle<Prefab>& getMainScene(PlatformInfo* obj) { return obj->mainScene; }
  15. void setMainScene(PlatformInfo* obj, WeakResourceHandle<Prefab>& val) { obj->mainScene = val; }
  16. bool& getFullscreen(PlatformInfo* obj) { return obj->fullscreen; }
  17. void setFullscreen(PlatformInfo* obj, bool& val) { obj->fullscreen = val; }
  18. UINT32& getWindowedWidth(PlatformInfo* obj) { return obj->windowedWidth; }
  19. void setWindowedWidth(PlatformInfo* obj, UINT32& val) { obj->windowedWidth = val; }
  20. UINT32& getWindowedHeight(PlatformInfo* obj) { return obj->windowedHeight; }
  21. void setWindowedHeight(PlatformInfo* obj, UINT32& val) { obj->windowedHeight = val; }
  22. bool& getDebug(PlatformInfo* obj) { return obj->debug; }
  23. void setDebug(PlatformInfo* obj, bool& val) { obj->debug = val; }
  24. public:
  25. PlatformInfoRTTI()
  26. {
  27. addPlainField("defines", 0, &PlatformInfoRTTI::getDefines, &PlatformInfoRTTI::setDefines);
  28. addPlainField("type", 1, &PlatformInfoRTTI::getType, &PlatformInfoRTTI::setType);
  29. addReflectableField("mainScene", 2, &PlatformInfoRTTI::getMainScene, &PlatformInfoRTTI::setMainScene);
  30. addPlainField("fullscreen", 3, &PlatformInfoRTTI::getFullscreen, &PlatformInfoRTTI::setFullscreen);
  31. addPlainField("windowedWidth", 4, &PlatformInfoRTTI::getWindowedWidth, &PlatformInfoRTTI::setWindowedWidth);
  32. addPlainField("windowedHeight", 5, &PlatformInfoRTTI::getWindowedHeight, &PlatformInfoRTTI::setWindowedHeight);
  33. addPlainField("debug", 6, &PlatformInfoRTTI::getDebug, &PlatformInfoRTTI::setDebug);
  34. }
  35. virtual const String& getRTTIName() override
  36. {
  37. static String name = "PlatformInfo";
  38. return name;
  39. }
  40. virtual UINT32 getRTTIId() override
  41. {
  42. return TID_PlatformInfo;
  43. }
  44. virtual std::shared_ptr<IReflectable> newRTTIObject() override
  45. {
  46. return bs_shared_ptr_new<PlatformInfo>();
  47. }
  48. };
  49. class BS_ED_EXPORT WinPlatformInfoRTTI : public RTTIType <WinPlatformInfo, PlatformInfo, WinPlatformInfoRTTI>
  50. {
  51. private:
  52. WeakResourceHandle<Texture>& getIcon(WinPlatformInfo* obj) { return obj->icon; }
  53. void setIcon(WinPlatformInfo* obj, WeakResourceHandle<Texture>& val) { obj->icon = val; }
  54. WString& getTitlebarText(WinPlatformInfo* obj) { return obj->titlebarText; }
  55. void setTitlebarText(WinPlatformInfo* obj, WString& val) { obj->titlebarText = val; }
  56. public:
  57. WinPlatformInfoRTTI()
  58. {
  59. addReflectableField("icon", 9, &WinPlatformInfoRTTI::getIcon, &WinPlatformInfoRTTI::setIcon);
  60. addPlainField("titlebarText", 10, &WinPlatformInfoRTTI::getTitlebarText, &WinPlatformInfoRTTI::setTitlebarText);
  61. }
  62. virtual const String& getRTTIName() override
  63. {
  64. static String name = "WinPlatformInfo";
  65. return name;
  66. }
  67. virtual UINT32 getRTTIId() override
  68. {
  69. return TID_WinPlatformInfo;
  70. }
  71. virtual std::shared_ptr<IReflectable> newRTTIObject() override
  72. {
  73. return bs_shared_ptr_new<WinPlatformInfo>();
  74. }
  75. };
  76. }