diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/collision/ColLine.h | 4 | ||||
-rw-r--r-- | src/collision/ColPoint.h | 4 | ||||
-rw-r--r-- | src/collision/ColSphere.h | 5 | ||||
-rw-r--r-- | src/collision/ColTriangle.h | 1 | ||||
-rw-r--r-- | src/collision/Collision.cpp | 18 | ||||
-rw-r--r-- | src/control/Garages.cpp | 2 | ||||
-rw-r--r-- | src/control/Replay.cpp | 8 | ||||
-rw-r--r-- | src/control/Script.cpp | 4 | ||||
-rw-r--r-- | src/control/Script10.cpp | 4 | ||||
-rw-r--r-- | src/control/Script3.cpp | 1 | ||||
-rw-r--r-- | src/control/Script6.cpp | 2 | ||||
-rw-r--r-- | src/control/Script8.cpp | 3 | ||||
-rw-r--r-- | src/control/Script9.cpp | 4 | ||||
-rw-r--r-- | src/core/World.cpp | 6 | ||||
-rw-r--r-- | src/core/re3.cpp | 2 | ||||
-rw-r--r-- | src/math/Vector.cpp | 15 | ||||
-rw-r--r-- | src/math/Vector.h | 9 | ||||
-rw-r--r-- | src/math/VuVector.h | 4 | ||||
-rw-r--r-- | src/modelinfo/VehicleModelInfo.cpp | 20 | ||||
-rw-r--r-- | src/modelinfo/VehicleModelInfo.h | 12 | ||||
-rw-r--r-- | src/vehicles/Ferry.h | 13 |
22 files changed, 111 insertions, 32 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f3d51b06..8325938c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -102,6 +102,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang if (NOT LIBRW_PLATFORM_PS2) target_compile_options(${EXECUTABLE} PRIVATE + -fpermissive # for CVECTORHACK + -Wno-address-of-temporary # for CVECTORHACK -Wextra -Wdouble-promotion -Wpedantic diff --git a/src/collision/ColLine.h b/src/collision/ColLine.h index 21587a06..a2cb9a0b 100644 --- a/src/collision/ColLine.h +++ b/src/collision/ColLine.h @@ -4,9 +4,9 @@ struct CColLine { // NB: this has to be compatible with two CVuVectors CVector p0; - int pad0; +// int pad0; CVector p1; - int pad1; +// int pad1; CColLine(void) { }; CColLine(const CVector &p0, const CVector &p1) { this->p0 = p0; this->p1 = p1; }; diff --git a/src/collision/ColPoint.h b/src/collision/ColPoint.h index a15b2345..f978720d 100644 --- a/src/collision/ColPoint.h +++ b/src/collision/ColPoint.h @@ -3,10 +3,10 @@ struct CColPoint { CVector point; - int pad1; + int pad1; // this is stupid // the surface normal on the surface of point CVector normal; - int pad2; + //int pad2; uint8 surfaceA; uint8 pieceA; uint8 surfaceB; diff --git a/src/collision/ColSphere.h b/src/collision/ColSphere.h index f86b282a..3f18d8c0 100644 --- a/src/collision/ColSphere.h +++ b/src/collision/ColSphere.h @@ -2,10 +2,11 @@ #include "SurfaceTable.h" -struct CSphere +// TODO(LCS): maybe this was in a union with CVuVector? or is the alignment manual? +struct TYPEALIGN(16) CSphere { // NB: this has to be compatible with a CVuVector - CVector center; + RwV3d center; float radius; void Set(float radius, const CVector ¢er) { this->center = center; this->radius = radius; } }; diff --git a/src/collision/ColTriangle.h b/src/collision/ColTriangle.h index a2580c58..5ce543b5 100644 --- a/src/collision/ColTriangle.h +++ b/src/collision/ColTriangle.h @@ -62,6 +62,7 @@ struct CColTrianglePlane } #endif #else + // TODO(LCS): LCS actually uses CompressedVector too CVector normal; float dist; uint8 dir; diff --git a/src/collision/Collision.cpp b/src/collision/Collision.cpp index bead5183..82681645 100644 --- a/src/collision/Collision.cpp +++ b/src/collision/Collision.cpp @@ -24,6 +24,10 @@ #include "Camera.h" #include "ColStore.h" +// gotta figure out how they handled CSphere exactly +// so using this to remind me to look into it again. +#define CVECTORHACK(rwv3d) CVector(rwv3d) + #ifdef VU_COLLISION #include "VuCollision.h" @@ -391,7 +395,7 @@ CCollision::TestLineSphere(const CColLine &line, const CColSphere &sph) // The length of the tangent would be this: Sqrt((c-p0)^2 - r^2). // Negative if p0 is inside the sphere! This breaks the test! float tansq = 4.0f * linesq * - (sph.center.MagnitudeSqr() - 2.0f*DotProduct(sph.center, line.p0) + line.p0.MagnitudeSqr() - sph.radius*sph.radius); + (CVECTORHACK(sph.center).MagnitudeSqr() - 2.0f*DotProduct(sph.center, line.p0) + line.p0.MagnitudeSqr() - sph.radius*sph.radius); float diffsq = projline*projline - tansq; // if diffsq < 0 that means the line is a passant, so no intersection if(diffsq < 0.0f) @@ -470,9 +474,9 @@ CCollision::TestSphereTriangle(const CColSphere &sphere, case 2: // closest to an edge // looks like original game as DistToLine manually inlined - if(!insideAB) dist = DistToLine(&va, &vb, &sphere.center); - else if(!insideAC) dist = DistToLine(&va, &vc, &sphere.center); - else if(!insideBC) dist = DistToLine(&vb, &vc, &sphere.center); + if(!insideAB) dist = DistToLine(&va, &vb, &CVECTORHACK(sphere.center)); + else if(!insideAC) dist = DistToLine(&va, &vc, &CVECTORHACK(sphere.center)); + else if(!insideBC) dist = DistToLine(&vb, &vc, &CVECTORHACK(sphere.center)); else assert(0); break; case 3: @@ -1279,9 +1283,9 @@ CCollision::ProcessSphereTriangle(const CColSphere &sphere, case 2: // closest to an edge // looks like original game as DistToLine manually inlined - if(!insideAB) dist = DistToLine(&va, &vb, &sphere.center, p); - else if(!insideAC) dist = DistToLine(&va, &vc, &sphere.center, p); - else if(!insideBC) dist = DistToLine(&vb, &vc, &sphere.center, p); + if(!insideAB) dist = DistToLine(&va, &vb, &CVECTORHACK(sphere.center), p); + else if(!insideAC) dist = DistToLine(&va, &vc, &CVECTORHACK(sphere.center), p); + else if(!insideBC) dist = DistToLine(&vb, &vc, &CVECTORHACK(sphere.center), p); else assert(0); break; case 3: diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp index 0b1f8e19..ede252a7 100644 --- a/src/control/Garages.cpp +++ b/src/control/Garages.cpp @@ -1357,7 +1357,7 @@ bool CGarage::IsAnyOtherCarTouchingGarage(CVehicle * pException) uint32 i = CPools::GetVehiclePool()->GetSize(); while (i--) { CVehicle* pVehicle = CPools::GetVehiclePool()->GetSlot(i); - if (!pVehicle || pVehicle == pException) + if (!pVehicle || pVehicle == pException || pVehicle->GetStatus() == STATUS_WRECKED) continue; if (!IsEntityTouching3D(pVehicle)) continue; diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp index 1fb4b9b0..5f481234 100644 --- a/src/control/Replay.cpp +++ b/src/control/Replay.cpp @@ -521,7 +521,7 @@ void CReplay::StoreDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState state->aFunctionCallbackID[i] = 0; } }else{ - state->aAnimId[i] = NUM_ANIMS; + state->aAnimId[i] = NUM_STD_ANIMS; state->aCurTime[i] = 0; state->aSpeed[i] = 85; state->aFunctionCallbackID[i] = 0; @@ -548,7 +548,7 @@ void CReplay::StoreDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationState } } else { - state->aAnimId2[i] = NUM_ANIMS; + state->aAnimId2[i] = NUM_STD_ANIMS; state->aCurTime2[i] = 0; state->aSpeed2[i] = 85; state->aFunctionCallbackID2[i] = 0; @@ -659,7 +659,7 @@ void CReplay::RetrieveDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationSt for (int i = 0; ((assoc = RpAnimBlendClumpGetMainPartialAssociation_N(ped->GetClump(), i))); i++) assoc->SetBlend(0.0f, -1.0f); for (int i = 0; i < NUM_MAIN_ANIMS_IN_REPLAY; i++) { - if (state->aAnimId[i] == NUM_ANIMS) + if (state->aAnimId[i] == NUM_STD_ANIMS) continue; CAnimBlendAssociation* anim = CAnimManager::AddAnimation(ped->GetClump(), state->aAnimId[i] > 3 ? (AssocGroupId)state->aGroupId[i] : ped->m_animGroup, @@ -677,7 +677,7 @@ void CReplay::RetrieveDetailedPedAnimation(CPed *ped, CStoredDetailedAnimationSt anim->SetDeleteCallback(FindCBFunction(callback & 0x7F), ped); } for (int i = 0; i < NUM_PARTIAL_ANIMS_IN_REPLAY; i++) { - if (state->aAnimId2[i] == NUM_ANIMS) + if (state->aAnimId2[i] == NUM_STD_ANIMS) continue; CAnimBlendAssociation* anim = CAnimManager::AddAnimation(ped->GetClump(), state->aAnimId2[i] > 3 ? (AssocGroupId)state->aGroupId2[i] : ped->m_animGroup, diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 1b1b9045..d12bbb40 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -1608,7 +1608,7 @@ const tScriptCommandData commands[] = { REGISTER_COMMAND(COMMAND_SET_NAVIGATION_ARROW, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ), OUTPUT_ARGUMENTS(), false, -1, ""), REGISTER_COMMAND(COMMAND_CLEAR_NAVIGATION_ARROW, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""), REGISTER_COMMAND(COMMAND_CALL, INPUT_ARGUMENTS(ARGTYPE_FUNCTION, ), OUTPUT_ARGUMENTS(), false, -1, ""), - REGISTER_COMMAND(COMMAND_CALLNOT, INPUT_ARGUMENTS(), OUTPUT_ARGUMENTS(), false, -1, ""), + REGISTER_COMMAND(COMMAND_CALLNOT, INPUT_ARGUMENTS(ARGTYPE_FUNCTION, ), OUTPUT_ARGUMENTS(), false, -1, ""), REGISTER_COMMAND(COMMAND_IS_CAR_AUTOMOBILE, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), true, -1, ""), REGISTER_COMMAND(COMMAND_IS_CAR_BIKE, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), true, -1, ""), REGISTER_COMMAND(COMMAND_IS_CAR_PLANE, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), true, -1, ""), @@ -1649,7 +1649,7 @@ const tScriptCommandData commands[] = { REGISTER_COMMAND(COMMAND_SET_DRAW_HUD, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""), REGISTER_COMMAND(COMMAND_GET_RANDOM_CHAR_IN_AREA_NO_CHECKS, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ), OUTPUT_ARGUMENTS(), false, -1, ""), REGISTER_COMMAND(COMMAND_GET_RANDOM_CAR_IN_AREA_NO_CHECKS_NO_SAVE, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ARGTYPE_FLOAT, ), OUTPUT_ARGUMENTS(), false, -1, ""), - REGISTER_COMMAND(COMMAND_STORE_CAR_COLLIDED_WITH_NO_SAVE, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""), + REGISTER_COMMAND(COMMAND_STORE_CAR_COLLIDED_WITH_NO_SAVE, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(ARGTYPE_INT, ), false, -1, ""), REGISTER_COMMAND(COMMAND_DISABLE_FERRY_PATH, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""), REGISTER_COMMAND(COMMAND_ENABLE_FERRY_PATH, INPUT_ARGUMENTS(ARGTYPE_INT, ), OUTPUT_ARGUMENTS(), false, -1, ""), REGISTER_COMMAND(COMMAND_GET_CLOSEST_DOCKED_FERRY, INPUT_ARGUMENTS(ARGTYPE_FLOAT, ARGTYPE_FLOAT, ), OUTPUT_ARGUMENTS(ARGTYPE_INT, ), false, -1, ""), diff --git a/src/control/Script10.cpp b/src/control/Script10.cpp index fef33848..6514ebe5 100644 --- a/src/control/Script10.cpp +++ b/src/control/Script10.cpp @@ -223,8 +223,8 @@ int8 CRunningScript::ProcessCommands1600To1699(int32 command) CObject* pObject = CPools::GetObjectPool()->GetAt(GET_INTEGER_PARAM(0)); script_assert(pObject); SET_FLOAT_PARAM(1, LimitAngleOnCircle(RADTODEG(Asin(pObject->GetForward().z)))); - SET_FLOAT_PARAM(2, LimitAngleOnCircle(RADTODEG(CGeneral::GetATanOfXY(pObject->GetForward().x, pObject->GetForward().y)))); - SET_FLOAT_PARAM(0, LimitAngleOnCircle(RADTODEG(CGeneral::GetATanOfXY(pObject->GetUp().z, pObject->GetRight().z)))); + SET_FLOAT_PARAM(2, LimitAngleOnCircle(RADTODEG(Atan2(-pObject->GetForward().x, pObject->GetForward().y)))); + SET_FLOAT_PARAM(0, LimitAngleOnCircle(RADTODEG(Atan2(-pObject->GetRight().z, pObject->GetUp().z)))); StoreParameters(&m_nIp, 3); return 0; } diff --git a/src/control/Script3.cpp b/src/control/Script3.cpp index 7acfdfc8..f05c21eb 100644 --- a/src/control/Script3.cpp +++ b/src/control/Script3.cpp @@ -1714,6 +1714,7 @@ int8 CRunningScript::ProcessCommands700To799(int32 command) pBoat->AutoPilot.m_nCarMission = MISSION_GOTOCOORDS_ASTHECROWSWIMS; pBoat->AutoPilot.m_vecDestinationCoors = pos; pBoat->SetStatus(STATUS_PHYSICS); + pBoat->bEngineOn = true; pBoat->AutoPilot.m_nCruiseSpeed = Max(1, pBoat->AutoPilot.m_nCruiseSpeed); pBoat->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds(); return 0; diff --git a/src/control/Script6.cpp b/src/control/Script6.cpp index acc84c31..0e1256fd 100644 --- a/src/control/Script6.cpp +++ b/src/control/Script6.cpp @@ -632,7 +632,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) if (GET_INTEGER_PARAM(2) < 0) pPed->WarpPedIntoCarAsPassenger(pVehicle, GET_INTEGER_PARAM(2)); else { - script_assert(GET_INTEGER_PARAM(1) >= 0 && GET_INTEGER_PARAM(1) < ARRAY_SIZE(pVehicle->pPassengers)); + script_assert(GET_INTEGER_PARAM(2) >= 0 && GET_INTEGER_PARAM(2) < ARRAY_SIZE(pVehicle->pPassengers)); pPed->WarpPedIntoCarAsPassenger(pVehicle, GET_INTEGER_PARAM(2)); } return 0; diff --git a/src/control/Script8.cpp b/src/control/Script8.cpp index 53e39b68..8a1612fb 100644 --- a/src/control/Script8.cpp +++ b/src/control/Script8.cpp @@ -437,7 +437,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command) } case COMMAND_DOT_PRODUCT_3D: { - CollectParameters(&m_nIp, 4); + CollectParameters(&m_nIp, 6); float X1 = GET_FLOAT_PARAM(0); float Y1 = GET_FLOAT_PARAM(1); float Z1 = GET_FLOAT_PARAM(2); @@ -788,6 +788,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command) } } } + StoreParameters(&m_nIp, 1); return 0; } default: diff --git a/src/control/Script9.cpp b/src/control/Script9.cpp index 020221c4..3a68e239 100644 --- a/src/control/Script9.cpp +++ b/src/control/Script9.cpp @@ -431,8 +431,8 @@ int8 CRunningScript::ProcessCommands1500To1599(int32 command) CVehicle* pVehicle = CPools::GetVehiclePool()->GetAt(GET_INTEGER_PARAM(0)); script_assert(pVehicle); SET_FLOAT_PARAM(1, LimitAngleOnCircle(RADTODEG(Asin(pVehicle->GetForward().z)))); - SET_FLOAT_PARAM(2, LimitAngleOnCircle(RADTODEG(CGeneral::GetATanOfXY(pVehicle->GetForward().x, pVehicle->GetForward().y)))); - SET_FLOAT_PARAM(0, LimitAngleOnCircle(RADTODEG(CGeneral::GetATanOfXY(pVehicle->GetUp().z, pVehicle->GetRight().z)))); + SET_FLOAT_PARAM(2, LimitAngleOnCircle(RADTODEG(Atan2(-pVehicle->GetForward().x, pVehicle->GetForward().y)))); + SET_FLOAT_PARAM(0, LimitAngleOnCircle(RADTODEG(Atan2(-pVehicle->GetRight().z, pVehicle->GetUp().z)))); StoreParameters(&m_nIp, 3); return 0; } diff --git a/src/core/World.cpp b/src/core/World.cpp index eccbcd89..da1c58b2 100644 --- a/src/core/World.cpp +++ b/src/core/World.cpp @@ -2218,8 +2218,12 @@ CWorld::UseDetonator(CEntity *pEntity) { int32 i = CPools::GetVehiclePool()->GetSize(); while(--i >= 0) { +#ifdef FIX_BUGS + CVehicle* pVehicle = CPools::GetVehiclePool()->GetSlot(i); +#else CAutomobile *pVehicle = (CAutomobile *)CPools::GetVehiclePool()->GetSlot(i); - if(pVehicle && !pVehicle->m_vehType && pVehicle->m_bombType == CARBOMB_REMOTE && +#endif + if(pVehicle && pVehicle->m_bombType == CARBOMB_REMOTE && pVehicle->m_pBombRigger == pEntity) { pVehicle->m_bombType = CARBOMB_NONE; pVehicle->m_nBombTimer = 500; diff --git a/src/core/re3.cpp b/src/core/re3.cpp index 4a2dfe00..773d3765 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -703,7 +703,7 @@ void CTweakVars::Add(CTweakVar *var) TweakVarsListSize = 0; } if(TweakVarsListSize > 63) - TweakVarsList = (CTweakVar**) realloc(TweakVarsList, (TweakVarsListSize + 1) * sizeof(*var)); + TweakVarsList = (CTweakVar**) realloc(TweakVarsList, (TweakVarsListSize + 1) * sizeof(CTweakVar*)); TweakVarsList[TweakVarsListSize++] = var; // TweakVarsList.push_back(var); diff --git a/src/math/Vector.cpp b/src/math/Vector.cpp index ee76e555..e29d4335 100644 --- a/src/math/Vector.cpp +++ b/src/math/Vector.cpp @@ -44,3 +44,18 @@ operator*(const CMatrix &mat, const CVector &vec) mat.ry * vec.x + mat.fy * vec.y + mat.uy * vec.z + mat.py, mat.rz * vec.x + mat.fz * vec.y + mat.uz * vec.z + mat.pz); } + +void +RwV3dTransformPoints(CVector * pointsOut, const CVector * pointsIn, RwInt32 numPoints, const RwMatrix * matrix) +{ + while(numPoints--){ + float x = pointsIn->x*matrix->right.x + pointsIn->y*matrix->up.x + pointsIn->z*matrix->at.x + matrix->pos.x; + float y = pointsIn->x*matrix->right.y + pointsIn->y*matrix->up.y + pointsIn->z*matrix->at.y + matrix->pos.y; + float z = pointsIn->x*matrix->right.z + pointsIn->y*matrix->up.z + pointsIn->z*matrix->at.z + matrix->pos.z; + pointsOut->x = x; + pointsOut->y = y; + pointsOut->z = z; + pointsOut++; + pointsIn++; + } +} diff --git a/src/math/Vector.h b/src/math/Vector.h index 02128454..87895806 100644 --- a/src/math/Vector.h +++ b/src/math/Vector.h @@ -1,8 +1,12 @@ #pragma once +// TODO(LCS): this should have 16 byte alignment but VS doesn't like passing aligned values by value +// need a solution for this eventually if we ever want to load original assets class CVector : public RwV3d { public: + float w; + CVector(void) {} CVector(float x, float y, float z) { @@ -126,4 +130,7 @@ class CMatrix; CVector Multiply3x3(const CMatrix &mat, const CVector &vec); CVector Multiply3x3(const CVector &vec, const CMatrix &mat); -CVector operator*(const CMatrix &mat, const CVector &vec);
\ No newline at end of file +CVector operator*(const CMatrix &mat, const CVector &vec); + +// we need this because CVector and RwV3d have different size now +void RwV3dTransformPoints(CVector * pointsOut, const CVector * pointsIn, RwInt32 numPoints, const RwMatrix * matrix); diff --git a/src/math/VuVector.h b/src/math/VuVector.h index 30d62cfc..026965d1 100644 --- a/src/math/VuVector.h +++ b/src/math/VuVector.h @@ -3,10 +3,10 @@ class TYPEALIGN(16) CVuVector : public CVector { public: - float w; +// float w; // in CVector now CVuVector(void) {} CVuVector(float x, float y, float z) : CVector(x, y, z) {} - CVuVector(float x, float y, float z, float w) : CVector(x, y, z), w(w) {} + CVuVector(float x, float y, float z, float w) : CVector(x, y, z)/*, w(w)*/ { this->w = w;} CVuVector(const CVector &v) : CVector(v.x, v.y, v.z) {} CVuVector(const RwV3d &v) : CVector(v) {} /* diff --git a/src/modelinfo/VehicleModelInfo.cpp b/src/modelinfo/VehicleModelInfo.cpp index bd3a2154..21583709 100644 --- a/src/modelinfo/VehicleModelInfo.cpp +++ b/src/modelinfo/VehicleModelInfo.cpp @@ -15,6 +15,7 @@ #include "Automobile.h" #include "Boat.h" #include "Train.h" +#include "Ferry.h" #include "Plane.h" #include "Heli.h" #include "Bike.h" @@ -122,6 +123,22 @@ RwObjectNameIdAssocation trainIds[] = { { nil, 0, 0 } }; +RwObjectNameIdAssocation ferryIds[] = { + { "door_front_dummy", FERRY_DOOR_FRONT, VEHICLE_FLAG_LEFT | VEHICLE_FLAG_COLLAPSE }, + { "door_back_dummy", FERRY_DOOR_BACK, VEHICLE_FLAG_LEFT | VEHICLE_FLAG_COLLAPSE }, + { "ramp_front_dummy", FERRY_RAMP_FRONT, VEHICLE_FLAG_LEFT | VEHICLE_FLAG_COLLAPSE }, + { "ramp_back_dummy", FERRY_RAMP_BACK, VEHICLE_FLAG_LEFT | VEHICLE_FLAG_COLLAPSE }, + { "light_front", FERRY_POS_LIGHT_FRONT, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID }, + { "light_rear", FERRY_POS_LIGHT_REAR, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID }, + { "chim_left", FERRY_POS_CHIM_LEFT, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID }, + { "ped_point", FERRY_POS_PED_POINT, VEHICLE_FLAG_DOOR | VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID }, + { "car1_dummy", FERRY_POS_CAR1, VEHICLE_FLAG_DOOR | VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID }, + { "car2_dummy", FERRY_POS_CAR2, VEHICLE_FLAG_DOOR | VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID }, + { "car3_dummy", FERRY_POS_CAR3, VEHICLE_FLAG_DOOR | VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID }, + { "car4_dummy", FERRY_POS_CAR4, VEHICLE_FLAG_DOOR | VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID }, + { nil, 0, 0 } +}; + RwObjectNameIdAssocation heliIds[] = { { "chassis_dummy", HELI_CHASSIS, VEHICLE_FLAG_COLLAPSE }, { "toprotor", HELI_TOPROTOR, 0 }, @@ -170,7 +187,8 @@ RwObjectNameIdAssocation *CVehicleModelInfo::ms_vehicleDescs[] = { trainIds, heliIds, planeIds, - bikeIds + bikeIds, + ferryIds }; bool gbBlackCars; diff --git a/src/modelinfo/VehicleModelInfo.h b/src/modelinfo/VehicleModelInfo.h index f979c2c0..6f2cea3c 100644 --- a/src/modelinfo/VehicleModelInfo.h +++ b/src/modelinfo/VehicleModelInfo.h @@ -49,6 +49,18 @@ enum eBoatPositions BOAT_POS_FRONTSEAT }; +enum eFerryPositions +{ + FERRY_POS_LIGHT_FRONT, + FERRY_POS_LIGHT_REAR, + FERRY_POS_CHIM_LEFT, + FERRY_POS_PED_POINT, + FERRY_POS_CAR1, + FERRY_POS_CAR2, + FERRY_POS_CAR3, + FERRY_POS_CAR4 +}; + enum eTrainPositions { TRAIN_POS_LIGHT_FRONT, diff --git a/src/vehicles/Ferry.h b/src/vehicles/Ferry.h new file mode 100644 index 00000000..375dfce1 --- /dev/null +++ b/src/vehicles/Ferry.h @@ -0,0 +1,13 @@ +#pragma once + +#include "Vehicle.h" +#include "Door.h" + +enum eFerryNodes +{ + FERRY_DOOR_FRONT = 1, + FERRY_RAMP_FRONT, + FERRY_DOOR_BACK, + FERRY_RAMP_BACK, + NUM_FERRY_NODES +}; |