Changed level property from integer to id string

This commit is contained in:
David Benepe
2022-03-29 09:23:35 -04:00
parent 02d7eef0ad
commit 7c13bdbdc8
3 changed files with 4 additions and 4 deletions
@@ -8,7 +8,7 @@ BuildTTGhost::BuildTTGhost(std::string srcPath, std::string dstPath) {
std::vector<uint8_t> out(align16(SIZEOF_TTGHOST_HEADER + numberOfNodes * SIZEOF_TTGHOST_NODE));
// Write header
out[0] = get_int_from_json(srcPath, "header", "level");
out[0] = get_index_from_build_id("ASSET_LEVEL_HEADERS", get_string_from_json(srcPath, "header", "level")); // get_int_from_json(srcPath, "header", "level");
out[1] = get_enum_value_from_string("Vehicle", get_string_from_json(srcPath, "header", "vehicle"));
out[2] = 9; // Always 9?
write_big_endian_halfword(out, 4, get_int_from_json(srcPath, "header", "time"));
@@ -8,8 +8,8 @@ json::JSON &configJSON)
out["type"] = "TTGhosts";
out["header"] = json::Object();
out["nodes"] = json::Array();
out["header"]["level"] = data[0];
out["header"]["level"] = get_build_id_from_section("ASSET_LEVEL_HEADERS", data[0]); // data[0];
out["header"]["vehicle"] = get_enum_string_from_value("Vehicle", data[1]);
@@ -84,7 +84,7 @@ std::string formatGameTextWordEntry(std::string sourceSectionFirst, std::string
}
void AssetAsmIncludes::write_ttghost_table_entry(std::stringstream &out, std::string entryWord, std::string ttGhostJsonPath) {
int levelId = get_int_from_json(ttGhostJsonPath, "header", "level");
int levelId = get_index_from_build_id("ASSET_LEVEL_HEADERS", get_string_from_json(ttGhostJsonPath, "header", "level"));
std::string vehicle = get_string_from_json(ttGhostJsonPath, "header", "vehicle");
int vehicleId = get_enum_value_from_string("Vehicle", vehicle);
write_two_words(out, to_hex((levelId << 24) | (vehicleId << 16)), entryWord);