MCPcopy Create free account
hub / github.com/Phobos-developers/Phobos / LoadFromINIFile

Method LoadFromINIFile

src/Ext/TerrainType/Body.cpp:66–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66void TerrainTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
67{
68 auto pThis = this->OwnerObject();
69 const char* pSection = pThis->ID;
70 INI_EX exINI(pINI);
71
72 this->SpawnsTiberium_Type.Read(exINI, pSection, "SpawnsTiberium.Type");
73 this->SpawnsTiberium_Range.Read(exINI, pSection, "SpawnsTiberium.Range");
74 this->SpawnsTiberium_GrowthStage.Read(exINI, pSection, "SpawnsTiberium.GrowthStage");
75 this->SpawnsTiberium_CellsPerAnim.Read(exINI, pSection, "SpawnsTiberium.CellsPerAnim");
76
77 this->DestroyAnim.Read(exINI, pSection, "DestroyAnim");
78 this->DestroySound.Read(exINI, pSection, "DestroySound");
79
80 this->MinimapColor.Read(exINI, pSection, "MinimapColor");
81
82 this->IsPassable.Read(exINI, pSection, "IsPassable");
83 this->CanBeBuiltOn.Read(exINI, pSection, "CanBeBuiltOn");
84
85 this->HasDamagedFrames.Read(exINI, pSection, "HasDamagedFrames");
86 this->HasCrumblingFrames.Read(exINI, pSection, "HasCrumblingFrames");
87 this->CrumblingSound.Read(exINI, pSection, "CrumblingSound");
88 this->AnimationLength.Read(exINI, pSection, "AnimationLength");
89
90 //Strength is already part of ObjecTypeClass::ReadIni Duh!
91 //this->TerrainStrength.Read(exINI, pSection, "Strength");
92
93 this->PaletteFile.Read(&CCINIClass::INI_Art, pThis->ImageFile, "Palette");
94 this->Palette = GeneralUtils::BuildPalette(this->PaletteFile);
95
96 if (GeneralUtils::IsValidString(this->PaletteFile) && !this->Palette)
97 Debug::Log("[Developer warning] [%s] has Palette=%s set but no palette file was loaded (missing file or wrong filename). Missing palettes cause issues with lighting recalculations.\n", pThis->ImageFile, this->PaletteFile.data());
98}
99
100void TerrainTypeExt::ExtData::LoadFromStream(PhobosStreamReader& Stm)
101{

Callers

nothing calls this directly

Calls 2

ReadMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected