diff options
author | aap <aap@papnet.eu> | 2019-08-28 12:58:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-28 12:58:42 +0200 |
commit | 792893df594b8cd09d7e9e8486148aa0126eef3a (patch) | |
tree | f775059bd6cd968b096f989243e496bea776ae4f /src/control | |
parent | Merge pull request #197 from Nick007J/master (diff) | |
parent | Audio fixes (diff) | |
download | re3-792893df594b8cd09d7e9e8486148aa0126eef3a.tar re3-792893df594b8cd09d7e9e8486148aa0126eef3a.tar.gz re3-792893df594b8cd09d7e9e8486148aa0126eef3a.tar.bz2 re3-792893df594b8cd09d7e9e8486148aa0126eef3a.tar.lz re3-792893df594b8cd09d7e9e8486148aa0126eef3a.tar.xz re3-792893df594b8cd09d7e9e8486148aa0126eef3a.tar.zst re3-792893df594b8cd09d7e9e8486148aa0126eef3a.zip |
Diffstat (limited to 'src/control')
-rw-r--r-- | src/control/Bridge.h | 27 | ||||
-rw-r--r-- | src/control/Garages.cpp | 6 | ||||
-rw-r--r-- | src/control/Garages.h | 2 | ||||
-rw-r--r-- | src/control/Population.h | 3 | ||||
-rw-r--r-- | src/control/Replay.cpp | 22 |
5 files changed, 29 insertions, 31 deletions
diff --git a/src/control/Bridge.h b/src/control/Bridge.h index 52c85322..377c8bf8 100644 --- a/src/control/Bridge.h +++ b/src/control/Bridge.h @@ -1,27 +1,24 @@ #pragma once #include "Entity.h" +enum bridgeStates { + STATE_BRIDGE_LOCKED, + STATE_LIFT_PART_IS_UP, + STATE_LIFT_PART_MOVING_DOWN, + STATE_LIFT_PART_IS_DOWN, + STATE_LIFT_PART_ABOUT_TO_MOVE_UP, + STATE_LIFT_PART_MOVING_UP +}; + class CBridge { -private: - enum bridgeStates - { - STATE_BRIDGE_LOCKED, - STATE_LIFT_PART_IS_UP, - STATE_LIFT_PART_MOVING_DOWN, - STATE_LIFT_PART_IS_DOWN, - STATE_LIFT_PART_ABOUT_TO_MOVE_UP, - STATE_LIFT_PART_MOVING_UP - }; - - +public: static CEntity *&pLiftRoad, *&pLiftPart, *&pWeight; static int &State, &OldState; static float &DefaultZLiftPart, &DefaultZLiftRoad, &DefaultZLiftWeight; - static float& OldLift; - static uint32& TimeOfBridgeBecomingOperational; + static float &OldLift; + static uint32 &TimeOfBridgeBecomingOperational; -public: static void Init(); static void Update(); static bool ShouldLightsBeFlashing(); diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp index 3c5c142c..0e9592dc 100644 --- a/src/control/Garages.cpp +++ b/src/control/Garages.cpp @@ -68,7 +68,7 @@ bool CGarages::HasCarBeenCrushed(int32 handle) return CrushedCarId == handle; } -WRAPPER void CGarages::TriggerMessage(char *text, int16, uint16 time, int16) { EAXJMP(0x426B20); } +WRAPPER void CGarages::TriggerMessage(const char *text, int16, uint16 time, int16) { EAXJMP(0x426B20); } WRAPPER bool CGarages::IsPointWithinHideOutGarage(CVector*) { EAXJMP(0x428260); } #if 0 @@ -97,7 +97,7 @@ void CGarages::PrintMessages() CMessages::InsertNumberInString(TheText.Get(MessageIDString), MessageNumberInString, -1, -1, -1, -1, -1, gUString); CFont::SetColor(CRGBA(0, 0, 0, 255)); - CFont::PrintString((SCREEN_WIDTH / 2) + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) + SCREEN_SCALE_Y(-84.0f + 2.0 - 40.0f), gUString); + CFont::PrintString((SCREEN_WIDTH / 2) + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) + SCREEN_SCALE_Y(-84.0f + 2.0f - 40.0f), gUString); CFont::SetColor(CRGBA(89, 115, 150, 255)); CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) + SCREEN_SCALE_Y(-84.0f - 40.0f), gUString); @@ -107,7 +107,7 @@ void CGarages::PrintMessages() CMessages::InsertNumberInString(TheText.Get(MessageIDString), MessageNumberInString, MessageNumberInString2, -1, -1, -1, -1, gUString); CFont::SetColor(CRGBA(0, 0, 0, 255)); - CFont::PrintString((SCREEN_WIDTH / 2) + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) + SCREEN_SCALE_Y(-84.0f + 2.0 - 40.0f), gUString); + CFont::PrintString((SCREEN_WIDTH / 2) + SCREEN_SCALE_X(2.0f), (SCREEN_HEIGHT / 2) + SCREEN_SCALE_Y(-84.0f + 2.0f - 40.0f), gUString); CFont::SetColor(CRGBA(89, 115, 150, 255)); CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) + SCREEN_SCALE_Y(-84.0f - 40.0f), gUString); diff --git a/src/control/Garages.h b/src/control/Garages.h index d338c71b..4c35fad1 100644 --- a/src/control/Garages.h +++ b/src/control/Garages.h @@ -22,7 +22,7 @@ public: public: static bool IsModelIndexADoor(uint32 id); - static void TriggerMessage(char *text, int16, uint16 time, int16); + static void TriggerMessage(const char *text, int16, uint16 time, int16); static void PrintMessages(void); static bool HasCarBeenCrushed(int32); static bool IsPointWithinHideOutGarage(CVector*); diff --git a/src/control/Population.h b/src/control/Population.h index 7e4b40d8..3582ccef 100644 --- a/src/control/Population.h +++ b/src/control/Population.h @@ -1,8 +1,9 @@ #pragma once +#include "Game.h" + class CPed; class CVehicle; -enum eLevelName; struct PedGroup { diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp index 12636d32..be87eb2a 100644 --- a/src/control/Replay.cpp +++ b/src/control/Replay.cpp @@ -342,7 +342,7 @@ void CReplay::StorePedUpdate(CPed *ped, int id) tPedUpdatePacket* pp = (tPedUpdatePacket*)&Record.m_pBase[Record.m_nOffset]; pp->type = REPLAYPACKET_PED_UPDATE; pp->index = id; - pp->heading = 128.0f / M_PI * ped->m_fRotationCur; + pp->heading = 128.0f / PI * ped->m_fRotationCur; pp->matrix.CompressFromFullMatrix(ped->GetMatrix()); pp->assoc_group_id = ped->m_animGroup; /* Would be more sane to use GetJustIndex(ped->m_pMyVehicle) in following assignment */ @@ -464,8 +464,8 @@ void CReplay::ProcessPedUpdate(CPed *ped, float interpolation, CAddressInReplayB buffer->m_nOffset += sizeof(tPedUpdatePacket); return; } - ped->m_fRotationCur = pp->heading * M_PI / 128.0f; - ped->m_fRotationDest = pp->heading * M_PI / 128.0f; + ped->m_fRotationCur = pp->heading * PI / 128.0f; + ped->m_fRotationDest = pp->heading * PI / 128.0f; CMatrix ped_matrix; pp->matrix.DecompressIntoFullMatrix(ped_matrix); ped->GetMatrix() = ped->GetMatrix() * CMatrix(1.0f - interpolation); @@ -632,17 +632,17 @@ void CReplay::StoreCarUpdate(CVehicle *vehicle, int id) vp->primary_color = vehicle->m_currentColour1; vp->secondary_color = vehicle->m_currentColour2; if (vehicle->GetModelIndex() == MI_RHINO) - vp->car_gun = 128.0f / M_PI * ((CAutomobile*)vehicle)->m_fCarGunLR; + vp->car_gun = 128.0f / PI * ((CAutomobile*)vehicle)->m_fCarGunLR; else vp->wheel_state = 50.0f * vehicle->m_fSteerAngle; if (vehicle->IsCar()){ CAutomobile* car = (CAutomobile*)vehicle; for (int i = 0; i < 4; i++){ vp->wheel_susp_dist[i] = 50.0f * car->m_aSuspensionSpringRatio[i]; - vp->wheel_rotation[i] = 128.0f / M_PI * car->m_aWheelRotation[i]; + vp->wheel_rotation[i] = 128.0f / PI * car->m_aWheelRotation[i]; } - vp->door_angles[0] = 127.0f / M_PI * car->Doors[2].m_fAngle; - vp->door_angles[1] = 127.0f / M_PI * car->Doors[3].m_fAngle; + vp->door_angles[0] = 127.0f / PI * car->Doors[2].m_fAngle; + vp->door_angles[1] = 127.0f / PI * car->Doors[3].m_fAngle; vp->door_status = 0; for (int i = 0; i < 6; i++){ if (car->Damage.GetDoorStatus(i) == 3) @@ -675,7 +675,7 @@ void CReplay::ProcessCarUpdate(CVehicle *vehicle, float interpolation, CAddressI ApplyPanelDamageToCar(vp->panels, (CAutomobile*)vehicle, true); vehicle->m_vecMoveSpeed = CVector(vp->velocityX / 8000.0f, vp->velocityY / 8000.0f, vp->velocityZ / 8000.0f); if (vehicle->GetModelIndex() == MI_RHINO) { - ((CAutomobile*)vehicle)->m_fCarGunLR = vp->car_gun * M_PI / 128.0f; + ((CAutomobile*)vehicle)->m_fCarGunLR = vp->car_gun * PI / 128.0f; vehicle->m_fSteerAngle = 0.0f; }else{ vehicle->m_fSteerAngle = vp->wheel_state / 50.0f; @@ -684,10 +684,10 @@ void CReplay::ProcessCarUpdate(CVehicle *vehicle, float interpolation, CAddressI CAutomobile* car = (CAutomobile*)vehicle; for (int i = 0; i < 4; i++) { car->m_aSuspensionSpringRatio[i] = vp->wheel_susp_dist[i] / 50.0f; - car->m_aWheelRotation[i] = vp->wheel_rotation[i] * M_PI / 128.0f; + car->m_aWheelRotation[i] = vp->wheel_rotation[i] * PI / 128.0f; } - car->Doors[2].m_fAngle = car->Doors[2].m_fPrevAngle = vp->door_angles[0] * M_PI / 127.0f; - car->Doors[3].m_fAngle = car->Doors[3].m_fPrevAngle = vp->door_angles[1] * M_PI / 127.0f; + car->Doors[2].m_fAngle = car->Doors[2].m_fPrevAngle = vp->door_angles[0] * PI / 127.0f; + car->Doors[3].m_fAngle = car->Doors[3].m_fPrevAngle = vp->door_angles[1] * PI / 127.0f; if (vp->door_angles[0]) car->Damage.SetDoorStatus(2, 2); if (vp->door_angles[1]) |