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

Method LoadFile

Source/Engine/Content/Assets/Texture.cpp:159–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157#endif
158
159bool Texture::LoadFile(const StringView& path, bool generateMips)
160{
161 if (!IsVirtual())
162 {
163 LOG(Error, "Loading image from file is supported only for virtual textures.");
164 return true;
165 }
166
167 TextureData textureData;
168 if (TextureTool::ImportTexture(path, textureData))
169 {
170 return true;
171 }
172
173 auto initData = New<InitData>();
174 initData->FromTextureData(textureData, generateMips);
175
176 return Init(initData);
177}
178
179Texture* Texture::FromFile(const StringView& path, bool generateMips)
180{

Callers 1

FromFileMethod · 0.45

Calls 4

IsVirtualFunction · 0.85
FromTextureDataMethod · 0.80
ImportTextureClass · 0.50
InitFunction · 0.50

Tested by

no test coverage detected