diff --git a/deps/fmt b/deps/fmt index ed874df2..abbefd71 160000 --- a/deps/fmt +++ b/deps/fmt @@ -1 +1 @@ -Subproject commit ed874df293f8c0831477a2abbdabfb3a0d0441a8 +Subproject commit abbefd71666055daac9e14e78262620f9e845850 diff --git a/deps/mongoose b/deps/mongoose index a17eae41..835af2ca 160000 --- a/deps/mongoose +++ b/deps/mongoose @@ -1 +1 @@ -Subproject commit a17eae4142f3ab5eea8189810189ab1fec67294a +Subproject commit 835af2cae1b731a350ac86003f82183302bd2155 diff --git a/src/Components/Modules/AssetHandler.cpp b/src/Components/Modules/AssetHandler.cpp index 28bef154..2e60509d 100644 --- a/src/Components/Modules/AssetHandler.cpp +++ b/src/Components/Modules/AssetHandler.cpp @@ -151,7 +151,7 @@ namespace Components OutputDebugStringA(Utils::String::VA("%s: %s\n", FastFiles::Current().data(), name)); } - + /* if (type <= 9 && type >= 6 && Zones::Version() >= 359) { static Game::XAssetType __type; @@ -179,9 +179,11 @@ namespace Components OutputDebugStringA(""); } } + */ - if (type == 21 && asset->gfxMap->baseName == "mp_underpass"s) + if (type == 21/* && asset->gfxMap->baseName == "mp_underpass"s*/ && false) { + //asset->gfxMap->dpvs.smodelCount = 0; Game::GfxWorld* world = nullptr; @@ -335,26 +337,46 @@ namespace Components static Game::MaterialTechniqueSet* technique = nullptr; - if (type == 5 && Utils::String::StartsWith(name, "wc/")) + /*if (type == 9) { - if (technique == (Game::MaterialTechniqueSet*)1) + FILE* fp; + fopen_s(&fp, "test.txt", "a"); + fprintf(fp, "%s: %s\n", FastFiles::Current().data(), name); + + for (int i = 0; i < 48; i++) { - technique = asset->material->techniqueSet; + if (asset->materialTechset->techniques[i]) + { + fprintf(fp, "\t%d: %s\n", i, asset->materialTechset->techniques[i]->name); + + for (int j = 0; j materialTechset->techniques[i]->numPasses; j++) + { + Game::MaterialPass* pass = &asset->materialTechset->techniques[i]->passes[j]; + + for (int k = 0; k < (pass->argCount1 + pass->argCount2 + pass->argCount3); k++) + { + fprintf(fp, "\t\t%d.%d.%d:\n", i, j, k); + + fprintf(fp, "\t\t\tDest: %d\n", pass->argumentDef[k].dest & 0xFFFF); + fprintf(fp, "\t\t\tMore: %d\n", pass->argumentDef[k].more & 0xFFFF); + fprintf(fp, "\t\t\tType: %d\n", pass->argumentDef[k].type & 0xFFFF); + fprintf(fp, "\t\t\tPara: %d\n", pass->argumentDef[k].paramID & 0xFFFF); + } + } + } } - if (!technique) - { - technique = (Game::MaterialTechniqueSet*)1; - } + fprintf(fp, "\n"); + fclose(fp); + }*/ - if (Zones::Version() >= 359) - { - //asset->material->techniqueSet = technique; - } - - //asset->material->sortKey = rand() & 0xFF; - //OutputDebugStringA(Utils::String::VA("%s: %X %s", FastFiles::Current().data(), asset->material->sortKey & 0xFF, asset->material->name)); - } +// if (type == 5) +// { +// FILE* fp; +// fopen_s(&fp, "test.txt", "a"); +// fprintf(fp, "%s: %s %X %X %X\n", FastFiles::Current().data(), name, asset->material->sortKey & 0xFF, asset->material->gameFlags & 0xFF, asset->material->stateFlags & 0xFF); +// fclose(fp); +// } if (type == 5 && name == "wc/codo_ui_viewer_black_decal3"s) { @@ -545,7 +567,7 @@ namespace Components // Log missing empty assets QuickPatch::OnFrame([] () { - if (Game::Sys_IsDatabaseReady() && Game::Sys_IsDatabaseReady2() && !AssetHandler::EmptyAssets.empty()) + if (FastFiles::Ready() && !AssetHandler::EmptyAssets.empty()) { for (auto& asset : AssetHandler::EmptyAssets) { diff --git a/src/Components/Modules/ConnectProtocol.cpp b/src/Components/Modules/ConnectProtocol.cpp index 80936761..59a5680f 100644 --- a/src/Components/Modules/ConnectProtocol.cpp +++ b/src/Components/Modules/ConnectProtocol.cpp @@ -197,7 +197,7 @@ namespace Components { if (ConnectProtocol::Used()) { - if (!Game::Sys_IsDatabaseReady() && !Game::Sys_IsDatabaseReady2()) + if (!FastFiles::Ready()) { QuickPatch::Once(ConnectProtocol::Invocation); } diff --git a/src/Components/Modules/FastFiles.cpp b/src/Components/Modules/FastFiles.cpp index c13a755a..5005908e 100644 --- a/src/Components/Modules/FastFiles.cpp +++ b/src/Components/Modules/FastFiles.cpp @@ -218,6 +218,11 @@ namespace Components return std::ifstream(path.data()).good(); } + bool FastFiles::Ready() + { + return (Game::Sys_IsDatabaseReady() && Game::Sys_IsDatabaseReady2()); + } + const char* FastFiles::GetZoneLocation(const char* file) { const char* dir = Dvar::Var("fs_basepath").Get(); diff --git a/src/Components/Modules/FastFiles.hpp b/src/Components/Modules/FastFiles.hpp index 6e1b329a..33a8e129 100644 --- a/src/Components/Modules/FastFiles.hpp +++ b/src/Components/Modules/FastFiles.hpp @@ -12,7 +12,7 @@ namespace Components static void AddZonePath(std::string path); static std::string Current(); - + static bool Ready(); static bool Exists(std::string file); static void LoadLocalizeZones(Game::XZoneInfo *zoneInfo, unsigned int zoneCount, int sync); diff --git a/src/Components/Modules/Maps.cpp b/src/Components/Modules/Maps.cpp index 6db0596f..65f5dba4 100644 --- a/src/Components/Modules/Maps.cpp +++ b/src/Components/Modules/Maps.cpp @@ -314,7 +314,15 @@ namespace Components Assert_Size(Game::XAssetEntry, 16); Maps::EntryPool.clear(); - Maps::EntryPool.resize(789312); + + if (ZoneBuilder::IsEnabled()) + { + Maps::EntryPool.resize(1183968); + } + else + { + Maps::EntryPool.resize(789312); + } // Apply new size Utils::Hook::Set(0x5BAEB0, Maps::EntryPool.size()); @@ -404,11 +412,13 @@ namespace Components Maps::AddDependency("mp_bloc_sh", "iw4x_dependencies_mp"); Maps::AddDependency("mp_cargoship_sh", "iw4x_dependencies_mp"); - //Maps::AddDependency("mp_firingrange", "iw4x_dependencies_mp"); - //Maps::AddDependency("mp_shipment_long", "iw4x_dependencies_mp"); - //Maps::AddDependency("mp_firingrange", "iw4x_dependencies_mp"); - //Maps::AddDependency("mp_firingrange", "mp_underpass"); - //Maps::AddDependency("mp_underpass", "mp_firingrange"); + Maps::AddDependency("mp_firingrange", "iw4x_dependencies_mp"); + Maps::AddDependency("mp_shipment_long", "iw4x_dependencies_mp"); + Maps::AddDependency("mp_firingrange", "iw4x_dependencies_mp"); + Maps::AddDependency("mp_firingrange", "mp_underpass"); + Maps::AddDependency("zm_asylum_sh", "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/ZoneBuilder.cpp b/src/Components/Modules/ZoneBuilder.cpp index 91488a54..ad471d56 100644 --- a/src/Components/Modules/ZoneBuilder.cpp +++ b/src/Components/Modules/ZoneBuilder.cpp @@ -493,8 +493,11 @@ namespace Components Utils::Hook::Nop(0x5BB3F2, 5); Utils::Hook::Nop(0x5BB422, 5); Utils::Hook::Nop(0x5BB43A, 5); + // Increase asset pools Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_MAP_ENTS, 10); + Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_XMODELSURFS, 8192); + Game::ReallocateAssetPool(Game::XAssetType::ASSET_TYPE_IMAGE, 14336); // hunk size (was 300 MiB) Utils::Hook::Set(0x64A029, 0x38400000); // 900 MiB