1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// |
2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// |
3 | #pragma once |
4 | |
5 | #include "BsCorePrerequisites.h" |
6 | #include "Reflection/BsRTTIType.h" |
7 | #include "Renderer/BsDecal.h" |
8 | #include "Renderer/BsRenderer.h" |
9 | |
10 | namespace bs |
11 | { |
12 | /** @cond RTTI */ |
13 | /** @addtogroup RTTI-Impl-Engine |
14 | * @{ |
15 | */ |
16 | |
17 | class BS_CORE_EXPORT DecalRTTI : public RTTIType <Decal, IReflectable, DecalRTTI> |
18 | { |
19 | private: |
20 | BS_BEGIN_RTTI_MEMBERS |
21 | BS_RTTI_MEMBER_REFL(mTransform, 0) |
22 | BS_RTTI_MEMBER_PLAIN(mActive, 1) |
23 | BS_RTTI_MEMBER_PLAIN(mMobility, 2) |
24 | BS_RTTI_MEMBER_PLAIN(mSize, 3) |
25 | BS_RTTI_MEMBER_PLAIN(mMaxDistance, 4) |
26 | BS_RTTI_MEMBER_REFL(mMaterial, 5) |
27 | BS_RTTI_MEMBER_PLAIN(mLayer, 6) |
28 | BS_RTTI_MEMBER_PLAIN(mLayerMask, 7) |
29 | BS_END_RTTI_MEMBERS |
30 | public: |
31 | void onDeserializationEnded(IReflectable* obj, SerializationContext* context) override |
32 | { |
33 | // Note: Since this is a CoreObject I should call initialize() right after deserialization, |
34 | // but since this specific type is used in Components we delay initialization until Component |
35 | // itself does it. Keep this is mind in case this ever needs to be deserialized for non-Component |
36 | // purposes (you'll need to call initialize manually). |
37 | } |
38 | |
39 | const String& getRTTIName() override |
40 | { |
41 | static String name = "Decal" ; |
42 | return name; |
43 | } |
44 | |
45 | UINT32 getRTTIId() override |
46 | { |
47 | return TID_Decal; |
48 | } |
49 | |
50 | SPtr<IReflectable> newRTTIObject() override |
51 | { |
52 | return Decal::createEmpty(); |
53 | } |
54 | }; |
55 | |
56 | /** @} */ |
57 | /** @endcond */ |
58 | } |
59 | |