BsPlatformInfoRTTI.h 3.7 KB

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