From 361808923a099674d7af6701670ecb90d905c337 Mon Sep 17 00:00:00 2001 From: aap Date: Wed, 13 Jan 2021 14:16:38 +0100 Subject: [PATCH 01/21] arrest cam fixes --- src/core/Cam.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp index 731537ef..d8c66279 100644 --- a/src/core/Cam.cpp +++ b/src/core/Cam.cpp @@ -4346,7 +4346,7 @@ CCam::ProcessArrestCamOne(void) ((CPed*)TheCamera.pTargetEntity)->m_pedIK.GetComponentPosition(TargetPos, PED_MID); if(FindPlayerPed() && FindPlayerPed()->m_pArrestingCop) cop = FindPlayerPed()->m_pArrestingCop; - if(cop && CGeneral::GetRandomNumberInRange(0.0f, 0.1f) > 0.5f){ + if(cop && CGeneral::GetRandomNumberInRange(0.0f, 1.0f) > 0.5f){ ArrestModes[0] = ARRESTCAM_OVERSHOULDER; ArrestModes[1] = ARRESTCAM_ALONGGROUND; ArrestModes[2] = ARRESTCAM_OVERSHOULDER; @@ -4368,7 +4368,7 @@ CCam::ProcessArrestCamOne(void) if(FindPlayerPed() && FindPlayerPed()->m_pArrestingCop) cop = FindPlayerPed()->m_pArrestingCop; - if(cop && CGeneral::GetRandomNumberInRange(0.0f, 0.1f) > 0.65f){ + if(cop && CGeneral::GetRandomNumberInRange(0.0f, 1.0f) > 0.65f){ ArrestModes[0] = ARRESTCAM_OVERSHOULDER; ArrestModes[1] = ARRESTCAM_LAMPPOST; ArrestModes[2] = ARRESTCAM_ALONGGROUND; @@ -4438,6 +4438,7 @@ CCam::ProcessArrestCamOne(void) pStoredCopPed = nil; } + Source = CamSource; CVector OrigSource = Source; TheCamera.AvoidTheGeometry(OrigSource, TargetPos, Source, FOV); Front = TargetPos - Source; @@ -4464,8 +4465,9 @@ CCam::ProcessArrestCamOne(void) if(nUsingWhichCamera == ARRESTCAM_OVERSHOULDER && pStoredCopPed){ foundPos = GetLookOverShoulderPos(TheCamera.pTargetEntity, pStoredCopPed, TargetPos, CamSource); - if(CamSource.z > Source.z + ARRESTCAM_S_ROTATION_UP*CTimer::GetTimeStep()) - CamSource.z = Source.z + ARRESTCAM_S_ROTATION_UP*CTimer::GetTimeStep(); + float newZ = Source.z + ARRESTCAM_S_ROTATION_UP*CTimer::GetTimeStep(); + if(CamSource.z > newZ) + CamSource.z = newZ; }else if(nUsingWhichCamera >= ARRESTCAM_ALONGGROUND_RIGHT && nUsingWhichCamera <= ARRESTCAM_ALONGGROUND_LEFT_UP){ CamSource = Source; Front = TargetPos - CamSource; From dacd3897997f85be432078ce2336be54c926f1bf Mon Sep 17 00:00:00 2001 From: withmorten Date: Wed, 13 Jan 2021 14:34:58 +0100 Subject: [PATCH 02/21] remove scriptspath from premake --- premake5.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/premake5.lua b/premake5.lua index e62ad6be..857293a9 100644 --- a/premake5.lua +++ b/premake5.lua @@ -172,11 +172,10 @@ workspace "reVC" filter {} - function setpaths (gamepath, exepath, scriptspath) - scriptspath = scriptspath or "" + function setpaths (gamepath, exepath) if (gamepath) then postbuildcommands { - '{COPYFILE} "%{cfg.buildtarget.abspath}" "' .. gamepath .. scriptspath .. '%{cfg.buildtarget.name}"' + '{COPYFILE} "%{cfg.buildtarget.abspath}" "' .. gamepath .. '%{cfg.buildtarget.name}"' } debugdir (gamepath) if (exepath) then @@ -186,7 +185,6 @@ workspace "reVC" debugdir (gamepath .. (dir or "")) end end - --targetdir ("bin/%{prj.name}/" .. scriptspath) end if(_OPTIONS["with-librw"]) then @@ -309,7 +307,7 @@ project "reVC" filter {} if(os.getenv("GTA_VC_RE_DIR")) then - setpaths("$(GTA_VC_RE_DIR)/", "%(cfg.buildtarget.name)", "") + setpaths("$(GTA_VC_RE_DIR)/", "%(cfg.buildtarget.name)") end filter "platforms:win*" From daf1de550c307b984c0092d3dda4eba5234cbd10 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Wed, 13 Jan 2021 22:02:28 +0300 Subject: [PATCH 03/21] fix --- src/control/Script7.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/control/Script7.cpp b/src/control/Script7.cpp index 5a70fd28..55068bb6 100644 --- a/src/control/Script7.cpp +++ b/src/control/Script7.cpp @@ -95,8 +95,8 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command) CollectParameters(&m_nIp, 2); CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); script_assert(pPed); - ScriptParams[0] = pPed->GetWeapon(ScriptParams[1]).m_eWeaponType; - ScriptParams[1] = pPed->GetWeapon(ScriptParams[1]).m_nAmmoTotal; + ScriptParams[0] = pPed->GetWeapon(ScriptParams[1] - 1).m_eWeaponType; + ScriptParams[1] = pPed->GetWeapon(ScriptParams[1] - 1).m_nAmmoTotal; ScriptParams[2] = CPickups::ModelForWeapon((eWeaponType)ScriptParams[0]); StoreParameters(&m_nIp, 3); return 0; From 7994b80dcf0d62001c3282dacf1cd376abc9955c Mon Sep 17 00:00:00 2001 From: aap Date: Wed, 13 Jan 2021 20:09:53 +0100 Subject: [PATCH 04/21] fixed weapon LOS check --- src/weapons/Weapon.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp index e2213399..940a6b98 100644 --- a/src/weapons/Weapon.cpp +++ b/src/weapons/Weapon.cpp @@ -911,7 +911,7 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource) CWorld::bIncludeDeadPeds = true; CWorld::bIncludeBikers = true; - CWorld::ProcessLineOfSight(*fireSource, target, point, victim, true, true, true, true, true, false, false, true); + ProcessLineOfSight(*fireSource, target, point, victim, m_eWeaponType, shooter, true, true, true, true, true, false, false); CWorld::bIncludeDeadPeds = false; CWorld::bIncludeBikers = false; } @@ -924,7 +924,7 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource) shooterPed->TransformToNode(target, PED_HANDR); CWorld::bIncludeBikers = true; - CWorld::ProcessLineOfSight(*fireSource, target, point, victim, true, true, true, true, true, false, false, true); + ProcessLineOfSight(*fireSource, target, point, victim, m_eWeaponType, shooter, true, true, true, true, true, false, false); CWorld::bIncludeBikers = false; } } @@ -935,7 +935,7 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource) CWorld::bIncludeBikers = true; CWorld::bIncludeDeadPeds = true; CWorld::bIncludeCarTyres = true; - CWorld::ProcessLineOfSight(source, target, point, victim, true, true, true, true, true, false, false, true); + ProcessLineOfSight(source, target, point, victim, m_eWeaponType, shooter, true, true, true, true, true, false, false); CWorld::bIncludeBikers = false; CWorld::bIncludeDeadPeds = false; CWorld::bIncludeCarTyres = false; @@ -981,7 +981,7 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource) target *= info->m_fRange; target += *fireSource; CWorld::pIgnoreEntity = shooter; - CWorld::ProcessLineOfSight(*fireSource, target, point, victim, true, true, true, true, true, false, false, true); + ProcessLineOfSight(*fireSource, target, point, victim, m_eWeaponType, shooter, true, true, true, true, true, true, false); CWorld::pIgnoreEntity = nil; int32 rotSpeed = 1; @@ -1014,7 +1014,7 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource) } CWorld::bIncludeBikers = true; - CWorld::ProcessLineOfSight(*fireSource, target, point, victim, true, true, true, true, true, false, false, true); + ProcessLineOfSight(*fireSource, target, point, victim, m_eWeaponType, shooter, true, true, true, true, true, false, false); CWorld::bIncludeBikers = false; int32 rotSpeed = 1; @@ -1683,7 +1683,7 @@ CWeapon::FireShotgun(CEntity *shooter, CVector *fireSource) CWorld::bIncludeCarTyres = true; CWorld::bIncludeBikers = true; CWorld::bIncludeDeadPeds = true; - CWorld::ProcessLineOfSight(source, target, point, victim, true, true, true, true, true, false, false, true); + ProcessLineOfSight(source, target, point, victim, m_eWeaponType, shooter, true, true, true, true, true, false, false); CWorld::bIncludeDeadPeds = false; CWorld::bIncludeCarTyres = false; } @@ -1716,7 +1716,7 @@ CWeapon::FireShotgun(CEntity *shooter, CVector *fireSource) CWorld::bIncludeDeadPeds = true; CWorld::bIncludeBikers = true; - CWorld::ProcessLineOfSight(*fireSource, target, point, victim, true, true, true, true, true, false, false, true); + ProcessLineOfSight(*fireSource, target, point, victim, m_eWeaponType, shooter, true, true, true, true, true, false, false); CWorld::bIncludeDeadPeds = false; } CWorld::bIncludeBikers = false; @@ -2329,7 +2329,7 @@ CWeapon::FireM16_1stPerson(CEntity *shooter) CVector source = cam->Source; CVector target = cam->Front*info->m_fRange + source; - if (CWorld::ProcessLineOfSight(source, target, point, victim, true, true, true, true, true, false, false, true)) { + if (ProcessLineOfSight(source, target, point, victim, m_eWeaponType, shooter, true, true, true, true, true, true, false)) { CheckForShootingVehicleOccupant(&victim, &point, m_eWeaponType, source, target); } CWorld::pIgnoreEntity = nil; @@ -3176,7 +3176,7 @@ CPed::IsPedDoingDriveByShooting(void) bool CWeapon::ProcessLineOfSight(CVector const &point1, CVector const &point2, CColPoint &point, CEntity *&entity, eWeaponType type, CEntity *shooter, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects) { - return CWorld::ProcessLineOfSight(point1, point2, point, entity, checkBuildings, checkVehicles, checkPeds, checkObjects, checkDummies, ignoreSeeThrough, ignoreSomeObjects); + return CWorld::ProcessLineOfSight(point1, point2, point, entity, checkBuildings, checkVehicles, checkPeds, checkObjects, checkDummies, false, ignoreSomeObjects, true); } From 3a6935f126a9bdebe933578f66eaae208a0d6b5c Mon Sep 17 00:00:00 2001 From: aap Date: Wed, 13 Jan 2021 20:39:00 +0100 Subject: [PATCH 05/21] fixed shoot through collision --- src/collision/Collision.cpp | 16 ++++++++++++---- src/core/SurfaceTable.h | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/collision/Collision.cpp b/src/collision/Collision.cpp index c90390c4..947cad59 100644 --- a/src/collision/Collision.cpp +++ b/src/collision/Collision.cpp @@ -507,12 +507,14 @@ CCollision::TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColMod for(i = 0; i < model.numSpheres; i++){ if(ignoreSeeThrough && IsSeeThrough(model.spheres[i].surface)) continue; + if(ignoreShootThrough && IsShootThrough(model.spheres[i].surface)) continue; if(TestLineSphere(*(CColLine*)newline, model.spheres[i])) return true; } for(i = 0; i < model.numBoxes; i++){ if(ignoreSeeThrough && IsSeeThrough(model.boxes[i].surface)) continue; + if(ignoreShootThrough && IsShootThrough(model.boxes[i].surface)) continue; if(TestLineBox(*(CColLine*)newline, model.boxes[i])) return true; } @@ -522,6 +524,7 @@ CCollision::TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColMod VuTriangle vutri; for(i = 0; i < model.numTriangles; i++){ if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue; + if(ignoreShootThrough && IsShootThrough(model.triangles[i].surface)) continue; CColTriangle *tri = &model.triangles[i]; model.vertices[tri->a].Unpack(vutri.v0); @@ -539,6 +542,7 @@ CCollision::TestLineOfSight(const CColLine &line, const CMatrix &matrix, CColMod #endif for(; i < model.numTriangles; i++){ if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue; + if(ignoreShootThrough && IsShootThrough(model.triangles[i].surface)) continue; CColTriangle *tri = &model.triangles[i]; model.vertices[tri->a].Unpack(vutri.v0); @@ -1333,6 +1337,7 @@ CCollision::ProcessLineOfSight(const CColLine &line, float coldist = 1.0f; for(i = 0; i < model.numSpheres; i++){ if(ignoreSeeThrough && IsSeeThrough(model.spheres[i].surface)) continue; + if(ignoreShootThrough && IsShootThrough(model.spheres[i].surface)) continue; if(ProcessLineSphere(*(CColLine*)newline, model.spheres[i], point, coldist)) point.Set(0, 0, model.spheres[i].surface, model.spheres[i].piece); } @@ -1348,6 +1353,7 @@ CCollision::ProcessLineOfSight(const CColLine &line, CColTriangle *lasttri = nil; for(i = 0; i < model.numTriangles; i++){ if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue; + if(ignoreShootThrough && IsShootThrough(model.triangles[i].surface)) continue; CColTriangle *tri = &model.triangles[i]; model.vertices[tri->a].Unpack(vutri.v0); @@ -1367,6 +1373,7 @@ CCollision::ProcessLineOfSight(const CColLine &line, float dist; for(; i < model.numTriangles; i++){ if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue; + if(ignoreShootThrough && IsShootThrough(model.triangles[i].surface)) continue; CColTriangle *tri = &model.triangles[i]; model.vertices[tri->a].Unpack(vutri.v0); @@ -1466,13 +1473,13 @@ CCollision::ProcessVerticalLine(const CColLine &line, float coldist = 1.0f; for(i = 0; i < model.numSpheres; i++){ - if(ignoreSeeThrough && IsSeeThrough(model.spheres[i].surface)) continue; + if(ignoreSeeThrough && IsSeeThroughVertical(model.spheres[i].surface)) continue; if(ProcessLineSphere(*(CColLine*)newline, model.spheres[i], point, coldist)) point.Set(0, 0, model.spheres[i].surface, model.spheres[i].piece); } for(i = 0; i < model.numBoxes; i++){ - if(ignoreSeeThrough && IsSeeThrough(model.boxes[i].surface)) continue; + if(ignoreSeeThrough && IsSeeThroughVertical(model.boxes[i].surface)) continue; if(ProcessLineBox(*(CColLine*)newline, model.boxes[i], point, coldist)) point.Set(0, 0, model.boxes[i].surface, model.boxes[i].piece); } @@ -1484,7 +1491,7 @@ CCollision::ProcessVerticalLine(const CColLine &line, CColTriangle *lasttri = nil; VuTriangle vutri; for(i = 0; i < model.numTriangles; i++){ - if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue; + if(ignoreSeeThrough && IsSeeThroughVertical(model.triangles[i].surface)) continue; CColTriangle *tri = &model.triangles[i]; model.vertices[tri->a].Unpack(vutri.v0); @@ -1503,7 +1510,7 @@ CCollision::ProcessVerticalLine(const CColLine &line, CVuVector pnt, normal; float dist; for(; i < model.numTriangles; i++){ - if(ignoreSeeThrough && IsSeeThrough(model.triangles[i].surface)) continue; + if(ignoreSeeThrough && IsSeeThroughVertical(model.triangles[i].surface)) continue; CColTriangle *tri = &model.triangles[i]; model.vertices[tri->a].Unpack(vutri.v0); @@ -2289,6 +2296,7 @@ CCollision::DrawColModel(const CMatrix &mat, const CColModel &colModel) } for(i = 0; i < colModel.numBoxes; i++){ +if(IsShootThrough(colModel.boxes[i].surface)) continue; min = colModel.boxes[i].min; max = colModel.boxes[i].max; diff --git a/src/core/SurfaceTable.h b/src/core/SurfaceTable.h index cd08c843..8ff43106 100644 --- a/src/core/SurfaceTable.h +++ b/src/core/SurfaceTable.h @@ -81,6 +81,7 @@ inline bool IsShootThrough(uint8 surfType) { switch(surfType) + case SURFACE_TRANSPARENT_CLOTH: case SURFACE_METAL_CHAIN_FENCE: case SURFACE_TRANSPARENT_STONE: case SURFACE_SCAFFOLD_POLE: From ab14a0bc61b8c6dd5a00431518f90de3c6a8a565 Mon Sep 17 00:00:00 2001 From: aap Date: Wed, 13 Jan 2021 20:40:20 +0100 Subject: [PATCH 06/21] foobar --- src/collision/Collision.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/collision/Collision.cpp b/src/collision/Collision.cpp index 947cad59..703804d9 100644 --- a/src/collision/Collision.cpp +++ b/src/collision/Collision.cpp @@ -2296,7 +2296,6 @@ CCollision::DrawColModel(const CMatrix &mat, const CColModel &colModel) } for(i = 0; i < colModel.numBoxes; i++){ -if(IsShootThrough(colModel.boxes[i].surface)) continue; min = colModel.boxes[i].min; max = colModel.boxes[i].max; From 13b52229be04b265e1fe3d0f76cf4b88e3e72edf Mon Sep 17 00:00:00 2001 From: erorcun Date: Wed, 13 Jan 2021 23:07:12 +0300 Subject: [PATCH 07/21] hud ammo fix --- src/render/Hud.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp index d7a9d75d..238dfbb5 100644 --- a/src/render/Hud.cpp +++ b/src/render/Hud.cpp @@ -449,10 +449,10 @@ void CHud::Draw() } if (m_WeaponState != FADED_OUT) { CWeapon *weapon = playerPed->GetWeapon(); - uint32 AmmoAmount = CWeaponInfo::GetWeaponInfo((eWeaponType)WeaponType)->m_nAmountofAmmunition; - uint32 AmmoInClip = weapon->m_nAmmoInClip; - uint32 TotalAmmo = weapon->m_nAmmoTotal; - uint32 Ammo, Clip; + int32 AmmoAmount = CWeaponInfo::GetWeaponInfo((eWeaponType)WeaponType)->m_nAmountofAmmunition; + int32 AmmoInClip = weapon->m_nAmmoInClip; + int32 TotalAmmo = weapon->m_nAmmoTotal; + int32 Ammo, Clip; if (AmmoAmount <= 1 || AmmoAmount >= 1000) sprintf(sTemp, "%d", TotalAmmo); From 6a93cc49be79a397bb1549813ba2001fbbab120f Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Thu, 14 Jan 2021 00:15:45 +0300 Subject: [PATCH 08/21] fix --- src/control/Script8.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/control/Script8.cpp b/src/control/Script8.cpp index 74552b23..c34830e7 100644 --- a/src/control/Script8.cpp +++ b/src/control/Script8.cpp @@ -66,7 +66,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command) return 0; case COMMAND_WANTED_STARS_ARE_FLASHING: { - CWanted *pWanted = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted; + CWanted* pWanted = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_pWanted; UpdateCompareFlag(pWanted->m_nMinWantedLevel - pWanted->m_nWantedLevel > 0); return 0; } @@ -136,7 +136,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command) CTheScripts::ReadTextLabelFromScript(&m_nIp, key); m_nIp += KEY_LENGTH_IN_SCRIPT; CVector pos = pPlayerInfo->GetPos(); - CZone *infoZone = CTheZones::FindInformationZoneForPosition(&pos); + CZone* infoZone = CTheZones::FindInformationZoneForPosition(&pos); UpdateCompareFlag(strncmp(key, infoZone->name, 8) == 0); // original code doesn't seem to be using strncmp in here and compare 2 ints instead return 0; } @@ -352,7 +352,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command) case COMMAND_CREATE_DUST_EFFECT_FOR_CUTSCENE_HELI: { CollectParameters(&m_nIp, 3); - CObject *pHeli = CPools::GetObjectPool()->GetAt(ScriptParams[0]); + CObject* pHeli = CPools::GetObjectPool()->GetAt(ScriptParams[0]); bool found = false; float waterLevel = -1000.0f; CVector pos = pHeli->GetPosition(); @@ -396,11 +396,13 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command) return 0; #elif (!defined GTA_PS2) case COMMAND_SET_ONSCREEN_COUNTER_FLASH_WHEN_FIRST_DISPLAYED: + { script_assert(CTheScripts::ScriptSpace[m_nIp++] == ARGUMENT_GLOBALVAR); uint16 var = CTheScripts::Read2BytesFromScript(&m_nIp); CollectParameters(&m_nIp, 1); //CUserDisplay::OnscnTimer.SetCounterFlashWhenFirstDisplayed(var, ScriptParams[0]); - break; + return 0; + } #endif #if (defined GTA_PC && !defined GTAVC_JP_PATCH || defined GTA_XBOX || defined SUPPORT_XBOX_SCRIPT || defined GTA_MOBILE || defined SUPPORT_MOBILE_SCRIPT) case COMMAND_SHUFFLE_CARD_DECKS: From 7c8933f8c4fd3ca23dcafc6c510e439f5fabb294 Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Thu, 14 Jan 2021 15:03:54 +0100 Subject: [PATCH 09/21] Port conan to miami --- .github/workflows/build-cmake-conan.yml | 116 ++++++++++++++++++++ .github/workflows/reVC_msvc_amd64.yml | 2 +- .github/workflows/reVC_msvc_x86.yml | 2 +- conanfile.py | 135 ++++++++++++++++++++++++ 4 files changed, 253 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build-cmake-conan.yml create mode 100644 conanfile.py diff --git a/.github/workflows/build-cmake-conan.yml b/.github/workflows/build-cmake-conan.yml new file mode 100644 index 00000000..1f520677 --- /dev/null +++ b/.github/workflows/build-cmake-conan.yml @@ -0,0 +1,116 @@ +name: reVC conan+cmake +on: + pull_request: + push: + release: + types: published +jobs: + build-cmake: + strategy: + matrix: + include: + - os: 'windows-latest' + platform: 'gl3' + gl3_gfxlib: 'glfw' + audio: 'openal' +# - os: 'windows-latest' +# platform: 'gl3' +# gl3_gfxlib: 'sdl2' +# audio: 'openal' + - os: 'windows-latest' + platform: 'd3d9' + audio: 'openal' +# - os: 'windows-latest' +# platform: 'd3d9' +# audio: 'miles' + - os: 'ubuntu-latest' + platform: 'gl3' + gl3_gfxlib: 'glfw' + audio: 'openal' +# - os: 'ubuntu-latest' +# platform: 'gl3' +# gl3_gfxlib: 'sdl2' +# audio: 'openal' + - os: 'macos-latest' + platform: 'gl3' + gl3_gfxlib: 'glfw' + audio: 'openal' +# - os: 'macos-latest' +# platform: 'gl3' +# gl3_gfxlib: 'sdl2' +# audio: 'openal' + runs-on: ${{ matrix.os }} + continue-on-error: ${{ matrix.platform == 'ps2' || matrix.gl3_gfxlib == 'sdl2' || matrix.audio == 'miles' }} + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: "Checkout Miles SDK Import Library project" + uses: actions/checkout@v2 + if: ${{ matrix.audio == 'miles' }} + with: + repository: 'withmorten/re3mss' + path: 're3mss' + - uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: "Use XCode 11 as default (conan-center-index does not provide XCode 12 binaries at the moment)" + if: startsWith(matrix.os, 'macos') + run: | + sudo xcode-select --switch /Applications/Xcode_11.7.app + - name: "Setup conan" + run: | + python -m pip install conan + conan config init + conan config set log.print_run_commands=True + conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan + conan remote add madebr_ps2dev https://api.bintray.com/conan/madebr/ps2dev + - name: "Add os=playstation2 + gcc.version=3.2 to .conan/settings.yml" + shell: python + run: | + import os, yaml + settings_path = os.path.expanduser("~/.conan/settings.yml") + yml = yaml.safe_load(open(settings_path)) + yml["os"]["playstation2"] = None + yml["compiler"]["gcc"]["version"].append("3.2") + yml["compiler"]["gcc"]["version"].sort() + yaml.safe_dump(yml, open(settings_path, "w")) + - name: "Create host profile" + shell: bash + run: | + if test "${{ matrix.platform }}" = "ps2"; then + cp vendor/librw/conan/playstation2 host_profile + else + cp ~/.conan/profiles/default host_profile + fi + - name: "Export Playstation 2 CMake toolchain conan recipe" + run: | + conan export vendor/librw/cmake/ps2toolchain ps2dev-cmaketoolchain/master@ + - name: "Export librw conan recipe" + run: | + conan export vendor/librw librw/master@ + - name: "Export Miles SDK conan recipe" + if: ${{ matrix.audio == 'miles' }} + run: | + conan export re3mss miles-sdk/master@ + - name: "Download/build dependencies (conan install)" + run: | + conan install ${{ github.workspace }} reVC/master -if build -o reVC:audio=${{ matrix.audio }} -o librw:platform=${{ matrix.platform }} -o librw:gl3_gfxlib=${{ matrix.gl3_gfxlib || 'glfw' }} --build missing -pr:h ./host_profile -pr:b default -s reVC:build_type=RelWithDebInfo -s librw:build_type=RelWithDebInfo + env: + CONAN_SYSREQUIRES_MODE: enabled + - name: "Build reVC (conan build)" + run: | + conan build ${{ github.workspace }} -if build -bf build -pf package + - name: "Package reVC (conan package)" + run: | + conan package ${{ github.workspace }} -if build -bf build -pf package + - name: "Create binary package (cpack)" + working-directory: ./build + run: | + cpack -C RelWithDebInfo + - name: "Archive binary package (github artifacts)" + uses: actions/upload-artifact@v2 + with: + name: "${{ matrix.os }}-${{ matrix.platform }}" + path: build/*.tar.xz + if-no-files-found: error diff --git a/.github/workflows/reVC_msvc_amd64.yml b/.github/workflows/reVC_msvc_amd64.yml index 2053a770..78b8bc9d 100644 --- a/.github/workflows/reVC_msvc_amd64.yml +++ b/.github/workflows/reVC_msvc_amd64.yml @@ -1,4 +1,4 @@ -name: reVC_msvc_amd64 +name: re3 premake amd64 on: pull_request: diff --git a/.github/workflows/reVC_msvc_x86.yml b/.github/workflows/reVC_msvc_x86.yml index 99079608..b9e83dba 100644 --- a/.github/workflows/reVC_msvc_x86.yml +++ b/.github/workflows/reVC_msvc_x86.yml @@ -1,4 +1,4 @@ -name: reVC_msvc_x86 +name: reVC premake x86 on: pull_request: diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 00000000..c5b74802 --- /dev/null +++ b/conanfile.py @@ -0,0 +1,135 @@ +from conans import ConanFile, CMake, tools +from conans.errors import ConanException, ConanInvalidConfiguration +import os +import shutil +import textwrap + + +class ReVCConan(ConanFile): + name = "reVC" + version = "master" + license = "???" # FIXME: https://github.com/GTAmodding/re3/issues/794 + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + options = { + "audio": ["openal", "miles"], + "with_libsndfile": [True, False], + "with_opus": [True, False], + } + default_options = { + "audio": "openal", + "with_libsndfile": False, + "with_opus": False, + # "libsndfile:with_external_libs": False, + # "mpg123:flexible_resampling": False, + # "mpg123:network": False, + # "mpg123:icy": False, + # "mpg123:id3v2": False, + # "mpg123:ieeefloat": False, + # "mpg123:layer1": False, + # "mpg123:layer2": False, + # "mpg123:layer3": False, + # "mpg123:moreinfo": False, + # "sdl2:vulkan": False, + # "sdl2:opengl": True, + # "sdl2:sdl2main": True, + } + no_copy_source = True + + @property + def _os_is_playstation2(self): + try: + return self.settings.os == "Playstation2" + except ConanException: + return False + + def configure(self): + if self.options.audio != "openal": + self.options.with_libsndfile = False + + def requirements(self): + self.requires("librw/{}".format(self.version)) + self.requires("mpg123/1.26.4") + if self.options.audio == "openal": + self.requires("openal/1.21.0") + elif self.options.audio == "miles": + self.requires("miles-sdk/{}".format(self.version)) + if self.options.with_libsndfile: + self.requires("libsndfile/1.0.30") + if self.options.with_opus: + self.requires("opusfile/0.12") + + def export_sources(self): + for d in ("cmake", "src"): + shutil.copytree(src=d, dst=os.path.join(self.export_sources_folder, d)) + self.copy("CMakeLists.txt") + + def validate(self): + if self.options["librw"].platform == "gl3" and self.options["librw"].gl3_gfxlib != "glfw": + raise ConanInvalidConfiguration("Only `glfw` is supported as gl3_gfxlib.") + #if not self.options.with_opus: + # if not self.options["libsndfile"].with_external_libs: + # raise ConanInvalidConfiguration("reVC with opus support requires a libsndfile built with external libs (=ogg/flac/opus/vorbis)") + + @property + def _reVC_audio(self): + return { + "miles": "MSS", + "openal": "OAL", + }[str(self.options.audio)] + + def build(self): + if self.source_folder == self.build_folder: + raise Exception("cannot build with source_folder == build_folder") + try: + os.unlink(os.path.join(self.install_folder, "Findlibrw.cmake")) + tools.save("FindOpenAL.cmake", + textwrap.dedent( + """ + set(OPENAL_FOUND ON) + set(OPENAL_INCLUDE_DIR ${OpenAL_INCLUDE_DIRS}) + set(OPENAL_LIBRARY ${OpenAL_LIBRARIES}) + set(OPENAL_DEFINITIONS ${OpenAL_DEFINITIONS}) + """), append=True) + if self.options["librw"].platform == "gl3" and self.options["librw"].gl3_gfxlib == "glfw": + tools.save("Findglfw3.cmake", + textwrap.dedent( + """ + if(NOT TARGET glfw) + message(STATUS "Creating glfw TARGET") + add_library(glfw INTERFACE IMPORTED) + set_target_properties(glfw PROPERTIES + INTERFACE_LINK_LIBRARIES CONAN_PKG::glfw) + endif() + """), append=True) + tools.save("CMakeLists.txt", + textwrap.dedent( + """ + cmake_minimum_required(VERSION 3.0) + project(cmake_wrapper) + + include("{}/conanbuildinfo.cmake") + conan_basic_setup(TARGETS NO_OUTPUT_DIRS) + + add_subdirectory("{}" reVC) + """).format(self.install_folder.replace("\\", "/"), + self.source_folder.replace("\\", "/"))) + except FileNotFoundError: + pass + cmake = CMake(self) + cmake.definitions["REVC_AUDIO"] = self._reVC_audio + cmake.definitions["REVC_WITH_OPUS"] = self.options.with_opus + cmake.definitions["REVC_INSTALL"] = True + cmake.definitions["REVC_VENDORED_LIBRW"] = False + env = {} + if self._os_is_playstation2: + cmake.definitions["CMAKE_TOOLCHAIN_FILE"] = self.deps_user_info["ps2dev-cmaketoolchain"].cmake_toolchain_file + env["PS2SDK"] = self.deps_cpp_info["ps2dev-ps2sdk"].rootpath + + with tools.environment_append(env): + cmake.configure(source_folder=self.build_folder) + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() From 40d3a900a0c8344afb15c4c24c651e0b16dbf0fd Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Thu, 14 Jan 2021 15:05:27 +0100 Subject: [PATCH 10/21] Fix --- .github/workflows/reVC_msvc_amd64.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reVC_msvc_amd64.yml b/.github/workflows/reVC_msvc_amd64.yml index 78b8bc9d..19804d38 100644 --- a/.github/workflows/reVC_msvc_amd64.yml +++ b/.github/workflows/reVC_msvc_amd64.yml @@ -1,4 +1,4 @@ -name: re3 premake amd64 +name: reVC premake amd64 on: pull_request: From 85f93ef135583601f248a0498e06bb2acfd908b2 Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Thu, 14 Jan 2021 15:05:49 +0100 Subject: [PATCH 11/21] Get rid of travis --- .travis.yml | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c124a9f0..00000000 --- a/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -language: cpp -dist: focal -os: linux -jobs: - include: - - env: TARGET=release_linux-amd64-librw_gl3_glfw-oal - os: linux - - env: TARGET=debug_linux-amd64-librw_gl3_glfw-oal - os: linux - - env: TARGET=release_macosx-amd64-librw_gl3_glfw-oal PREMAKE5=premake-5.0.0-alpha15 - compiler: clang - os: osx - osx_image: xcode12u - - env: TARGET=debug_macosx-amd64-librw_gl3_glfw-oal PREMAKE5=premake-5.0.0-alpha15 - compiler: clang - os: osx - osx_image: xcode12u -addons: - apt: - update: true - packages: - - linux-libc-dev - - libopenal-dev - - libglew-dev - - libglfw3-dev - - libsndfile1-dev - - libmpg123-dev - - gcc-8-multilib - - g++-8-multilib - homebrew: - packages: - - libsndfile - - mpg123 - - glew - - glfw - - openal-soft -script: - - mkdir -p "$TRAVIS_BUILD_DIR/build" - - cd "$TRAVIS_BUILD_DIR" - - if [ "$TRAVIS_OS_NAME" = linux ]; then ./premake5Linux --with-librw gmake2; fi - - if [ "$TRAVIS_OS_NAME" = osx ]; then curl -L -o "${PREMAKE5}.zip" "https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/${PREMAKE5}-src.zip" && unzip -q "${PREMAKE5}.zip" && cd "$PREMAKE5" && make -f Bootstrap.mak osx && cd .. && "./${PREMAKE5}/bin/release/premake5" --with-librw gmake2; fi - - cd build - - if [ "$TRAVIS_OS_NAME" = linux ]; then env CC=gcc-8 CXX=g++-8 make config=$TARGET -j4 verbose=1; fi - - if [ "$TRAVIS_OS_NAME" = osx ]; then make config=$TARGET -j4 verbose=1; fi From 57cc70c6af777247579d4ddf96b79bd9c6b7f692 Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Thu, 14 Jan 2021 15:22:02 +0100 Subject: [PATCH 12/21] Update FindX files --- cmake/FindMilesSDK.cmake | 34 +++++++++++++++++++++ cmake/Findopusfile.cmake | 64 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 cmake/FindMilesSDK.cmake create mode 100644 cmake/Findopusfile.cmake diff --git a/cmake/FindMilesSDK.cmake b/cmake/FindMilesSDK.cmake new file mode 100644 index 00000000..57da3a6e --- /dev/null +++ b/cmake/FindMilesSDK.cmake @@ -0,0 +1,34 @@ +# - Find Miles SDK +# Find the Miles SDK header + import library +# +# MilesSDK_INCLUDE_DIR - Where to find mss.h +# MilesSDK_LIBRARIES - List of libraries when using MilesSDK. +# MilesSDK_FOUND - True if Miles SDK found. +# MilesSDK::MilesSDK - Imported library of Miles SDK + +find_path(MilesSDK_INCLUDE_DIR mss.h + PATHS "${MilesSDK_DIR}" + PATH_SUFFIXES include +) + +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(_miles_sdk_libname mss64) +else() + set(_miles_sdk_libname mss32) +endif() + +find_library(MilesSDK_LIBRARIES NAMES ${_miles_sdk_libname} + PATHS "${MilesSDK_DIR}" + PATH_SUFFIXES lib +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(MilesSDK DEFAULT_MSG MilesSDK_LIBRARIES MilesSDK_INCLUDE_DIR) + +if(NOT TARGET MilesSDK::MilesSDK) + add_library(MilesSDK::MilesSDK UNKNOWN IMPORTED) + set_target_properties(MilesSDK::MilesSDK PROPERTIES + IMPORTED_LOCATION "${MilesSDK_LIBRARIES} + INTERFACE_INCLUDE_DIRECTORIES "${MilesSDK_INCLUDE_DIR}" + ) +endif() diff --git a/cmake/Findopusfile.cmake b/cmake/Findopusfile.cmake new file mode 100644 index 00000000..faae7645 --- /dev/null +++ b/cmake/Findopusfile.cmake @@ -0,0 +1,64 @@ +# - Try to find opusfile +# +# Once done this will define +# +# OPUSFILE_FOUND - system has opusfile +# OPUSFILE_INCLUDE_DIRS - the opusfile include directories +# OPUSFILE_LIBRARIES - Link these to use opusfile +# OPUSFILE_CFLAGS - Compile options to use opusfile +# opusfile::opusfile - Imported library of opusfile +# + +# FIXME: opusfile does not ship an official opusfile cmake script, +# rename this file/variables/target when/if it has. + +find_package(PkgConfig QUIET) +if(PKG_CONFIG_FOUND) + pkg_search_module(PKG_OPUSFILE "opusfile") +endif() + +find_path(OPUSFILE_INCLUDE_DIR + NAMES + opusfile.h + PATH_SUFFIXES + opusfile + HINTS + ${PKG_OPUSFILE_INCLUDE_DIRS} + PATHS + /usr/include + /usr/local/include + /opt/local/include + /sw/include + ) + +find_library(OPUSFILE_LIBRARY + NAMES + opusfile + HINTS + ${PKG_OPUSFILE_LIBRARIES} + PATHS + /usr/lib + /usr/local/lib + /opt/local/lib + /sw/lib +) + +set(OPUSFILE_CFLAGS "${PKG_OPUSFILE_CFLAGS_OTHER}" CACHE STRING "CFLAGS of opusfile") + +set(OPUSFILE_INCLUDE_DIRS "${OPUSFILE_INCLUDE_DIR}") +set(OPUSFILE_LIBRARIES "${OPUSFILE_LIBRARY}") + +if (OPUSFILE_INCLUDE_DIRS AND OPUSFILE_LIBRARIES) +set(OPUSFILE_FOUND TRUE) +endif (OPUSFILE_INCLUDE_DIRS AND OPUSFILE_LIBRARIES) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(opusfile DEFAULT_MSG OPUSFILE_INCLUDE_DIRS OPUSFILE_LIBRARIES) + +if(NOT TARGET opusfile::opusfile) + add_library(__opusfile INTERFACE) + target_compile_options(__opusfile INTERFACE ${OPUSFILE_CFLAGS}) + target_include_directories(__opusfile INTERFACE ${OPUSFILE_INCLUDE_DIRS}) + target_link_libraries(__opusfile INTERFACE ${OPUSFILE_LIBRARIES}) + add_library(opusfile::opusfile ALIAS __opusfile) +endif() From 70358d90b4d75a9fb38c962e6355a52c016cbd59 Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Thu, 14 Jan 2021 15:30:33 +0100 Subject: [PATCH 13/21] Backport fix from re3 --- src/audio/oal/stream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/oal/stream.cpp b/src/audio/oal/stream.cpp index 81a78381..4523b07a 100644 --- a/src/audio/oal/stream.cpp +++ b/src/audio/oal/stream.cpp @@ -4,7 +4,7 @@ #include "stream.h" #include "sampman.h" -#ifdef _WIN32 +#if defined _MSC_VER && !defined RE3_NO_AUTOLINK #ifdef AUDIO_OAL_USE_SNDFILE #pragma comment( lib, "libsndfile-1.lib" ) #endif From 42df2033890a7a5512e2cf21a2f5be1472e5d00f Mon Sep 17 00:00:00 2001 From: shfil Date: Thu, 14 Jan 2021 18:26:51 +0100 Subject: [PATCH 14/21] Fix(?) --- .github/workflows/build-cmake-conan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cmake-conan.yml b/.github/workflows/build-cmake-conan.yml index 1f520677..acbad81c 100644 --- a/.github/workflows/build-cmake-conan.yml +++ b/.github/workflows/build-cmake-conan.yml @@ -95,7 +95,7 @@ jobs: conan export re3mss miles-sdk/master@ - name: "Download/build dependencies (conan install)" run: | - conan install ${{ github.workspace }} reVC/master -if build -o reVC:audio=${{ matrix.audio }} -o librw:platform=${{ matrix.platform }} -o librw:gl3_gfxlib=${{ matrix.gl3_gfxlib || 'glfw' }} --build missing -pr:h ./host_profile -pr:b default -s reVC:build_type=RelWithDebInfo -s librw:build_type=RelWithDebInfo + conan install ${{ github.workspace }} reVC/master@ -if build -o reVC:audio=${{ matrix.audio }} -o librw:platform=${{ matrix.platform }} -o librw:gl3_gfxlib=${{ matrix.gl3_gfxlib || 'glfw' }} --build missing -pr:h ./host_profile -pr:b default -s reVC:build_type=RelWithDebInfo -s librw:build_type=RelWithDebInfo env: CONAN_SYSREQUIRES_MODE: enabled - name: "Build reVC (conan build)" From 0b0d286f5c0ce3bdc4cebccb43adb45c76cb3dab Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Thu, 14 Jan 2021 23:15:12 +0300 Subject: [PATCH 15/21] incoming "fuck" commit --- src/control/Script2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/control/Script2.cpp b/src/control/Script2.cpp index a94bf907..f2d9ed9e 100644 --- a/src/control/Script2.cpp +++ b/src/control/Script2.cpp @@ -1299,9 +1299,9 @@ int8 CRunningScript::ProcessCommands400To499(int32 command) CollectParameters(&m_nIp, 2); CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); script_assert(pPed); - CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]); + CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[1]); pPed->bScriptObjectiveCompleted = false; - pPed->SetObjective(OBJECTIVE_DESTROY_OBJECT, pVehicle); + pPed->SetObjective(OBJECTIVE_DESTROY_OBJECT, pObject); return 0; } case COMMAND_SET_CHAR_OBJ_DESTROY_CAR: From c00ebef329423482929fef5fd8a412e97eb17cad Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Thu, 14 Jan 2021 23:15:12 +0300 Subject: [PATCH 16/21] incoming "fuck" commit --- src/control/Script2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/control/Script2.cpp b/src/control/Script2.cpp index 5cac2bfd..9ef24751 100644 --- a/src/control/Script2.cpp +++ b/src/control/Script2.cpp @@ -1349,9 +1349,9 @@ int8 CRunningScript::ProcessCommands400To499(int32 command) CollectParameters(&m_nIp, 2); CPed* pPed = CPools::GetPedPool()->GetAt(GET_INTEGER_PARAM(0)); script_assert(pPed); - CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(GET_INTEGER_PARAM(1)); + CObject* pObject = CPools::GetObjectPool()->GetAt(GET_INTEGER_PARAM(1)); pPed->bScriptObjectiveCompleted = false; - pPed->SetObjective(OBJECTIVE_DESTROY_OBJECT, pVehicle); + pPed->SetObjective(OBJECTIVE_DESTROY_OBJECT, pObject); return 0; } case COMMAND_SET_CHAR_OBJ_DESTROY_CAR: From c7b905c0ec9ce2ff39bf74b5bfc832645a1c6ef1 Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Thu, 14 Jan 2021 22:06:27 +0100 Subject: [PATCH 17/21] More checks before autolinking --- src/audio/sampman_miles.cpp | 2 ++ src/audio/sampman_oal.cpp | 2 +- src/core/Pad.cpp | 2 ++ src/skel/glfw/glfw.cpp | 2 +- src/skel/win/win.cpp | 2 ++ 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp index 2a4286eb..2a9b4a13 100644 --- a/src/audio/sampman_miles.cpp +++ b/src/audio/sampman_miles.cpp @@ -18,7 +18,9 @@ #include "Timer.h" #include "crossplatform.h" +#if defined _MSC_VER && !defined RE3_NO_AUTOLINK #pragma comment( lib, "mss32.lib" ) +#endif // --MIAMI: file done diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp index ce6458e6..27b60e8f 100644 --- a/src/audio/sampman_oal.cpp +++ b/src/audio/sampman_oal.cpp @@ -38,7 +38,7 @@ //TODO: max channels //TODO: loop count -#ifdef _WIN32 +#if defined _MSC_VER && !defined RE3_NO_AUTOLINK #pragma comment( lib, "OpenAL32.lib" ) #endif diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index feda19c6..8d55250a 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -10,6 +10,7 @@ #include "crossplatform.h" #include "platform.h" #ifdef XINPUT +#if defined _MSC_VER && !defined RE3_NO_AUTOLINK #include #if !defined(PSAPI_VERSION) || (PSAPI_VERSION > 1) #pragma comment( lib, "Xinput9_1_0.lib" ) @@ -17,6 +18,7 @@ #pragma comment( lib, "Xinput.lib" ) #endif #endif +#endif #include "Pad.h" #include "ControllerConfig.h" diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp index f039819c..e34edf7a 100644 --- a/src/skel/glfw/glfw.cpp +++ b/src/skel/glfw/glfw.cpp @@ -223,7 +223,7 @@ psGrabScreen(RwCamera *pCamera) /* ***************************************************************************** */ -#ifdef _WIN32 +#if defined _MSC_VER && !defined RE3_NO_AUTOLINK #pragma comment( lib, "Winmm.lib" ) // Needed for time RwUInt32 psTimer(void) diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp index 1fd959f2..85278432 100644 --- a/src/skel/win/win.cpp +++ b/src/skel/win/win.cpp @@ -32,6 +32,7 @@ #define WM_GRAPHNOTIFY WM_USER+13 +#if defined _MSC_VER && !defined RE3_NO_AUTOLINK #ifndef USE_D3D9 #pragma comment( lib, "d3d8.lib" ) #endif @@ -40,6 +41,7 @@ #pragma comment( lib, "dxguid.lib" ) #pragma comment( lib, "strmiids.lib" ) #pragma comment( lib, "dinput8.lib" ) +#endif #if (defined(_MSC_VER)) #include From 1082b138301767a73877af30509712f7c6f5f6ee Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Thu, 14 Jan 2021 22:15:36 +0100 Subject: [PATCH 18/21] RE3_NO_AUTOLINK to CMAKE_NO_AUTOLINK --- src/CMakeLists.txt | 2 +- src/audio/oal/stream.cpp | 2 +- src/audio/sampman_miles.cpp | 2 +- src/audio/sampman_oal.cpp | 2 +- src/core/Pad.cpp | 2 +- src/skel/glfw/glfw.cpp | 2 +- src/skel/win/win.cpp | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dc204d17..ad72eb56 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -36,7 +36,7 @@ target_compile_definitions(${EXECUTABLE} PRIVATE $,DEBUG,NDEBUG> LIBRW - ${PROJECT}_NO_AUTOLINK + CMAKE_NO_AUTOLINK ) if(LIBRW_PLATFORM_D3D9) diff --git a/src/audio/oal/stream.cpp b/src/audio/oal/stream.cpp index 4523b07a..19fa4ec4 100644 --- a/src/audio/oal/stream.cpp +++ b/src/audio/oal/stream.cpp @@ -4,7 +4,7 @@ #include "stream.h" #include "sampman.h" -#if defined _MSC_VER && !defined RE3_NO_AUTOLINK +#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK #ifdef AUDIO_OAL_USE_SNDFILE #pragma comment( lib, "libsndfile-1.lib" ) #endif diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp index 2a9b4a13..43c46fc4 100644 --- a/src/audio/sampman_miles.cpp +++ b/src/audio/sampman_miles.cpp @@ -18,7 +18,7 @@ #include "Timer.h" #include "crossplatform.h" -#if defined _MSC_VER && !defined RE3_NO_AUTOLINK +#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK #pragma comment( lib, "mss32.lib" ) #endif diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp index 27b60e8f..e944b05f 100644 --- a/src/audio/sampman_oal.cpp +++ b/src/audio/sampman_oal.cpp @@ -38,7 +38,7 @@ //TODO: max channels //TODO: loop count -#if defined _MSC_VER && !defined RE3_NO_AUTOLINK +#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK #pragma comment( lib, "OpenAL32.lib" ) #endif diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index 8d55250a..757f0f50 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -10,7 +10,7 @@ #include "crossplatform.h" #include "platform.h" #ifdef XINPUT -#if defined _MSC_VER && !defined RE3_NO_AUTOLINK +#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK #include #if !defined(PSAPI_VERSION) || (PSAPI_VERSION > 1) #pragma comment( lib, "Xinput9_1_0.lib" ) diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp index e34edf7a..3c1dac5d 100644 --- a/src/skel/glfw/glfw.cpp +++ b/src/skel/glfw/glfw.cpp @@ -223,7 +223,7 @@ psGrabScreen(RwCamera *pCamera) /* ***************************************************************************** */ -#if defined _MSC_VER && !defined RE3_NO_AUTOLINK +#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK #pragma comment( lib, "Winmm.lib" ) // Needed for time RwUInt32 psTimer(void) diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp index 85278432..8738a714 100644 --- a/src/skel/win/win.cpp +++ b/src/skel/win/win.cpp @@ -32,7 +32,7 @@ #define WM_GRAPHNOTIFY WM_USER+13 -#if defined _MSC_VER && !defined RE3_NO_AUTOLINK +#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK #ifndef USE_D3D9 #pragma comment( lib, "d3d8.lib" ) #endif From 5acbf9ef59cbfcd5b4a71f6a782b654417db1464 Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Thu, 14 Jan 2021 22:20:40 +0100 Subject: [PATCH 19/21] fix --- src/core/Pad.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index 757f0f50..feda19c6 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -10,7 +10,6 @@ #include "crossplatform.h" #include "platform.h" #ifdef XINPUT -#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK #include #if !defined(PSAPI_VERSION) || (PSAPI_VERSION > 1) #pragma comment( lib, "Xinput9_1_0.lib" ) @@ -18,7 +17,6 @@ #pragma comment( lib, "Xinput.lib" ) #endif #endif -#endif #include "Pad.h" #include "ControllerConfig.h" From 7541fa7cb73870a2a5af3300c35ec9ad081ec369 Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Thu, 14 Jan 2021 22:26:36 +0100 Subject: [PATCH 20/21] Revert extra checks before autolinking --- src/audio/sampman_miles.cpp | 2 -- src/skel/glfw/glfw.cpp | 2 +- src/skel/win/win.cpp | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp index 43c46fc4..2a4286eb 100644 --- a/src/audio/sampman_miles.cpp +++ b/src/audio/sampman_miles.cpp @@ -18,9 +18,7 @@ #include "Timer.h" #include "crossplatform.h" -#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK #pragma comment( lib, "mss32.lib" ) -#endif // --MIAMI: file done diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp index 3c1dac5d..f039819c 100644 --- a/src/skel/glfw/glfw.cpp +++ b/src/skel/glfw/glfw.cpp @@ -223,7 +223,7 @@ psGrabScreen(RwCamera *pCamera) /* ***************************************************************************** */ -#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK +#ifdef _WIN32 #pragma comment( lib, "Winmm.lib" ) // Needed for time RwUInt32 psTimer(void) diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp index 8738a714..1fd959f2 100644 --- a/src/skel/win/win.cpp +++ b/src/skel/win/win.cpp @@ -32,7 +32,6 @@ #define WM_GRAPHNOTIFY WM_USER+13 -#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK #ifndef USE_D3D9 #pragma comment( lib, "d3d8.lib" ) #endif @@ -41,7 +40,6 @@ #pragma comment( lib, "dxguid.lib" ) #pragma comment( lib, "strmiids.lib" ) #pragma comment( lib, "dinput8.lib" ) -#endif #if (defined(_MSC_VER)) #include From 19749effce625c31ab6bb2bf7293fcde94048208 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Fri, 15 Jan 2021 17:54:21 +0200 Subject: [PATCH 21/21] Fix Jumbo Sound reseting when walking --- src/audio/AudioLogic.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index 01b33fa5..b5127fc5 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -4106,6 +4106,7 @@ cAudioManager::SetupJumboFlySound(uint8 emittingVol) m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex); m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSoundIntensity = SOUND_INTENSITY; + m_sQueueSample.m_bReleasingSoundFlag = false; m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_bReverbFlag = true; m_sQueueSample.m_bRequireReflection = false; // todo port fix to re3