| 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 | #include "Resources/BsPlainText.h" |
| 4 | #include "Resources/BsResources.h" |
| 5 | #include "Private/RTTI/BsPlainTextRTTI.h" |
| 6 | |
| 7 | namespace bs |
| 8 | { |
| 9 | PlainText::PlainText(const WString& data) |
| 10 | :Resource(false), mString(data) |
| 11 | { |
| 12 | |
| 13 | } |
| 14 | |
| 15 | HPlainText PlainText::create(const WString& data) |
| 16 | { |
| 17 | return static_resource_cast<PlainText>(gResources()._createResourceHandle(_createPtr(data))); |
| 18 | } |
| 19 | |
| 20 | SPtr<PlainText> PlainText::_createPtr(const WString& data) |
| 21 | { |
| 22 | SPtr<PlainText> plainTextPtr = bs_core_ptr<PlainText>( |
| 23 | new (bs_alloc<PlainText>()) PlainText(data)); |
| 24 | plainTextPtr->_setThisPtr(plainTextPtr); |
| 25 | plainTextPtr->initialize(); |
| 26 | |
| 27 | return plainTextPtr; |
| 28 | } |
| 29 | |
| 30 | RTTITypeBase* PlainText::getRTTIStatic() |
| 31 | { |
| 32 | return PlainTextRTTI::instance(); |
| 33 | } |
| 34 | |
| 35 | RTTITypeBase* PlainText::getRTTI() const |
| 36 | { |
| 37 | return PlainText::getRTTIStatic(); |
| 38 | } |
| 39 | } |