BsPlatformInfoRTTI.h 3.7 KB

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