From d52452e69f8dcf8df6fcc16dd841110c26ec18fa Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Mon, 20 Jan 2020 18:53:21 +0200 Subject: PowerPoints --- src/control/PowerPoints.cpp | 22 ++++++++++++++++++++++ src/control/PowerPoints.h | 26 ++++++++++++++++++++++++++ src/control/Script.cpp | 37 ++++++++++++++++++++++++++++++++++++- 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 src/control/PowerPoints.cpp create mode 100644 src/control/PowerPoints.h diff --git a/src/control/PowerPoints.cpp b/src/control/PowerPoints.cpp new file mode 100644 index 00000000..4bc773a9 --- /dev/null +++ b/src/control/PowerPoints.cpp @@ -0,0 +1,22 @@ +#include "common.h" +#include "PowerPoints.h" + +// Some cut beta feature + +void CPowerPoint::Update() +{} + +void CPowerPoints::Init() +{} + +void CPowerPoints::Update() +{} + +void CPowerPoints::GenerateNewOne(float, float, float, float, float, float, uint8) +{} + +void CPowerPoints::Save(uint8**, uint32*) +{} + +void CPowerPoints::Load(uint8*, uint32) +{} \ No newline at end of file diff --git a/src/control/PowerPoints.h b/src/control/PowerPoints.h new file mode 100644 index 00000000..d7478076 --- /dev/null +++ b/src/control/PowerPoints.h @@ -0,0 +1,26 @@ +#pragma once + +enum +{ + POWERPOINT_NONE = 0, + POWERPOINT_HEALTH, + POWERPOINT_HIDEOUT_INDUSTRIAL, + POWERPOINT_HIDEOUT_COMMERCIAL, + POWERPOINT_HIDEOUT_SUBURBAN +}; + +class CPowerPoint +{ +public: + void Update(); +}; + +class CPowerPoints +{ +public: + static void Init(); + static void Update(); + static void GenerateNewOne(float, float, float, float, float, float, uint8); + static void Save(uint8**, uint32*); + static void Load(uint8*, uint32); +}; \ No newline at end of file diff --git a/src/control/Script.cpp b/src/control/Script.cpp index f3f9c5a8..f74c5656 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -40,6 +40,7 @@ #include "PointLights.h" #include "Pools.h" #include "Population.h" +#include "PowerPoints.h" #include "ProjectileInfo.h" #include "Record.h" #include "Remote.h" @@ -4684,7 +4685,41 @@ int8 CRunningScript::ProcessCommandsFrom500To599(int32 command) CollectParameters(&m_nIp, 1); CGarages::BombsAreFree = (ScriptParams[0] != 0); return 0; - //case COMMAND_SET_POWERPOINT: +#ifdef GTA_PS2 + case COMMAND_SET_POWERPOINT: + { + CollectParameters(&m_nIp, 7); + float f1 = *(float*)&ScriptParams[0]; + float f2 = *(float*)&ScriptParams[1]; + float f3 = *(float*)&ScriptParams[2]; + float f4 = *(float*)&ScriptParams[3]; + float f5 = *(float*)&ScriptParams[4]; + float f6 = *(float*)&ScriptParams[5]; + float temp; + + if (f1 > f4) { + temp = f1; + f1 = f4; + f4 = temp; + } + + if (f2 > f5) { + temp = f2; + f2 = f5; + f5 = temp; + } + + if (f3 > f6) { + temp = f3; + f3 = f6; + f6 = temp; + } + + CPowerPoints::GenerateNewOne(f1, f2, f3, f4, f5, f6, *(uint8*)&ScriptParams[6]); + + return 0; + } +#endif // GTA_PS2 case COMMAND_SET_ALL_TAXI_LIGHTS: CollectParameters(&m_nIp, 1); CAutomobile::SetAllTaxiLights(ScriptParams[0] != 0); -- cgit v1.2.3