MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / LoadMaterials

Function LoadMaterials

TombEngine/Specific/level.cpp:1817–1840  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1815}
1816
1817void LoadMaterials()
1818{
1819 int materialCount = ReadCount();
1820 TENLog("Materials count: " + std::to_string(materialCount), LogLevel::Info);
1821 g_Level.Materials.reserve(materialCount);
1822
1823 for (int i = 0; i < materialCount; i++)
1824 {
1825 auto& material = g_Level.Materials.emplace_back();
1826
1827 material.Name = ReadString();
1828 material.Type = (MaterialShaderType)ReadInt32();
1829 material.Parameters0 = ReadVector4();
1830 material.Parameters1 = ReadVector4();
1831 material.Parameters2 = ReadVector4();
1832 material.Parameters3 = ReadVector4();
1833 material.HasNormalMap = ReadBool();
1834 material.HasHeightMap = ReadBool();
1835 material.HasAmbientOcclusionMap = ReadBool();
1836 material.HasRoughnessMap = ReadBool();
1837 material.HasSpecularMap = ReadBool();
1838 material.HasEmissiveMap = ReadBool();
1839 }
1840}
1841
1842bool LoadLevelFile(int levelIndex)
1843{

Callers 1

LoadLevelFunction · 0.85

Calls 9

ReadCountFunction · 0.85
TENLogFunction · 0.85
to_stringFunction · 0.85
ReadStringFunction · 0.85
ReadInt32Function · 0.85
ReadVector4Function · 0.85
ReadBoolFunction · 0.85
emplace_backMethod · 0.80
reserveMethod · 0.45

Tested by

no test coverage detected