From c0c8278c635258fc72636db0bbf59d7c99c4ba61 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Wed, 20 May 2020 20:45:07 +0300 Subject: [PATCH 01/13] fixed ped comment --- src/audio/sampman_miles.cpp | 4 ++++ src/audio/sampman_oal.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp index a2a206a4..ad2c512f 100644 --- a/src/audio/sampman_miles.cpp +++ b/src/audio/sampman_miles.cpp @@ -1469,6 +1469,10 @@ cSampleManager::_GetPedCommentSlot(uint32 nComment) for ( int32 i = 0; i < _TODOCONST(3); i++ ) { slot = nCurrentPedSlot - i - 1; +#ifdef FIX_BUGS + if (slot < 0) + slot += ARRAY_SIZE(nPedSlotSfx); +#endif if ( nComment == nPedSlotSfx[slot] ) return slot; } diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp index 30efd7f5..f16afbba 100644 --- a/src/audio/sampman_oal.cpp +++ b/src/audio/sampman_oal.cpp @@ -800,6 +800,10 @@ cSampleManager::_GetPedCommentSlot(uint32 nComment) for (int32 i = 0; i < _TODOCONST(3); i++) { slot = nCurrentPedSlot - i - 1; +#ifdef FIX_BUGS + if (slot < 0) + slot += ARRAY_SIZE(nPedSlotSfx); +#endif if (nComment == nPedSlotSfx[slot]) return slot; } From b7c1784dd274b88955763c5a3fa2acb4d202e934 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Wed, 20 May 2020 23:25:01 +0300 Subject: [PATCH 02/13] script fix --- src/control/Script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/control/Script.cpp b/src/control/Script.cpp index e8aa3266..8ade2c9b 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -8222,7 +8222,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command) car->SetHeading(DEGTORAD(*(float*)&ScriptParams[3])); CTheScripts::ClearSpaceForMissionEntity(pos, car); car->SetStatus(STATUS_ABANDONED); - car->bIsLocked = true; + car->bIsLocked = false; car->bIsCarParkVehicle = true; CCarCtrl::JoinCarWithRoadSystem(car); car->AutoPilot.m_nCarMission = MISSION_NONE; From 3405cfffb76b1e0b7511e2fc394c0121f4aa43a8 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Wed, 20 May 2020 23:52:17 +0300 Subject: [PATCH 03/13] fixed dumb --- src/audio/sampman_miles.cpp | 4 ++-- src/audio/sampman_oal.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp index ad2c512f..d625ac35 100644 --- a/src/audio/sampman_miles.cpp +++ b/src/audio/sampman_miles.cpp @@ -1445,7 +1445,7 @@ cSampleManager::IsSampleBankLoaded(uint8 nBank) bool cSampleManager::IsPedCommentLoaded(uint32 nComment) { - uint8 slot; + int8 slot; for ( int32 i = 0; i < _TODOCONST(3); i++ ) { @@ -1464,7 +1464,7 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment) int32 cSampleManager::_GetPedCommentSlot(uint32 nComment) { - uint8 slot; + int8 slot; for ( int32 i = 0; i < _TODOCONST(3); i++ ) { diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp index f16afbba..f6f3a393 100644 --- a/src/audio/sampman_oal.cpp +++ b/src/audio/sampman_oal.cpp @@ -775,7 +775,7 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment) { ASSERT( nComment < TOTAL_AUDIO_SAMPLES ); - uint8 slot; + int8 slot; for ( int32 i = 0; i < _TODOCONST(3); i++ ) { @@ -795,7 +795,7 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment) int32 cSampleManager::_GetPedCommentSlot(uint32 nComment) { - uint8 slot; + int8 slot; for (int32 i = 0; i < _TODOCONST(3); i++) { From 73ff01e35b2a0d14f06c1ac8121f59f73da7d994 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Thu, 21 May 2020 00:18:13 +0300 Subject: [PATCH 04/13] script fix --- src/control/Script.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 8ade2c9b..68b396f3 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -8696,6 +8696,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) CTimer::Resume(); pMissionScript->m_bIsMissionScript = true; pMissionScript->m_bMissionFlag = true; + CTheScripts::bAlreadyRunningAMissionScript = true; return 0; } case COMMAND_SET_OBJECT_DRAW_LAST: From 21071edbfe5794393d1e64322e4689f50ddc1bc3 Mon Sep 17 00:00:00 2001 From: aap Date: Fri, 22 May 2020 14:34:44 +0200 Subject: [PATCH 05/13] fixes for CPhysical and friends --- src/core/Stats.h | 18 +++--- src/core/SurfaceTable.cpp | 128 +++++++++++++++++++------------------- src/core/SurfaceTable.h | 43 +------------ src/core/Timer.h | 2 +- src/entities/Physical.cpp | 97 +++++++++++++++-------------- src/entities/Physical.h | 7 +-- src/objects/Object.h | 9 +-- src/render/Timecycle.h | 2 +- src/vehicles/Boat.cpp | 2 +- 9 files changed, 132 insertions(+), 176 deletions(-) diff --git a/src/core/Stats.h b/src/core/Stats.h index 4445ecf4..ae3c0cb4 100644 --- a/src/core/Stats.h +++ b/src/core/Stats.h @@ -10,7 +10,7 @@ public: TOTAL_HIGHEST_SCORES = 16 }; static int32 DaysPassed; - static int32 HeadsPopped; + static int32 HeadsPopped; static int32 CommercialPassed; static int32 IndustrialPassed; static int32 SuburbanPassed; @@ -52,14 +52,14 @@ public: static int32 LongestFlightInDodo; static int32 TimeTakenDefuseMission; static int32 TotalNumberKillFrenzies; - static int32 TotalNumberMissions; - static int32 RoundsFiredByPlayer; - static int32 KgsOfExplosivesUsed; - static int32 InstantHitsFiredByPlayer; - static int32 InstantHitsHitByPlayer; - static int32 BestTimeBombDefusal; - static int32 mmRain; - static int32 CarsCrushed; + static int32 TotalNumberMissions; + static int32 RoundsFiredByPlayer; + static int32 KgsOfExplosivesUsed; + static int32 InstantHitsFiredByPlayer; + static int32 InstantHitsHitByPlayer; + static int32 BestTimeBombDefusal; + static int32 mmRain; + static int32 CarsCrushed; static int32 FastestTimes[TOTAL_FASTEST_TIMES]; static int32 HighestScores[TOTAL_HIGHEST_SCORES]; diff --git a/src/core/SurfaceTable.cpp b/src/core/SurfaceTable.cpp index 08a84cfd..e4f9c0cd 100644 --- a/src/core/SurfaceTable.cpp +++ b/src/core/SurfaceTable.cpp @@ -56,40 +56,40 @@ int CSurfaceTable::GetAdhesionGroup(uint8 surfaceType) { switch(surfaceType){ - case SURFACE_0: return ADHESIVE_ROAD; - case SURFACE_1: return ADHESIVE_ROAD; - case SURFACE_2: return ADHESIVE_LOOSE; - case SURFACE_3: return ADHESIVE_LOOSE; - case SURFACE_4: return ADHESIVE_HARD; - case SURFACE_5: return ADHESIVE_ROAD; - case SURFACE_6: return ADHESIVE_HARD; - case SURFACE_7: return ADHESIVE_HARD; - case SURFACE_8: return ADHESIVE_HARD; - case SURFACE_9: return ADHESIVE_HARD; - case SURFACE_10: return ADHESIVE_HARD; - case SURFACE_11: return ADHESIVE_HARD; - case SURFACE_12: return ADHESIVE_HARD; - case SURFACE_13: return ADHESIVE_HARD; - case SURFACE_14: return ADHESIVE_HARD; - case SURFACE_15: return ADHESIVE_HARD; - case SURFACE_16: return ADHESIVE_HARD; - case SURFACE_17: return ADHESIVE_RUBBER; - case SURFACE_18: return ADHESIVE_LOOSE; - case SURFACE_19: return ADHESIVE_WET; - case SURFACE_20: return ADHESIVE_ROAD; - case SURFACE_21: return ADHESIVE_ROAD; - case SURFACE_22: return ADHESIVE_ROAD; - case SURFACE_23: return ADHESIVE_RUBBER; - case SURFACE_24: return ADHESIVE_HARD; - case SURFACE_25: return ADHESIVE_LOOSE; - case SURFACE_26: return ADHESIVE_LOOSE; - case SURFACE_27: return ADHESIVE_HARD; - case SURFACE_28: return ADHESIVE_HARD; - case SURFACE_29: return ADHESIVE_RUBBER; - case SURFACE_30: return ADHESIVE_LOOSE; - case SURFACE_31: return ADHESIVE_HARD; - case SURFACE_32: return ADHESIVE_HARD; - default: return ADHESIVE_ROAD; + case SURFACE_DEFAULT: return ADHESIVE_ROAD; + case SURFACE_TARMAC: return ADHESIVE_ROAD; + case SURFACE_GRASS: return ADHESIVE_LOOSE; + case SURFACE_DIRT: return ADHESIVE_LOOSE; + case SURFACE_DIRTTRACK: return ADHESIVE_HARD; + case SURFACE_PAVEMENT: return ADHESIVE_ROAD; + case SURFACE_METAL6: return ADHESIVE_HARD; + case SURFACE_GLASS: return ADHESIVE_HARD; + case SURFACE_SCAFFOLD: return ADHESIVE_HARD; + case SURFACE_METAL_DOOR: return ADHESIVE_HARD; + case SURFACE_BILLBOARD: return ADHESIVE_HARD; + case SURFACE_STEEL: return ADHESIVE_HARD; + case SURFACE_METAL_POLE: return ADHESIVE_HARD; + case SURFACE_STREET_LIGHT: return ADHESIVE_HARD; + case SURFACE_METAL14: return ADHESIVE_HARD; + case SURFACE_METAL15: return ADHESIVE_HARD; + case SURFACE_METAL_FENCE: return ADHESIVE_HARD; + case SURFACE_FLESH: return ADHESIVE_RUBBER; + case SURFACE_SAND: return ADHESIVE_LOOSE; + case SURFACE_PUDDLE: return ADHESIVE_WET; + case SURFACE_WOOD: return ADHESIVE_ROAD; + case SURFACE_WOOD_BOX: return ADHESIVE_ROAD; + case SURFACE_WOOD_PLANK: return ADHESIVE_ROAD; + case SURFACE_TIRE: return ADHESIVE_RUBBER; + case SURFACE_HARD24: return ADHESIVE_HARD; + case SURFACE_HEDGE: return ADHESIVE_LOOSE; + case SURFACE_STONE: return ADHESIVE_LOOSE; + case SURFACE_METAL27: return ADHESIVE_HARD; + case SURFACE_METAL28: return ADHESIVE_HARD; + case SURFACE_RUBBER29: return ADHESIVE_RUBBER; + case SURFACE_LOOSE30: return ADHESIVE_LOOSE; + case SURFACE_BOLLARD: return ADHESIVE_HARD; + case SURFACE_GATE: return ADHESIVE_HARD; + default: return ADHESIVE_ROAD; } } @@ -97,38 +97,38 @@ float CSurfaceTable::GetWetMultiplier(uint8 surfaceType) { switch(surfaceType){ - case SURFACE_0: - case SURFACE_1: - case SURFACE_4: - case SURFACE_5: - case SURFACE_8: - case SURFACE_20: - case SURFACE_21: - case SURFACE_22: - case SURFACE_25: - case SURFACE_30: - case SURFACE_31: + case SURFACE_DEFAULT: + case SURFACE_TARMAC: + case SURFACE_DIRTTRACK: + case SURFACE_PAVEMENT: + case SURFACE_SCAFFOLD: + case SURFACE_WOOD: + case SURFACE_WOOD_BOX: + case SURFACE_WOOD_PLANK: + case SURFACE_HEDGE: + case SURFACE_LOOSE30: + case SURFACE_BOLLARD: return 1.0f - CWeather::WetRoads*0.25f; - case SURFACE_2: - case SURFACE_6: - case SURFACE_7: - case SURFACE_9: - case SURFACE_10: - case SURFACE_11: - case SURFACE_12: - case SURFACE_13: - case SURFACE_14: - case SURFACE_15: - case SURFACE_16: - case SURFACE_17: - case SURFACE_23: - case SURFACE_24: - case SURFACE_26: - case SURFACE_27: - case SURFACE_28: - case SURFACE_29: - case SURFACE_32: + case SURFACE_GRASS: + case SURFACE_METAL6: + case SURFACE_GLASS: + case SURFACE_METAL_DOOR: + case SURFACE_BILLBOARD: + case SURFACE_STEEL: + case SURFACE_METAL_POLE: + case SURFACE_STREET_LIGHT: + case SURFACE_METAL14: + case SURFACE_METAL15: + case SURFACE_METAL_FENCE: + case SURFACE_FLESH: + case SURFACE_TIRE: + case SURFACE_HARD24: + case SURFACE_STONE: + case SURFACE_METAL27: + case SURFACE_METAL28: + case SURFACE_RUBBER29: + case SURFACE_GATE: return 1.0f - CWeather::WetRoads*0.4f; default: diff --git a/src/core/SurfaceTable.h b/src/core/SurfaceTable.h index 12246dce..768521bf 100644 --- a/src/core/SurfaceTable.h +++ b/src/core/SurfaceTable.h @@ -1,47 +1,6 @@ #pragma once - -enum -{ - SURFACE_0, - SURFACE_1, - SURFACE_2, - SURFACE_3, - SURFACE_4, - SURFACE_5, - SURFACE_6, - SURFACE_7, - SURFACE_8, - SURFACE_9, - SURFACE_10, - SURFACE_11, - SURFACE_12, - SURFACE_13, - SURFACE_14, - SURFACE_15, - SURFACE_16, - SURFACE_17, - SURFACE_18, - SURFACE_19, - SURFACE_20, - SURFACE_21, - SURFACE_22, - SURFACE_23, - SURFACE_24, - SURFACE_25, - SURFACE_26, - SURFACE_27, - SURFACE_28, - SURFACE_29, - SURFACE_30, - SURFACE_31, - SURFACE_32, - - NUMSURFACETYPES -}; - -// From nick -// TODO: check and use this +// TODO: check this enum eSurfaceType { SURFACE_DEFAULT, diff --git a/src/core/Timer.h b/src/core/Timer.h index 004cda4d..e7b6fec8 100644 --- a/src/core/Timer.h +++ b/src/core/Timer.h @@ -58,7 +58,7 @@ public: friend bool GenericSave(int file); #ifdef FIX_BUGS - static float GetDefaultTimeStep(void) { return 5.0f / 3.0f; } + static float GetDefaultTimeStep(void) { return 50.0f / 30.0f; } static float GetTimeStepFix(void) { return GetTimeStep() / GetDefaultTimeStep(); } #endif }; diff --git a/src/entities/Physical.cpp b/src/entities/Physical.cpp index 31f8fcbc..f9f8ae7e 100644 --- a/src/entities/Physical.cpp +++ b/src/entities/Physical.cpp @@ -45,9 +45,9 @@ CPhysical::CPhysical(void) bUsesCollision = true; m_audioEntityId = -5; - unk1 = 100.0f; + m_phys_unused1 = 100.0f; m_vecCentreOfMass = CVector(0.0f, 0.0f, 0.0f); - field_EC = 0; + m_phys_unused2 = 0; bIsHeavy = false; bAffectedByGravity = true; @@ -527,26 +527,26 @@ CPhysical::ApplyCollision(CPhysical *B, CColPoint &colpoint, float &impulseA, fl bool ispedcontactA = false; bool ispedcontactB = false; - float timestepA; + float massFactorA; if(B->bPedPhysics){ - timestepA = 10.0f; + massFactorA = 10.0f; if(B->IsPed() && ((CPed*)B)->m_pCurrentPhysSurface == A) ispedcontactA = true; }else - timestepA = A->bIsHeavy ? 2.0f : 1.0f; + massFactorA = A->bIsHeavy ? 2.0f : 1.0f; - float timestepB; + float massFactorB; if(A->bPedPhysics){ if(A->IsPed() && ((CPed*)A)->IsPlayer() && B->IsVehicle() && (B->GetStatus() == STATUS_ABANDONED || B->GetStatus() == STATUS_WRECKED || A->bHasHitWall)) - timestepB = 2200.0f / B->m_fMass; + massFactorB = 2200.0f / B->m_fMass; else - timestepB = 10.0f; + massFactorB = 10.0f; if(A->IsPed() && ((CPed*)A)->m_pCurrentPhysSurface == B) ispedcontactB = true; }else - timestepB = B->bIsHeavy ? 2.0f : 1.0f; + massFactorB = B->bIsHeavy ? 2.0f : 1.0f; float speedA, speedB; if(B->IsStatic()){ @@ -646,14 +646,17 @@ CPhysical::ApplyCollision(CPhysical *B, CColPoint &colpoint, float &impulseA, fl // positive if B is moving towards A // not interested in how much B moves into A apparently? // only interested in cases where A collided into B - speedB = Max(0.0f, DotProduct(B->m_vecMoveSpeed, colpoint.normal)); + speedB = DotProduct(B->m_vecMoveSpeed, colpoint.normal); + float speedSum = Max(0.0f, DotProduct(B->m_vecMoveSpeed, colpoint.normal)); // A has moved into B - if(speedA < speedB){ - if(!A->bHasHitWall) - speedB -= (speedA - speedB) * (A->m_fElasticity+B->m_fElasticity)/2.0f; - impulseA = (speedB-speedA) * A->m_fMass * timestepA; + if(speedA < speedSum){ + if(A->bHasHitWall) + eA = speedSum; + else + eA = speedSum - (speedA - speedSum) * (A->m_fElasticity+B->m_fElasticity)/2.0f; + impulseA = (eA-speedA) * A->m_fMass * massFactorA; if(!A->bInfiniteMass) - A->ApplyMoveForce(colpoint.normal*(impulseA/timestepA)); + A->ApplyMoveForce(colpoint.normal*(impulseA/massFactorA)); return true; } }else if(A->bPedPhysics){ @@ -661,9 +664,9 @@ CPhysical::ApplyCollision(CPhysical *B, CColPoint &colpoint, float &impulseA, fl speedA = DotProduct(A->m_vecMoveSpeed, colpoint.normal); speedB = DotProduct(B->GetSpeed(pointposB), colpoint.normal); - float a = A->m_fMass*timestepA; - float b = B->GetMassTime(pointposB, colpoint.normal, timestepB); - float speedSum = (b*speedB + a*speedA)/(a + b); + float mA = A->m_fMass*massFactorA; + float mB = B->GetMassTweak(pointposB, colpoint.normal, massFactorB); + float speedSum = (mB*speedB + mA*speedA)/(mA + mB); if(speedA < speedSum){ if(A->bHasHitWall) eA = speedSum; @@ -673,10 +676,10 @@ CPhysical::ApplyCollision(CPhysical *B, CColPoint &colpoint, float &impulseA, fl eB = speedSum; else eB = speedSum - (speedB - speedSum) * (A->m_fElasticity+B->m_fElasticity)/2.0f; - impulseA = (eA - speedA) * a; - impulseB = -(eB - speedB) * b; - CVector fA = colpoint.normal*(impulseA/timestepA); - CVector fB = colpoint.normal*(-impulseB/timestepB); + impulseA = (eA - speedA) * mA; + impulseB = -(eB - speedB) * mB; + CVector fA = colpoint.normal*(impulseA/massFactorA); + CVector fB = colpoint.normal*(-impulseB/massFactorB); if(!A->bInfiniteMass){ if(fA.z < 0.0f) fA.z = 0.0f; if(ispedcontactB){ @@ -696,9 +699,9 @@ CPhysical::ApplyCollision(CPhysical *B, CColPoint &colpoint, float &impulseA, fl speedA = DotProduct(A->GetSpeed(pointposA), colpoint.normal); speedB = DotProduct(B->m_vecMoveSpeed, colpoint.normal); - float a = A->GetMassTime(pointposA, colpoint.normal, timestepA); - float b = B->m_fMass*timestepB; - float speedSum = (b*speedB + a*speedA)/(a + b); + float mA = A->GetMassTweak(pointposA, colpoint.normal, massFactorA); + float mB = B->m_fMass*massFactorB; + float speedSum = (mB*speedB + mA*speedA)/(mA + mB); if(speedA < speedSum){ if(A->bHasHitWall) eA = speedSum; @@ -708,10 +711,10 @@ CPhysical::ApplyCollision(CPhysical *B, CColPoint &colpoint, float &impulseA, fl eB = speedSum; else eB = speedSum - (speedB - speedSum) * (A->m_fElasticity+B->m_fElasticity)/2.0f; - impulseA = (eA - speedA) * a; - impulseB = -(eB - speedB) * b; - CVector fA = colpoint.normal*(impulseA/timestepA); - CVector fB = colpoint.normal*(-impulseB/timestepB); + impulseA = (eA - speedA) * mA; + impulseB = -(eB - speedB) * mB; + CVector fA = colpoint.normal*(impulseA/massFactorA); + CVector fB = colpoint.normal*(-impulseB/massFactorB); if(!A->bInfiniteMass && !ispedcontactA){ if(fA.z < 0.0f) fA.z = 0.0f; A->ApplyMoveForce(fA); @@ -736,9 +739,9 @@ CPhysical::ApplyCollision(CPhysical *B, CColPoint &colpoint, float &impulseA, fl CVector pointposB = colpoint.point - B->GetPosition(); speedA = DotProduct(A->GetSpeed(pointposA), colpoint.normal); speedB = DotProduct(B->GetSpeed(pointposB), colpoint.normal); - float a = A->GetMassTime(pointposA, colpoint.normal, timestepA); - float b = B->GetMassTime(pointposB, colpoint.normal, timestepB); - float speedSum = (b*speedB + a*speedA)/(a + b); + float mA = A->GetMassTweak(pointposA, colpoint.normal, massFactorA); + float mB = B->GetMassTweak(pointposB, colpoint.normal, massFactorB); + float speedSum = (mB*speedB + mA*speedA)/(mA + mB); if(speedA < speedSum){ if(A->bHasHitWall) eA = speedSum; @@ -748,10 +751,10 @@ CPhysical::ApplyCollision(CPhysical *B, CColPoint &colpoint, float &impulseA, fl eB = speedSum; else eB = speedSum - (speedB - speedSum) * (A->m_fElasticity+B->m_fElasticity)/2.0f; - impulseA = (eA - speedA) * a; - impulseB = -(eB - speedB) * b; - CVector fA = colpoint.normal*(impulseA/timestepA); - CVector fB = colpoint.normal*(-impulseB/timestepB); + impulseA = (eA - speedA) * mA; + impulseB = -(eB - speedB) * mB; + CVector fA = colpoint.normal*(impulseA/massFactorA); + CVector fB = colpoint.normal*(-impulseB/massFactorB); if(A->IsVehicle() && !A->bHasHitWall){ fA.x *= 1.4f; fA.y *= 1.4f; @@ -767,7 +770,7 @@ CPhysical::ApplyCollision(CPhysical *B, CColPoint &colpoint, float &impulseA, fl if(B->IsVehicle() && !B->bHasHitWall){ fB.x *= 1.4f; fB.y *= 1.4f; - if(colpoint.normal.z < 0.7f) + if(-colpoint.normal.z < 0.7f) fB.z *= 0.3f; if(B->GetStatus() == STATUS_PLAYER) pointposB *= 0.8f; @@ -813,7 +816,7 @@ CPhysical::ApplyCollisionAlt(CEntity *B, CColPoint &colpoint, float &impulse, CV speed = GetSpeed(pointpos); normalSpeed = DotProduct(speed, colpoint.normal); if(normalSpeed < 0.0f){ - float minspeed = 0.0104f * CTimer::GetTimeStep(); + float minspeed = 1.3f*GRAVITY * CTimer::GetTimeStep(); #ifdef GTA3_1_1_PATCH if ((IsObject() || IsVehicle() && (GetUp().z < -0.3f || ((CVehicle*)this)->IsBike() && (GetStatus() == STATUS_ABANDONED || GetStatus() == STATUS_WRECKED))) && #else @@ -1015,7 +1018,7 @@ CPhysical::ApplyFriction(float adhesiveLimit, CColPoint &colpoint) ApplyFrictionTurnForce(frictionDir*fImpulse, pointpos); if(fOtherSpeed > 0.1f && - colpoint.surfaceB != SURFACE_2 && colpoint.surfaceB != SURFACE_4 && + colpoint.surfaceB != SURFACE_GRASS && colpoint.surfaceB != SURFACE_DIRTTRACK && CSurfaceTable::GetAdhesionGroup(colpoint.surfaceA) == ADHESIVE_HARD){ CVector v = frictionDir * fOtherSpeed * 0.25f; for(int i = 0; i < 4; i++) @@ -1064,7 +1067,7 @@ CPhysical::ProcessShiftSectorList(CPtrList *lists) canshift = true; else canshift = A->IsPed() && - B->IsObject() && B->bInfiniteMass && !Bobj->bHasBeenDamaged; + B->IsObject() && B->bIsStatic && !Bobj->bHasBeenDamaged; if(B == A || B->m_scanCode == CWorld::GetCurrentScanCode() || !B->bUsesCollision || @@ -1084,7 +1087,6 @@ CPhysical::ProcessShiftSectorList(CPtrList *lists) B->GetUp().z < 0.66f && IsStreetLight(B->GetModelIndex())) skipShift = true; -// TODO: maybe flip some ifs here else if(A->IsObject() && B->IsVehicle()){ CObject *Aobj = (CObject*)A; if(Aobj->ObjectCreatedBy != TEMP_OBJECT && @@ -1699,16 +1701,16 @@ CPhysical::ProcessCollisionSectorList(CPtrList *lists) } if(B->IsPed() && A->IsVehicle() && - (!Bped->IsPlayer() || B->bHasHitWall && A->m_vecMoveSpeed.MagnitudeSqr() > 0.0025f)) + (!Bped->IsPlayer() || B->bHasHitWall && A->m_vecMoveSpeed.MagnitudeSqr() > SQR(0.05f))) Bped->KillPedWithCar((CVehicle*)A, maxImpulseB); else if(B->GetModelIndex() == MI_TRAIN && A->IsPed() && (!Aped->IsPlayer() || A->bHasHitWall)) Aped->KillPedWithCar((CVehicle*)B, maxImpulseA*2.0f); else if(B->IsObject() && B->bUsesCollision && A->IsVehicle()){ + // BUG? not impulseA? if(Bobj->m_nCollisionDamageEffect && maxImpulseB > 20.0f) Bobj->ObjectDamage(maxImpulseB); }else if(A->IsObject() && A->bUsesCollision && B->IsVehicle()){ - // BUG? not impulseA? if(Aobj->m_nCollisionDamageEffect && maxImpulseB > 20.0f) Aobj->ObjectDamage(maxImpulseB); } @@ -1774,7 +1776,7 @@ CPhysical::ProcessShift(void) m_bIsVehicleBeingShifted = true; CEntryInfoNode *node; - bool hasshifted = false; // whatever that means... + bool hasshifted = false; for(node = m_entryInfoList.first; node; node = node->next) hasshifted |= ProcessShiftSectorList(node->sector->m_lists); m_bIsVehicleBeingShifted = false; @@ -1831,7 +1833,7 @@ CPhysical::ProcessCollision(void) int8 n = 1; // The number of steps we divide the time step into float step = 0.0f; // divided time step - float distSq = GetDistanceSq(); + float distSq = m_vecMoveSpeed.MagnitudeSqr() * sq(CTimer::GetTimeStep()); if(IsPed() && (distSq >= sq(0.2f) || ped->IsPlayer())){ if(ped->IsPlayer()) @@ -1920,8 +1922,11 @@ CPhysical::ProcessCollision(void) bSkipLineCol = false; if(!m_vecMoveSpeed.IsZero() || !m_vecTurnSpeed.IsZero() || +#ifdef GTA_TRAIN bHitByTrain || - GetStatus() == STATUS_PLAYER || IsPed() && ped->IsPlayer()){ +#endif + GetStatus() == STATUS_PLAYER || + IsPed() && ped->IsPlayer()){ if(IsVehicle()) ((CVehicle*)this)->bVehicleColProcessed = true; if(CheckCollision()){ diff --git a/src/entities/Physical.h b/src/entities/Physical.h index c84686ed..f8921a5c 100644 --- a/src/entities/Physical.h +++ b/src/entities/Physical.h @@ -18,7 +18,7 @@ public: // The not properly indented fields haven't been checked properly yet int32 m_audioEntityId; - float unk1; + float m_phys_unused1; CTreadable *m_treadable[2]; // car and ped uint32 m_nLastTimeCollided; CVector m_vecMoveSpeed; // velocity @@ -37,7 +37,7 @@ public: CEntryInfoList m_entryInfoList; CPtrNode *m_movingListNode; - char field_EC; + int8 m_phys_unused2; uint8 m_nStaticFrames; uint8 m_nCollisionRecords; bool m_bIsVehicleBeingShifted; @@ -86,7 +86,6 @@ public: void RemoveRefsToEntity(CEntity *ent); static void PlacePhysicalRelativeToOtherPhysical(CPhysical *other, CPhysical *phys, CVector localPos); - float GetDistanceSq(void) { return m_vecMoveSpeed.MagnitudeSqr() * sq(CTimer::GetTimeStep()); } // get speed of point p relative to entity center CVector GetSpeed(const CVector &r); CVector GetSpeed(void) { return GetSpeed(CVector(0.0f, 0.0f, 0.0f)); } @@ -94,7 +93,7 @@ public: return 1.0f / (CrossProduct(pos, dir).MagnitudeSqr()/m_fTurnMass + 1.0f/m_fMass); } - float GetMassTime(const CVector &pos, const CVector &dir, float t) { + float GetMassTweak(const CVector &pos, const CVector &dir, float t) { return 1.0f / (CrossProduct(pos, dir).MagnitudeSqr()/(m_fTurnMass*t) + 1.0f/(m_fMass*t)); } diff --git a/src/objects/Object.h b/src/objects/Object.h index 79589dc9..c9a1bba8 100644 --- a/src/objects/Object.h +++ b/src/objects/Object.h @@ -55,14 +55,7 @@ public: uint8 m_nCollisionDamageEffect; uint8 m_nSpecialCollisionResponseCases; bool m_bCameraToAvoidThisObject; - - // this batch is unused - int8 field_17B; - int8 field_17C; - int8 field_17D; - int8 field_17E; - int8 field_17F; - + uint32 m_obj_unused1; uint32 m_nEndOfLifeTime; int16 m_nRefModelIndex; CEntity *m_pCurSurface; diff --git a/src/render/Timecycle.h b/src/render/Timecycle.h index 28a0b7dd..9af4df49 100644 --- a/src/render/Timecycle.h +++ b/src/render/Timecycle.h @@ -122,7 +122,7 @@ public: static float GetSpriteSize(void) { return m_fCurrentSpriteSize; } static int GetShadowStrength(void) { return m_nCurrentShadowStrength; } static int GetLightShadowStrength(void) { return m_nCurrentLightShadowStrength; } - static int GetLightOnGroundBrightness(void) { return m_fCurrentLightsOnGroundBrightness; } + static float GetLightOnGroundBrightness(void) { return m_fCurrentLightsOnGroundBrightness; } static float GetFarClip(void) { return m_fCurrentFarClip; } static float GetFogStart(void) { return m_fCurrentFogStart; } diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp index 72fca542..0ed7876a 100644 --- a/src/vehicles/Boat.cpp +++ b/src/vehicles/Boat.cpp @@ -79,7 +79,7 @@ CBoat::CBoat(int mi, uint8 owner) : CVehicle(owner) bIsInWater = true; - unk1 = 0.0f; + m_phys_unused1 = 0.0f; m_bIsAnchored = true; m_fOrientation = INVALID_ORIENTATION; bTouchingWater = true; From e858314a9f1c0adb0a8c2ec2dd1536e111932650 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Fri, 22 May 2020 18:00:18 +0300 Subject: [PATCH 06/13] OpenAL configs --- .appveyor.yml | 2 ++ premake5.lua | 24 +++++++++++++++++++----- src/audio/oal/channel.cpp | 4 ++-- src/audio/oal/channel.h | 1 - src/audio/oal/oal_utils.cpp | 1 + src/audio/oal/oal_utils.h | 1 - src/audio/oal/stream.cpp | 8 ++++---- src/audio/oal/stream.h | 1 - src/core/config.h | 5 ----- 9 files changed, 28 insertions(+), 19 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 20adee80..05604e2c 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -6,6 +6,8 @@ configuration: platform: - win-x86-librw_d3d9-mss - win-x86-librw_gl3_glfw-mss +- win-x86-librw_d3d9-oal +- win-x86-librw_gl3_glfw-oal environment: APPVEYOR_SAVE_CACHE_ON_ERROR: true GLEW_VER: "2.1.0" diff --git a/premake5.lua b/premake5.lua index c8494884..79b8db64 100644 --- a/premake5.lua +++ b/premake5.lua @@ -51,6 +51,9 @@ workspace "re3" "win-x86-RW33_d3d8-mss", "win-x86-librw_d3d9-mss", "win-x86-librw_gl3_glfw-mss", + "win-x86-RW33_d3d8-oal", + "win-x86-librw_d3d9-oal", + "win-x86-librw_gl3_glfw-oal", } filter { "system:linux" } @@ -183,11 +186,23 @@ project "re3" includedirs { "src/extras" } includedirs { "eax" } - includedirs { "milessdk/include" } includedirs { "eax" } - - libdirs { "milessdk/lib" } + filter "platforms:*mss" + defines { "AUIOD_MSS" } + includedirs { "milessdk/include" } + libdirs { "milessdk/lib" } + + filter "platforms:*oal" + defines { "AUIOD_OAL" } + includedirs { "openal-soft/include" } + includedirs { "libsndfile/include" } + includedirs { "mpg123/include" } + libdirs { "openal-soft/libs/Win32" } + libdirs { "libsndfile/lib" } + libdirs { "mpg123/lib" } + + filter {} if(os.getenv("GTA_III_RE_DIR")) then setpaths("$(GTA_III_RE_DIR)/", "%(cfg.buildtarget.name)", "") end @@ -199,8 +214,7 @@ project "re3" characterset ("MBCS") targetextension ".exe" - filter "platforms:linux*" - defines { "OPENAL" } + filter "platforms:linux*oal" links { "openal", "mpg123", "sndfile", "pthread" } filter "platforms:*RW33*" diff --git a/src/audio/oal/channel.cpp b/src/audio/oal/channel.cpp index 6fe1d856..731e3581 100644 --- a/src/audio/oal/channel.cpp +++ b/src/audio/oal/channel.cpp @@ -1,7 +1,7 @@ -#include "channel.h" +#include "common.h" #ifdef AUDIO_OAL -#include "common.h" +#include "channel.h" #include "sampman.h" #ifndef _WIN32 diff --git a/src/audio/oal/channel.h b/src/audio/oal/channel.h index 4dd09ca1..0c86bdc6 100644 --- a/src/audio/oal/channel.h +++ b/src/audio/oal/channel.h @@ -1,5 +1,4 @@ #pragma once -#include "common.h" #ifdef AUDIO_OAL #include "oal/oal_utils.h" diff --git a/src/audio/oal/oal_utils.cpp b/src/audio/oal/oal_utils.cpp index 4119672f..e16de572 100644 --- a/src/audio/oal/oal_utils.cpp +++ b/src/audio/oal/oal_utils.cpp @@ -1,3 +1,4 @@ +#include "common.h" #include "oal_utils.h" #ifdef AUDIO_OAL diff --git a/src/audio/oal/oal_utils.h b/src/audio/oal/oal_utils.h index af45a944..b89ccf36 100644 --- a/src/audio/oal/oal_utils.h +++ b/src/audio/oal/oal_utils.h @@ -1,5 +1,4 @@ #pragma once -#include "common.h" #ifdef AUDIO_OAL #include "eax.h" diff --git a/src/audio/oal/stream.cpp b/src/audio/oal/stream.cpp index 5a9c7d7d..34518f54 100644 --- a/src/audio/oal/stream.cpp +++ b/src/audio/oal/stream.cpp @@ -1,11 +1,9 @@ -#include "stream.h" +#include "common.h" #ifdef AUDIO_OAL -#include "common.h" +#include "stream.h" #include "sampman.h" -#include -#include #ifdef _WIN32 typedef long ssize_t; #pragma comment( lib, "libsndfile-1.lib" ) @@ -13,6 +11,8 @@ typedef long ssize_t; #else #include "crossplatform.h" #endif +#include +#include class CSndFile : public IDecoder { diff --git a/src/audio/oal/stream.h b/src/audio/oal/stream.h index f1e5f458..456c080a 100644 --- a/src/audio/oal/stream.h +++ b/src/audio/oal/stream.h @@ -1,5 +1,4 @@ #pragma once -#include "common.h" #ifdef AUDIO_OAL #include diff --git a/src/core/config.h b/src/core/config.h index 40882128..f43067d7 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -196,11 +196,6 @@ enum Config { #define USE_TXD_CDIMAGE // generate and load textures from txd.img #define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number //#define USE_TEXTURE_POOL -#ifdef _WIN32 -#define AUDIO_MSS -#else -#define AUDIO_OAL -#endif // Particle //#define PC_PARTICLE From 38a09c6e9b4a631aae699a8f3de6c0df33c021e5 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Fri, 22 May 2020 21:00:59 +0300 Subject: [PATCH 07/13] Fix linux build --- .appveyor.yml | 2 -- eax/eax.h | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 05604e2c..20adee80 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -6,8 +6,6 @@ configuration: platform: - win-x86-librw_d3d9-mss - win-x86-librw_gl3_glfw-mss -- win-x86-librw_d3d9-oal -- win-x86-librw_gl3_glfw-oal environment: APPVEYOR_SAVE_CACHE_ON_ERROR: true GLEW_VER: "2.1.0" diff --git a/eax/eax.h b/eax/eax.h index 0e2201db..503090d2 100644 --- a/eax/eax.h +++ b/eax/eax.h @@ -12,7 +12,7 @@ extern "C" { #endif // __cplusplus -#ifndef OPENAL +#ifndef AUDIO_OAL #include /* @@ -49,7 +49,7 @@ extern "C" { typedef void (CDECL *LPGETCURRENTVERSION)(LPDWORD major, LPDWORD minor); -#else // OPENAL +#else // AUDIO_OAL #ifndef _WIN32 #include #include From efe52dbbbc504acdf87573f23653d4a8ec295c46 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Fri, 22 May 2020 21:14:38 +0300 Subject: [PATCH 08/13] I am an idiot --- eax/eax.h | 4 ---- premake5.lua | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/eax/eax.h b/eax/eax.h index 503090d2..b2210936 100644 --- a/eax/eax.h +++ b/eax/eax.h @@ -50,12 +50,8 @@ extern "C" { #else // AUDIO_OAL -#ifndef _WIN32 #include #include -#else - #include -#endif #ifndef GUID_DEFINED #define GUID_DEFINED diff --git a/premake5.lua b/premake5.lua index 79b8db64..75b1b979 100644 --- a/premake5.lua +++ b/premake5.lua @@ -189,12 +189,12 @@ project "re3" includedirs { "eax" } filter "platforms:*mss" - defines { "AUIOD_MSS" } + defines { "AUDIO_MSS" } includedirs { "milessdk/include" } libdirs { "milessdk/lib" } filter "platforms:*oal" - defines { "AUIOD_OAL" } + defines { "AUDIO_OAL" } includedirs { "openal-soft/include" } includedirs { "libsndfile/include" } includedirs { "mpg123/include" } From a9f332f2d96b6a8b6f83b5da5c1c320d2ff4eab2 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Fri, 22 May 2020 21:26:31 +0300 Subject: [PATCH 09/13] Possibly fix travis --- src/audio/oal/stream.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/audio/oal/stream.cpp b/src/audio/oal/stream.cpp index 34518f54..c70cd2c1 100644 --- a/src/audio/oal/stream.cpp +++ b/src/audio/oal/stream.cpp @@ -8,11 +8,12 @@ typedef long ssize_t; #pragma comment( lib, "libsndfile-1.lib" ) #pragma comment( lib, "libmpg123.lib" ) -#else -#include "crossplatform.h" #endif #include #include +#ifndef _WIN32 +#include "crossplatform.h" +#endif class CSndFile : public IDecoder { From c993e99e0086aae50357c8ffa180de54396ede92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Fri, 22 May 2020 22:49:54 +0300 Subject: [PATCH 10/13] Fix linux build --- premake5.lua | 14 ++++++++------ src/audio/oal/stream.cpp | 5 ++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/premake5.lua b/premake5.lua index 75b1b979..fd6da6ac 100644 --- a/premake5.lua +++ b/premake5.lua @@ -195,12 +195,6 @@ project "re3" filter "platforms:*oal" defines { "AUDIO_OAL" } - includedirs { "openal-soft/include" } - includedirs { "libsndfile/include" } - includedirs { "mpg123/include" } - libdirs { "openal-soft/libs/Win32" } - libdirs { "libsndfile/lib" } - libdirs { "mpg123/lib" } filter {} if(os.getenv("GTA_III_RE_DIR")) then @@ -214,6 +208,14 @@ project "re3" characterset ("MBCS") targetextension ".exe" + filter "platforms:win*oal" + includedirs { "openal-soft/include" } + includedirs { "libsndfile/include" } + includedirs { "mpg123/include" } + libdirs { "openal-soft/libs/Win32" } + libdirs { "libsndfile/lib" } + libdirs { "mpg123/lib" } + filter "platforms:linux*oal" links { "openal", "mpg123", "sndfile", "pthread" } diff --git a/src/audio/oal/stream.cpp b/src/audio/oal/stream.cpp index c70cd2c1..34518f54 100644 --- a/src/audio/oal/stream.cpp +++ b/src/audio/oal/stream.cpp @@ -8,12 +8,11 @@ typedef long ssize_t; #pragma comment( lib, "libsndfile-1.lib" ) #pragma comment( lib, "libmpg123.lib" ) +#else +#include "crossplatform.h" #endif #include #include -#ifndef _WIN32 -#include "crossplatform.h" -#endif class CSndFile : public IDecoder { From e18eb0ce012282362203fc93e644914af1eaf51d Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sat, 23 May 2020 00:50:15 +0300 Subject: [PATCH 11/13] script fix --- src/control/Script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 68b396f3..082beda9 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -4333,7 +4333,7 @@ int8 CRunningScript::ProcessCommands400To499(int32 command) } case COMMAND_SET_CAR_HEAVY: { - CollectParameters(&m_nIp, 1); + CollectParameters(&m_nIp, 2); CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[0]); assert(pVehicle); pVehicle->bIsHeavy = (ScriptParams[1] != 0); From e2d3ef449c0385acf36ba77ce2c9da62b88ea3a3 Mon Sep 17 00:00:00 2001 From: aap Date: Sat, 23 May 2020 11:34:40 +0200 Subject: [PATCH 12/13] skeleton typos --- src/core/main.cpp | 8 ++++---- src/skel/glfw/glfw.cpp | 8 ++++---- src/skel/platform.h | 2 +- src/skel/skeleton.cpp | 14 +++++++------- src/skel/skeleton.h | 18 +++++++++--------- src/skel/win/win.cpp | 8 ++++---- src/vehicles/Vehicle.h | 3 --- 7 files changed, 29 insertions(+), 32 deletions(-) diff --git a/src/core/main.cpp b/src/core/main.cpp index 1ea8dc7f..acdf6f4e 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -328,7 +328,7 @@ PluginAttach(void) static RwBool Initialise3D(void *param) { - if (RsRwInitialise(param)) + if (RsRwInitialize(param)) { #ifdef DEBUGMENU DebugMenuInit(); @@ -1146,10 +1146,10 @@ AppEventHandler(RsEvent event, void *param) { switch( event ) { - case rsINITIALISE: + case rsINITIALIZE: { CGame::InitialiseOnceBeforeRW(); - return RsInitialise() ? rsEVENTPROCESSED : rsEVENTERROR; + return RsInitialize() ? rsEVENTPROCESSED : rsEVENTERROR; } case rsCAMERASIZE: @@ -1161,7 +1161,7 @@ AppEventHandler(RsEvent event, void *param) return rsEVENTPROCESSED; } - case rsRWINITIALISE: + case rsRWINITIALIZE: { return Initialise3D(param) ? rsEVENTPROCESSED : rsEVENTERROR; } diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp index fc23e900..21115585 100644 --- a/src/skel/glfw/glfw.cpp +++ b/src/skel/glfw/glfw.cpp @@ -274,7 +274,7 @@ psNativeTextureSupport(void) ***************************************************************************** */ RwBool -psInitialise(void) +psInitialize(void) { PsGlobal.lastMousePos.x = PsGlobal.lastMousePos.y = 0.0f; @@ -789,7 +789,7 @@ RwBool _psSetVideoMode(RwInt32 subSystem, RwInt32 videoMode) useDefault = TRUE; - if ( RsEventHandler(rsRWINITIALISE, &openParams) == rsEVENTERROR ) + if ( RsEventHandler(rsRWINITIALIZE, &openParams) == rsEVENTERROR ) return FALSE; RwInitialised = TRUE; @@ -1312,7 +1312,7 @@ main(int argc, char *argv[]) * Initialize the platform independent data. * This will in turn initialize the platform specific data... */ - if( RsEventHandler(rsINITIALISE, nil) == rsEVENTERROR ) + if( RsEventHandler(rsINITIALIZE, nil) == rsEVENTERROR ) { return FALSE; } @@ -1355,7 +1355,7 @@ main(int argc, char *argv[]) /* * Initialize the 3D (RenderWare) components of the app... */ - if( rsEVENTERROR == RsEventHandler(rsRWINITIALISE, &openParams) ) + if( rsEVENTERROR == RsEventHandler(rsRWINITIALIZE, &openParams) ) { RsEventHandler(rsTERMINATE, nil); diff --git a/src/skel/platform.h b/src/skel/platform.h index 65e20673..cbb1be28 100644 --- a/src/skel/platform.h +++ b/src/skel/platform.h @@ -15,7 +15,7 @@ extern RwUInt32 psTimer(void); extern double psTimer(void); #endif -extern RwBool psInitialise(void); +extern RwBool psInitialize(void); extern void psTerminate(void); extern void psCameraShowRaster(RwCamera *camera); diff --git a/src/skel/skeleton.cpp b/src/skel/skeleton.cpp index 5191eda7..8191107e 100644 --- a/src/skel/skeleton.cpp +++ b/src/skel/skeleton.cpp @@ -246,8 +246,8 @@ RsEventHandler(RsEvent event, void *param) result = (rsEVENTPROCESSED); break; - case rsRWINITIALISE: - result = (RsRwInitialise(param) ? + case rsRWINITIALIZE: + result = (RsRwInitialize(param) ? rsEVENTPROCESSED : rsEVENTERROR); break; @@ -256,9 +256,9 @@ RsEventHandler(RsEvent event, void *param) result = (rsEVENTPROCESSED); break; - case rsINITIALISE: + case rsINITIALIZE: result = - (RsInitialise()? rsEVENTPROCESSED : rsEVENTERROR); + (RsInitialize()? rsEVENTPROCESSED : rsEVENTERROR); break; default: @@ -294,7 +294,7 @@ RsRwTerminate(void) ***************************************************************************** */ RwBool -RsRwInitialise(void *displayID) +RsRwInitialize(void *displayID) { RwEngineOpenParams openParams; @@ -383,7 +383,7 @@ RsTerminate(void) ***************************************************************************** */ RwBool -RsInitialise(void) +RsInitialize(void) { /* * Initialize Platform independent data... @@ -415,7 +415,7 @@ RsInitialise(void) RsGlobal.pad.inputEventHandler = nil; RsGlobal.pad.used = FALSE; - result = psInitialise(); + result = psInitialize(); return result; } diff --git a/src/skel/skeleton.h b/src/skel/skeleton.h index 8303bd9a..b5ea5abf 100644 --- a/src/skel/skeleton.h +++ b/src/skel/skeleton.h @@ -61,10 +61,10 @@ enum RsEvent _rs_18, _rs_19, _rs_20, - rsRWINITIALISE, + rsRWINITIALIZE, rsRWTERMINATE, rsSELECTDEVICE, - rsINITIALISE, + rsINITIALIZE, rsTERMINATE, rsIDLE, rsFRONTENDIDLE, @@ -241,19 +241,19 @@ extern RsEventStatus RsEventHandler(RsEvent event, void *param); extern RsEventStatus RsKeyboardEventHandler(RsEvent event, void *param); extern RsEventStatus RsPadEventHandler(RsEvent event, void *param); -extern RwBool -RsInitialise(void); +extern RwBool +RsInitialize(void); -extern RwBool +extern RwBool RsRegisterImageLoader(void); -extern RwBool -RsRwInitialise(void *param); +extern RwBool +RsRwInitialize(void *param); -extern RwBool +extern RwBool RsSelectDevice(void); -extern RwBool +extern RwBool RsInputDeviceAttach(RsInputDeviceType inputDevice, RsInputEventHandler inputEventHandler); diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp index 9a885818..83860f04 100644 --- a/src/skel/win/win.cpp +++ b/src/skel/win/win.cpp @@ -584,7 +584,7 @@ void _psPrintCpuInfo() ***************************************************************************** */ RwBool -psInitialise(void) +psInitialize(void) { PsGlobal.lastMousePos.x = PsGlobal.lastMousePos.y = 0.0f; @@ -1525,7 +1525,7 @@ RwBool _psSetVideoMode(RwInt32 subSystem, RwInt32 videoMode) useDefault = TRUE; - if ( RsEventHandler(rsRWINITIALISE, PSGLOBAL(window)) == rsEVENTERROR ) + if ( RsEventHandler(rsRWINITIALIZE, PSGLOBAL(window)) == rsEVENTERROR ) return FALSE; RwInitialised = TRUE; @@ -1896,7 +1896,7 @@ WinMain(HINSTANCE instance, * Initialize the platform independent data. * This will in turn initialize the platform specific data... */ - if( RsEventHandler(rsINITIALISE, nil) == rsEVENTERROR ) + if( RsEventHandler(rsINITIALIZE, nil) == rsEVENTERROR ) { return FALSE; } @@ -1962,7 +1962,7 @@ WinMain(HINSTANCE instance, /* * Initialize the 3D (RenderWare) components of the app... */ - if( rsEVENTERROR == RsEventHandler(rsRWINITIALISE, PSGLOBAL(window)) ) + if( rsEVENTERROR == RsEventHandler(rsRWINITIALIZE, PSGLOBAL(window)) ) { DestroyWindow(PSGLOBAL(window)); diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h index f7205c7d..06bdf714 100644 --- a/src/vehicles/Vehicle.h +++ b/src/vehicles/Vehicle.h @@ -109,9 +109,6 @@ enum eFlightModel FLIGHT_MODEL_SEAPLANE }; -// Or Weapon.h? -void FireOneInstantHitRound(CVector *shotSource, CVector *shotTarget, int32 damage); - class CVehicle : public CPhysical { public: From 100e59886d18db04efe5455cc35c056b69c5d1d3 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sat, 23 May 2020 16:14:39 +0300 Subject: [PATCH 13/13] cranes fix --- src/vehicles/Cranes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vehicles/Cranes.cpp b/src/vehicles/Cranes.cpp index 9c8f9fda..936a4510 100644 --- a/src/vehicles/Cranes.cpp +++ b/src/vehicles/Cranes.cpp @@ -184,7 +184,7 @@ bool CCranes::IsThisCarPickedUp(float X, float Y, CVehicle* pVehicle) result = true; } } - return true; + return result; } void CCranes::UpdateCranes(void)