diff --git a/appveyor.yml b/appveyor.yml index cd09d98..3515605 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ version: 1.0.{build} skip_tags: true -image: Visual Studio 2017 +image: Visual Studio 2022 configuration: Release init: - ps: >- diff --git a/external/hooking b/external/hooking index 542b8db..62d4ff8 160000 --- a/external/hooking +++ b/external/hooking @@ -1 +1 @@ -Subproject commit 542b8dbcd9f7b55811da256deea74902f7aa9067 +Subproject commit 62d4ff80e4a9c587f75bc6eaf6325e2b140bde28 diff --git a/premake5.bat b/premake5.bat index b569c55..3b476e7 100644 --- a/premake5.bat +++ b/premake5.bat @@ -1 +1 @@ -premake5 vs2017 \ No newline at end of file +premake5 vs2022 \ No newline at end of file diff --git a/premake5.exe b/premake5.exe index 9048d51..c73da1f 100644 Binary files a/premake5.exe and b/premake5.exe differ diff --git a/source/IIILodLights/CSearchlights.cpp b/source/IIILodLights/CSearchlights.cpp index 573d3a2..f6c6f0b 100644 --- a/source/IIILodLights/CSearchlights.cpp +++ b/source/IIILodLights/CSearchlights.cpp @@ -97,7 +97,7 @@ void CSearchlights::RenderSearchLightsIII() } } - CLODLightManager::III::bRenderHeliSearchlights ? RenderHeliSearchLightsIII() : nullptr; + if (CLODLightManager::III::bRenderHeliSearchlights) RenderHeliSearchLightsIII(); CLODLightManager::III::RwRenderStateSetIII(rwRENDERSTATEZWRITEENABLE, (void*)1); CLODLightManager::III::RwRenderStateSetIII(rwRENDERSTATEZTESTENABLE, (void*)1); CLODLightManager::III::RwRenderStateSetIII(rwRENDERSTATESRCBLEND, (void*)5); diff --git a/source/IIILodLights/dllmain.cpp b/source/IIILodLights/dllmain.cpp index ee071f2..6b54821 100644 --- a/source/IIILodLights/dllmain.cpp +++ b/source/IIILodLights/dllmain.cpp @@ -483,7 +483,7 @@ void CLODLightManager::III::RegisterLODLights() if (!it->nCoronaShowMode) { CLODLights::RegisterCorona(reinterpret_cast(&*it), nullptr, it->colour.r, it->colour.g, it->colour.b, (bAlpha * (it->colour.a / 255.0f)), it->vecPos, (fRadius * it->fCustomSizeMult * fCoronaRadiusMultiplier), fCoronaFarClip, 1, 0, false, false, 0, 0.0f, false, 0.0f, 0xFF, 255.0f, false, false); - bRenderStaticShadowsForLODs ? CShadowsStoreStaticShadow(reinterpret_cast(&*it), 2, *(RwTexture **)0x8F2A00, (CVector*)&it->vecPos, 8.0f, 0.0f, 0.0f, -8.0f, bAlpha, it->colour.r, it->colour.g, it->colour.b, 15.0f, 1.0f, fCoronaFarClip, false, 0.0f) : nullptr; + if (bRenderStaticShadowsForLODs) CShadowsStoreStaticShadow(reinterpret_cast(&*it), 2, *(RwTexture **)0x8F2A00, (CVector*)&it->vecPos, 8.0f, 0.0f, 0.0f, -8.0f, bAlpha, it->colour.r, it->colour.g, it->colour.b, 15.0f, 1.0f, fCoronaFarClip, false, 0.0f); } else { diff --git a/source/IVLodLights/dllmain.cpp b/source/IVLodLights/dllmain.cpp index da4e837..431698a 100644 --- a/source/IVLodLights/dllmain.cpp +++ b/source/IVLodLights/dllmain.cpp @@ -307,8 +307,12 @@ void CLODLightManager::IV::RegisterLamppost(WplInstance* pObj) dummyMatrix.matrix.pos.y = pObj->PositionY; dummyMatrix.matrix.pos.z = pObj->PositionZ; - if (GetDistance((RwV3d*)&CVector(pObj->PositionX, pObj->PositionY, pObj->PositionZ), (RwV3d*)&CVector(-278.37f, -1377.48f, 90.98f)) <= 300.0f) - return; + { + auto v1 = CVector(pObj->PositionX, pObj->PositionY, pObj->PositionZ); + auto v2 = CVector(-278.37f, -1377.48f, 90.98f); + if (GetDistance((RwV3d*)&v1, (RwV3d*)&v2) <= 300.0f) + return; + } auto itEnd = pFileContent->upper_bound(PackKey(nModelID, 0xFFFF)); for (auto it = pFileContent->lower_bound(PackKey(nModelID, 0)); it != itEnd; it++) diff --git a/source/SALodLights/dllmain.cpp b/source/SALodLights/dllmain.cpp index e6cad78..77e82f0 100644 --- a/source/SALodLights/dllmain.cpp +++ b/source/SALodLights/dllmain.cpp @@ -571,7 +571,7 @@ void CLODLightManager::SA::RegisterLODLights() if (!it->nCoronaShowMode) { CLODLights::RegisterCorona(reinterpret_cast(&*it), nullptr, it->colour.r, it->colour.g, it->colour.b, (bAlpha * (it->colour.a / 255.0f)), it->vecPos, (fRadius * it->fCustomSizeMult * fCoronaRadiusMultiplier), fCoronaFarClip, 1, 0, false, false, 0, 0.0f, false, 0.0f, 0, 255.0f, false, false); - bRenderStaticShadowsForLODs ? CShadowsStoreStaticShadow(reinterpret_cast(&*it), SSHADT_INTENSIVE, *(RwTexture **)0xC403F4, (CVector*)&it->vecPos, 8.0f, 0.0f, 0.0f, -8.0f, bAlpha, (it->colour.r / 3), (it->colour.g / 3), (it->colour.b / 3), 15.0f, 1.0f, fCoronaFarClip, false, 0.0f) : nullptr; + if (bRenderStaticShadowsForLODs) CShadowsStoreStaticShadow(reinterpret_cast(&*it), SSHADT_INTENSIVE, *(RwTexture **)0xC403F4, (CVector*)&it->vecPos, 8.0f, 0.0f, 0.0f, -8.0f, bAlpha, (it->colour.r / 3), (it->colour.g / 3), (it->colour.b / 3), 15.0f, 1.0f, fCoronaFarClip, false, 0.0f); } else { diff --git a/source/VCLodLights/CSearchlights.cpp b/source/VCLodLights/CSearchlights.cpp index 76f6e4d..aa5b7c4 100644 --- a/source/VCLodLights/CSearchlights.cpp +++ b/source/VCLodLights/CSearchlights.cpp @@ -97,7 +97,7 @@ void CSearchlights::RenderSearchLightsVC() } } - CLODLightManager::VC::bRenderHeliSearchlights ? RenderHeliSearchLightsVC() : nullptr; + if (CLODLightManager::VC::bRenderHeliSearchlights) RenderHeliSearchLightsVC(); CLODLightManager::VC::RwRenderStateSetVC(rwRENDERSTATEZWRITEENABLE, (void*)1); CLODLightManager::VC::RwRenderStateSetVC(rwRENDERSTATEZTESTENABLE, (void*)1); CLODLightManager::VC::RwRenderStateSetVC(rwRENDERSTATESRCBLEND, (void*)5); diff --git a/source/VCLodLights/dllmain.cpp b/source/VCLodLights/dllmain.cpp index 6297d08..6657b1f 100644 --- a/source/VCLodLights/dllmain.cpp +++ b/source/VCLodLights/dllmain.cpp @@ -514,7 +514,7 @@ void CLODLightManager::VC::RegisterLODLights() if (!it->nCoronaShowMode) { CLODLights::RegisterCorona(reinterpret_cast(&*it), nullptr, it->colour.r, it->colour.g, it->colour.b, (bAlpha * (it->colour.a / 255.0f)), it->vecPos, (fRadius * it->fCustomSizeMult * fCoronaRadiusMultiplier), fCoronaFarClip, 1, 0, false, false, 0, 0.0f, false, 0.0f, 0xFF, 255.0f, false, false); - bRenderStaticShadowsForLODs ? CShadowsStoreStaticShadow(reinterpret_cast(&*it), 2, *(RwTexture **)0x978DB4, (CVector*)&it->vecPos, 8.0f, 0.0f, 0.0f, -8.0f, bAlpha, it->colour.r, it->colour.g, it->colour.b, 15.0f, 1.0f, fCoronaFarClip, false, 0.0f) : nullptr; + if (bRenderStaticShadowsForLODs) CShadowsStoreStaticShadow(reinterpret_cast(&*it), 2, *(RwTexture **)0x978DB4, (CVector*)&it->vecPos, 8.0f, 0.0f, 0.0f, -8.0f, bAlpha, it->colour.r, it->colour.g, it->colour.b, 15.0f, 1.0f, fCoronaFarClip, false, 0.0f); } else {