diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-04-30 20:41:20 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-04-30 20:41:20 +0200 |
commit | dc12718fc20b2e70fa27653b19dd57f7d141d606 (patch) | |
tree | 80667ad887360af7a6ed8d9500e2952d57c61bc0 /src/core | |
parent | Merge remote-tracking branch 'upstream/master' (diff) | |
parent | Rename m_phy_flagA80 to bSkipLineCol (diff) | |
download | re3-dc12718fc20b2e70fa27653b19dd57f7d141d606.tar re3-dc12718fc20b2e70fa27653b19dd57f7d141d606.tar.gz re3-dc12718fc20b2e70fa27653b19dd57f7d141d606.tar.bz2 re3-dc12718fc20b2e70fa27653b19dd57f7d141d606.tar.lz re3-dc12718fc20b2e70fa27653b19dd57f7d141d606.tar.xz re3-dc12718fc20b2e70fa27653b19dd57f7d141d606.tar.zst re3-dc12718fc20b2e70fa27653b19dd57f7d141d606.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/AnimViewer.cpp | 4 | ||||
-rw-r--r-- | src/core/Cam.cpp | 4 | ||||
-rw-r--r-- | src/core/Frontend.cpp | 38 | ||||
-rw-r--r-- | src/core/Pad.cpp | 2 | ||||
-rw-r--r-- | src/core/PlayerInfo.cpp | 10 | ||||
-rw-r--r-- | src/core/Pools.cpp | 6 | ||||
-rw-r--r-- | src/core/Wanted.cpp | 2 | ||||
-rw-r--r-- | src/core/World.cpp | 14 | ||||
-rw-r--r-- | src/core/re3.cpp | 2 |
9 files changed, 56 insertions, 26 deletions
diff --git a/src/core/AnimViewer.cpp b/src/core/AnimViewer.cpp index 36ea20b7..7afda509 100644 --- a/src/core/AnimViewer.cpp +++ b/src/core/AnimViewer.cpp @@ -278,7 +278,7 @@ CAnimViewer::Update(void) // } } else { newEntity = pTarget = new CAutomobile(modelId, RANDOM_VEHICLE); - newEntity->m_status = STATUS_ABANDONED; + newEntity->SetStatus(STATUS_ABANDONED); } newEntity->bIsStuck = true; } else if (modelInfo->m_type == MITYPE_PED) { @@ -296,7 +296,7 @@ CAnimViewer::Update(void) CWorld::Add(newEntity); TheCamera.TakeControl(pTarget, CCam::MODE_MODELVIEW, JUMP_CUT, CAMCONTROL_SCRIPT); } - if (pTarget->m_type == ENTITY_TYPE_VEHICLE || pTarget->m_type == ENTITY_TYPE_PED || pTarget->m_type == ENTITY_TYPE_OBJECT) { + if (pTarget->IsVehicle() || pTarget->IsPed() || pTarget->IsObject()) { ((CPhysical*)pTarget)->m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f); } pTarget->GetPosition().z = 0.0f; diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp index 801652cb..43d817b7 100644 --- a/src/core/Cam.cpp +++ b/src/core/Cam.cpp @@ -4683,7 +4683,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation, static float ZmTwoAlphaOffsetLCS[] = { 0.1f, 0.08f, 0.3f, 0.08f, 0.08f }; static float ZmThreeAlphaOffsetLCS[] = { 0.065f, 0.05f, 0.15f, 0.06f, 0.08f }; - if (isHeli && car->m_status == STATUS_PLAYER_REMOTE) + if (isHeli && car->GetStatus() == STATUS_PLAYER_REMOTE) zoomModeAlphaOffset = ZmTwoAlphaOffsetLCS[alphaArrPos]; else { switch ((int)TheCamera.CarZoomIndicator) { @@ -4712,7 +4712,7 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation, float minDistForThisCar = approxCarLength * CARCAM_SET[camSetArrPos][3]; - if (!isHeli || car->m_status == STATUS_PLAYER_REMOTE) { + if (!isHeli || car->GetStatus() == STATUS_PLAYER_REMOTE) { float radiusToStayOutside = colMaxZ * CARCAM_SET[camSetArrPos][0] - CARCAM_SET[camSetArrPos][2]; if (radiusToStayOutside > 0.0f) { TargetCoors.z += radiusToStayOutside; diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index a83bffce..64332cb4 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -413,6 +413,14 @@ CMenuManager::BuildStatLine(char *text, void *stat, bool itsFloat, void *stat2) if (!text) return; +#ifdef MORE_LANGUAGES + if (CFont::IsJapanese() && stat2) + if (itsFloat) + sprintf(gString2, " %.2f/%.2f", *(float*)stat, *(float*)stat2); + else + sprintf(gString2, " %d/%d", *(int*)stat, *(int*)stat2); + else +#endif if (stat2) { if (itsFloat) sprintf(gString2, " %.2f %s %.2f", *(float*)stat, UnicodeToAscii(TheText.Get("FEST_OO")), *(float*)stat2); @@ -2939,7 +2947,6 @@ CMenuManager::InitialiseChangedLanguageSettings() default: break; } - PcSaveHelper.PopulateSlotInfo(); } } @@ -3286,7 +3293,7 @@ CMenuManager::PrintStats() { int rowNum = ConstructStatLine(99999); #ifdef GTA3_1_1_PATCH - CFont::SetFontStyle(FONT_BANK); + CFont::SetFontStyle(FONT_LOCALE(FONT_BANK)); #endif CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X * 0.7), MENU_Y(MENU_TEXT_SIZE_Y * 0.9)); // second mulipliers are double, idk why float nextYChange, y, alphaMult; @@ -3345,9 +3352,21 @@ CMenuManager::PrintStats() CFont::SetColor(CRGBA(235, 170, 50, FadeIn(255))); CFont::SetRightJustifyOff(); - CFont::PrintString(nextX, MENU_Y(STATS_RATING_Y), TheText.Get("CRIMRA")); nextX += MENU_X(10.0f) + CFont::GetStringWidth(TheText.Get("CRIMRA"), true); + CFont::PrintString(nextX, MENU_Y(STATS_RATING_Y), TheText.Get("CRIMRA")); +#ifdef MORE_LANGUAGES + if (CFont::IsJapanese()) + nextX += MENU_X(10.0f) + CFont::GetStringWidth_Jap(TheText.Get("CRIMRA")); + else +#endif + nextX += MENU_X(10.0f) + CFont::GetStringWidth(TheText.Get("CRIMRA"), true); UnicodeStrcpy(gUString, CStats::FindCriminalRatingString()); - CFont::PrintString(nextX, MENU_Y(STATS_RATING_Y), gUString); nextX += MENU_X(6.0f) + CFont::GetStringWidth(gUString, true); + CFont::PrintString(nextX, MENU_Y(STATS_RATING_Y), gUString); +#ifdef MORE_LANGUAGES + if (CFont::IsJapanese()) + nextX += MENU_X(6.0f) + CFont::GetStringWidth_Jap(gUString); + else +#endif + nextX += MENU_X(6.0f) + CFont::GetStringWidth(gUString, true); sprintf(gString, "%d", CStats::FindCriminalRatingNumber()); AsciiToUnicode(gString, gUString); CFont::PrintString(nextX, MENU_Y(STATS_RATING_Y), gUString); @@ -5474,8 +5493,18 @@ CMenuManager::PrintMap(void) float nextX = MENU_X(30.0f), nextY = 95.0f; wchar *text; +#ifdef MORE_LANGUAGES +#define TEXT_PIECE(key,extraSpace) \ + text = TheText.Get(key);\ + CFont::PrintString(nextX, SCREEN_SCALE_FROM_BOTTOM(nextY), text);\ + if (CFont::IsJapanese())\ + nextX += CFont::GetStringWidth_Jap(text) + MENU_X(extraSpace);\ + else\ + nextX += CFont::GetStringWidth(text, true) + MENU_X(extraSpace); +#else #define TEXT_PIECE(key,extraSpace) \ text = TheText.Get(key); CFont::PrintString(nextX, SCREEN_SCALE_FROM_BOTTOM(nextY), text); nextX += CFont::GetStringWidth(text, true) + MENU_X(extraSpace); +#endif TEXT_PIECE("FEC_MWF", 3.0f); TEXT_PIECE("FEC_PGU", 1.0f); @@ -5616,6 +5645,7 @@ CMenuManager::ConstructStatLine(int rowIdx) #ifdef MORE_LANGUAGES case LANGUAGE_POLISH: case LANGUAGE_RUSSIAN: + case LANGUAGE_JAPANESE: #endif STAT_LINE("FESTDFM", &CStats::DistanceTravelledOnFoot, true, nil); STAT_LINE("FESTDCM", &CStats::DistanceTravelledInVehicle, true, nil); diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index a72f51c0..7dbadd74 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -107,7 +107,7 @@ void TankCheat() tank->GetPosition() = pos; tank->SetOrientation(0.0f, 0.0f, DEGTORAD(200.0f)); - tank->m_status = STATUS_ABANDONED; + tank->SetStatus(STATUS_ABANDONED); tank->m_nDoorLock = CARLOCK_UNLOCKED; CWorld::Add(tank); } diff --git a/src/core/PlayerInfo.cpp b/src/core/PlayerInfo.cpp index e92f7568..7dadbf28 100644 --- a/src/core/PlayerInfo.cpp +++ b/src/core/PlayerInfo.cpp @@ -328,7 +328,7 @@ CPlayerInfo::FindClosestCarSectorList(CPtrList& carList, CPed* ped, float unk1, continue; car->m_scanCode = CWorld::GetCurrentScanCode(); - if (car->m_status != STATUS_WRECKED && car->m_status != STATUS_TRAIN_MOVING + if (car->GetStatus() != STATUS_WRECKED && car->GetStatus() != STATUS_TRAIN_MOVING && (car->GetUp().z > 0.3f || (car->IsVehicle() && ((CVehicle*)car)->m_vehType == VEHICLE_TYPE_BIKE))) { CVector carCentre = car->GetBoundCentre(); @@ -413,7 +413,7 @@ CPlayerInfo::Process(void) // This condition will always return true, else block was probably WIP Miami code. if (veh->m_vehType != VEHICLE_TYPE_BIKE || veh->m_nDoorLock == CARLOCK_LOCKED_PLAYER_INSIDE) { - if (veh->m_status != STATUS_WRECKED && veh->m_status != STATUS_TRAIN_MOVING && veh->m_nDoorLock != CARLOCK_LOCKED_PLAYER_INSIDE) { + if (veh->GetStatus() != STATUS_WRECKED && veh->GetStatus() != STATUS_TRAIN_MOVING && veh->m_nDoorLock != CARLOCK_LOCKED_PLAYER_INSIDE) { if (veh->m_vecMoveSpeed.Magnitude() < 0.17f && CTimer::GetTimeScale() >= 0.5f && !veh->bIsInWater) { m_pPed->SetObjective(OBJECTIVE_LEAVE_VEHICLE, veh); } @@ -454,7 +454,7 @@ CPlayerInfo::Process(void) weAreOnBoat = true; m_pPed->bOnBoat = true; #ifdef VC_PED_PORTS - if (carBelow->m_status != STATUS_WRECKED && carBelow->GetUp().z > 0.3f) + if (carBelow->GetStatus() != STATUS_WRECKED && carBelow->GetUp().z > 0.3f) #else if (carBelow->m_status != STATUS_WRECKED) #endif @@ -491,7 +491,7 @@ CPlayerInfo::Process(void) } // carBelow is now closest vehicle if (carBelow && !weAreOnBoat) { - if (carBelow->m_status == STATUS_TRAIN_NOT_MOVING) { + if (carBelow->GetStatus() == STATUS_TRAIN_NOT_MOVING) { m_pPed->SetObjective(OBJECTIVE_ENTER_CAR_AS_PASSENGER, carBelow); } else if (carBelow->IsBoat()) { if (!carBelow->pDriver) { @@ -526,7 +526,7 @@ CPlayerInfo::Process(void) m_bInRemoteMode = false; CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle = nil; if (FindPlayerVehicle()) { - FindPlayerVehicle()->m_status = STATUS_PLAYER; + FindPlayerVehicle()->SetStatus(STATUS_PLAYER); } } } diff --git a/src/core/Pools.cpp b/src/core/Pools.cpp index 8c979f6e..011c7af7 100644 --- a/src/core/Pools.cpp +++ b/src/core/Pools.cpp @@ -88,7 +88,7 @@ CPools::MakeSureSlotInObjectPoolIsEmpty(int32 slot) delete object; } else if (!CProjectileInfo::RemoveIfThisIsAProjectile(object)) { // relocate to another slot?? - CObject *newObject = new CObject(); + CObject *newObject = new CObject(object->GetModelIndex(), false); CWorld::Remove(object); memcpy(newObject, object, ms_pObjectPool->GetMaxEntrySize()); CWorld::Add(newObject); @@ -179,8 +179,8 @@ INITSAVEBUF pVehicle->m_nTimeOfDeath = pBufferVehicle->m_nTimeOfDeath; #endif pVehicle->m_nDoorLock = pBufferVehicle->m_nDoorLock; - pVehicle->m_status = pBufferVehicle->m_status; - pVehicle->m_type = pBufferVehicle->m_type; + pVehicle->SetStatus(pBufferVehicle->GetStatus()); + pVehicle->SetType(pBufferVehicle->GetType()); (pVehicle->GetAddressOfEntityProperties())[0] = (pBufferVehicle->GetAddressOfEntityProperties())[0]; (pVehicle->GetAddressOfEntityProperties())[1] = (pBufferVehicle->GetAddressOfEntityProperties())[1]; pVehicle->AutoPilot = pBufferVehicle->AutoPilot; diff --git a/src/core/Wanted.cpp b/src/core/Wanted.cpp index 6f5fdf06..7508c9f4 100644 --- a/src/core/Wanted.cpp +++ b/src/core/Wanted.cpp @@ -352,7 +352,7 @@ CWanted::WorkOutPolicePresence(CVector posn, float radius) vehicle->bIsLawEnforcer && IsPoliceVehicleModel(vehicle->GetModelIndex()) && vehicle != FindPlayerVehicle() && - vehicle->m_status != STATUS_ABANDONED && vehicle->m_status != STATUS_WRECKED && + vehicle->GetStatus() != STATUS_ABANDONED && vehicle->GetStatus() != STATUS_WRECKED && (posn - vehicle->GetPosition()).Magnitude() < radius) numPolice++; } diff --git a/src/core/World.cpp b/src/core/World.cpp index b2a01b80..4b2ca76e 100644 --- a/src/core/World.cpp +++ b/src/core/World.cpp @@ -1867,7 +1867,7 @@ CWorld::SetCarsOnFire(float x, float y, float z, float radius, CEntity *reason) int poolSize = CPools::GetVehiclePool()->GetSize(); for(int poolIndex = poolSize - 1; poolIndex >= 0; poolIndex--) { CVehicle *veh = CPools::GetVehiclePool()->GetSlot(poolIndex); - if(veh && veh->m_status != STATUS_WRECKED && !veh->m_pCarFire && !veh->bFireProof) { + if(veh && veh->GetStatus() != STATUS_WRECKED && !veh->m_pCarFire && !veh->bFireProof) { if(Abs(veh->GetPosition().z - z) < 5.0f && Abs(veh->GetPosition().x - x) < radius && Abs(veh->GetPosition().y - y) < radius) gFireManager.StartFire(veh, reason, 0.8f, true); @@ -1928,7 +1928,7 @@ CWorld::Process(void) if(csObj->m_rwObject && RwObjectGetType(csObj->m_rwObject) == rpCLUMP && RpAnimBlendClumpGetFirstAssociation(csObj->GetClump())) { RpAnimBlendClumpUpdateAnimations(csObj->GetClump(), - 0.02f * (csObj->m_type == ENTITY_TYPE_OBJECT + 0.02f * (csObj->IsObject() ? CTimer::GetTimeStepNonClipped() : CTimer::GetTimeStep())); } @@ -1946,7 +1946,7 @@ CWorld::Process(void) if(movingEnt->m_rwObject && RwObjectGetType(movingEnt->m_rwObject) == rpCLUMP && RpAnimBlendClumpGetFirstAssociation(movingEnt->GetClump())) { RpAnimBlendClumpUpdateAnimations(movingEnt->GetClump(), - 0.02f * (movingEnt->m_type == ENTITY_TYPE_OBJECT + 0.02f * (movingEnt->IsObject() ? CTimer::GetTimeStepNonClipped() : CTimer::GetTimeStep())); } @@ -2030,7 +2030,7 @@ CWorld::Process(void) movingEnt->UpdateRwFrame(); if(!movingEnt->bIsInSafePosition) { movingEnt->bIsStuck = true; - if(movingEnt->m_status == STATUS_PLAYER) { + if(movingEnt->GetStatus() == STATUS_PLAYER) { printf("STUCK: Final Step: Player Entity %d Is Stuck\n", movingEnt->m_modelIndex); movingEnt->m_vecMoveSpeed *= 0.3f; @@ -2178,10 +2178,10 @@ CWorld::TriggerExplosionSectorList(CPtrList &list, const CVector &position, floa pEntity->ApplyTurnForce(vecForceDir.x, vecForceDir.y, vecForceDir.z, 0.0f, 0.0f, fPointZ); } - switch(pEntity->m_type) { + switch(pEntity->GetType()) { case ENTITY_TYPE_VEHICLE: - if(pEntity->m_status == STATUS_SIMPLE) { - pEntity->m_status = STATUS_PHYSICS; + if(pEntity->GetStatus() == STATUS_SIMPLE) { + pEntity->SetStatus(STATUS_PHYSICS); CCarCtrl::SwitchVehicleToRealPhysics(pVehicle); } pVehicle->InflictDamage(pCreator, WEAPONTYPE_EXPLOSION, diff --git a/src/core/re3.cpp b/src/core/re3.cpp index 2a9cbc77..7bb18688 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -121,7 +121,7 @@ SpawnCar(int id) v->GetPosition().z += 4.0f; v->SetOrientation(0.0f, 0.0f, 3.49f); - v->m_status = STATUS_ABANDONED; + v->SetStatus(STATUS_ABANDONED); v->m_nDoorLock = CARLOCK_UNLOCKED; CWorld::Add(v); } |