| 16 | namespace |
| 17 | { |
| 18 | constexpr Utils::DataType fromString(const std::string &str) |
| 19 | { |
| 20 | if (str == "uint8_t") return Utils::DataType::u8; |
| 21 | if (str == "int8_t") return Utils::DataType::s8; |
| 22 | if (str == "uint16_t") return Utils::DataType::u16; |
| 23 | if (str == "int16_t") return Utils::DataType::s16; |
| 24 | if (str == "uint32_t") return Utils::DataType::u32; |
| 25 | if (str == "int32_t") return Utils::DataType::s32; |
| 26 | if (str == "float") return Utils::DataType::f32; |
| 27 | if (str == "char") return Utils::DataType::string; |
| 28 | if (str == "AssetRef<sprite_t>") return Utils::DataType::ASSET_SPRITE; |
| 29 | if (str == "PrefabRef") return Utils::DataType::PREFAB; |
| 30 | if (str == "ObjectRef" || str == "P64::ObjectRef" || str.rfind("ObjectRef<", 0) == 0 || str.find("::ObjectRef<") != std::string::npos) return Utils::DataType::OBJECT_REF; |
| 31 | return Utils::DataType::s32; |
| 32 | } |
| 33 | |
| 34 | constexpr uint32_t getTypeSize(Utils::DataType type) { |
| 35 | switch(type) { |