diff --git a/src/Components/Modules/AssetHandler.cpp b/src/Components/Modules/AssetHandler.cpp index 9dc783cc..a83c5b52 100644 --- a/src/Components/Modules/AssetHandler.cpp +++ b/src/Components/Modules/AssetHandler.cpp @@ -13,6 +13,9 @@ namespace Components std::map AssetHandler::TemporaryAssets[Game::XAssetType::ASSET_TYPE_COUNT]; + static std::map techsMain; + static std::map techsSub; + void AssetHandler::RegisterInterface(IAsset* iAsset) { if (!iAsset) return; @@ -133,51 +136,43 @@ namespace Components } #if DEBUG - if (type == 9 && false) + if (type == 9) { static Game::MaterialTechniqueSet* technique = nullptr; - auto printTechset = [] (Game::MaterialTechniqueSet* technique, std::string zone) + auto printTechset = [] (Game::MaterialTechniqueSet* technique, std::map* _map) { - FILE* fp; - fopen_s(&fp, "test.txt", "a"); - fprintf(fp, "%s: %s\n", zone.data(), technique->name); - for (int i = 0; i < 48; i++) { if (technique->techniques[i]) { - fprintf(fp, "\t%d: %s\n", i, technique->techniques[i]->name); - for (int j = 0; j < technique->techniques[i]->numPasses; j++) { Game::MaterialPass* pass = &technique->techniques[i]->passes[j]; for (int k = 0; k < (pass->argCount1 + pass->argCount2 + pass->argCount3); k++) { - fprintf(fp, "\t\t\t%d.%d.%d Para: %d\n", i, j, k, pass->argumentDef[k].paramID & 0xFFFF); + std::string name = fmt::sprintf("%s:%d.%d.%d_%d", technique->techniques[i]->name, i, j, k, pass->argumentDef[k].type); + + if (_map->find(name) != _map->end()) + { + OutputDebugStringA(name.data()); + } + + (*_map)[name] = pass->argumentDef[k].paramID; } } } } - - fprintf(fp, "\n"); - fclose(fp); }; - static std::map techs; - if (FastFiles::Current() == "mp_rust_long") { - techs[name] = asset->materialTechset; - printTechset(asset->materialTechset, "mp_rust_long"); + printTechset(asset->materialTechset, &techsMain); } else { - if (techs.find(name) != techs.end()) - { - printTechset(asset->materialTechset, FastFiles::Current()); - } + printTechset(asset->materialTechset, &techsSub); } } #endif @@ -378,6 +373,17 @@ namespace Components Game::Sys_Error(25, reinterpret_cast(0x724428), Game::DB_GetXAssetTypeName(asset.first), asset.second.data()); } + for (auto main : techsMain) + { + if (techsSub.find(main.first) != techsSub.end() && main.second != techsSub[main.first]) + { + FILE* fp; + fopen_s(&fp, "stuff.txt", "a"); + fprintf(fp, "%s: %d %d\n", main.first.data(), main.second & 0xFFFF, techsSub[main.first] & 0xFFFF); + fclose(fp); + } + } + AssetHandler::EmptyAssets.clear(); } }); diff --git a/src/Components/Modules/Maps.cpp b/src/Components/Modules/Maps.cpp index 7ca2a43f..877849a3 100644 --- a/src/Components/Modules/Maps.cpp +++ b/src/Components/Modules/Maps.cpp @@ -416,7 +416,6 @@ namespace Components Maps::AddDependency("mp_shipment_long", "iw4x_dependencies_mp"); Maps::AddDependency("mp_firingrange", "iw4x_dependencies_mp"); Maps::AddDependency("mp_rust_long", "iw4x_dependencies_mp"); - Maps::AddDependency("mp_rust_long", "mp_rust"); #if defined(DEBUG) && defined(ENABLE_DXSDK) Command::Add("dumpmap", [] (Command::Params) diff --git a/src/Components/Modules/Zones.cpp b/src/Components/Modules/Zones.cpp index f30456c3..f962feb7 100644 --- a/src/Components/Modules/Zones.cpp +++ b/src/Components/Modules/Zones.cpp @@ -1009,6 +1009,11 @@ namespace Components if (Zones::Version() >= 359/* && arg->paramID <= 113*/) { arg->paramID -= 7; + + if (arg->paramID <= 53) + { + arg->paramID += 1; + } } } // >= 21 works fine for specular, but breaks trees @@ -1019,7 +1024,7 @@ namespace Components if (Zones::Version() >= 359) { - if (arg->paramID > 15 && arg->paramID < 34) + if (arg->paramID > 15 && arg->paramID < 30) { arg->paramID -= 1; } @@ -1029,6 +1034,10 @@ namespace Components } } } +// else if (Zones::Version() >= 359 && arg->paramID == 20592) +// { +// arg->paramID == 25180; +// } } return result;