MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / init

Method init

Source/Engine/Graphics/Textures/TextureBase.cpp:824–846  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

822}
823
824bool TextureBase::init(AssetInitData& initData)
825{
826 if (IsVirtual())
827 return false;
828
829 // Get texture header for asset custom data (fast access)
830 TextureHeader textureHeader;
831 if (initData.CustomData.Length() == sizeof(TextureHeader))
832 {
833 Platform::MemoryCopy(&textureHeader, initData.CustomData.Get(), sizeof(textureHeader));
834 }
835 else if (initData.CustomData.Length() == sizeof(TextureHeader_Deprecated))
836 {
837 textureHeader = TextureHeader(*(TextureHeader_Deprecated*)initData.CustomData.Get());
838 }
839 else
840 {
841 LOG(Error, "Missing texture header.");
842 return true;
843 }
844
845 return _texture.Create(textureHeader);
846}
847
848Asset::LoadResult TextureBase::load()
849{

Callers

nothing calls this directly

Calls 4

IsVirtualFunction · 0.85
LengthMethod · 0.45
GetMethod · 0.45
CreateMethod · 0.45

Tested by

no test coverage detected