BsTextureImportOptionsRTTI.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //__________________________ Banshee Project - A modern game development toolkit _________________________________//
  2. //_____________________________________ www.banshee-project.com __________________________________________________//
  3. //________________________ Copyright (c) 2014 Marko Pintera. All rights reserved. ________________________________//
  4. #pragma once
  5. #include "BsCorePrerequisites.h"
  6. #include "BsRTTIType.h"
  7. #include "BsTextureImportOptions.h"
  8. namespace BansheeEngine
  9. {
  10. class BS_CORE_EXPORT TextureImportOptionsRTTI : public RTTIType<TextureImportOptions, IReflectable, TextureImportOptionsRTTI>
  11. {
  12. private:
  13. PixelFormat& getPixelFormat(TextureImportOptions* obj) { return obj->mFormat; }
  14. void setPixelFormat(TextureImportOptions* obj, PixelFormat& value) { obj->mFormat = value; }
  15. bool& getGenerateMips(TextureImportOptions* obj) { return obj->mGenerateMips; }
  16. void setGenerateMips(TextureImportOptions* obj, bool& value) { obj->mGenerateMips = value; }
  17. UINT32& getMaxMip(TextureImportOptions* obj) { return obj->mMaxMip; }
  18. void setMaxMip(TextureImportOptions* obj, UINT32& value) { obj->mMaxMip = value; }
  19. public:
  20. TextureImportOptionsRTTI()
  21. {
  22. addPlainField("mPixelFormat", 0, &TextureImportOptionsRTTI::getPixelFormat, &TextureImportOptionsRTTI::setPixelFormat);
  23. addPlainField("mGenerateMips", 1, &TextureImportOptionsRTTI::getGenerateMips, &TextureImportOptionsRTTI::setGenerateMips);
  24. addPlainField("mMaxMip", 2, &TextureImportOptionsRTTI::getMaxMip, &TextureImportOptionsRTTI::setMaxMip);
  25. }
  26. virtual const String& getRTTIName()
  27. {
  28. static String name = "TextureImportOptions";
  29. return name;
  30. }
  31. virtual UINT32 getRTTIId()
  32. {
  33. return TID_TextureImportOptions;
  34. }
  35. virtual std::shared_ptr<IReflectable> newRTTIObject()
  36. {
  37. return bs_shared_ptr<TextureImportOptions, PoolAlloc>();
  38. }
  39. };
  40. }