From 59c9ae29cf12477576b0872a342bcbe5979b8281 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Fri, 26 Feb 2021 10:56:26 +0200 Subject: PoliceRadio -> PolRadio (original name) --- src/audio/PolRadio.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/audio/PolRadio.h (limited to 'src/audio/PolRadio.h') diff --git a/src/audio/PolRadio.h b/src/audio/PolRadio.h new file mode 100644 index 00000000..368708b6 --- /dev/null +++ b/src/audio/PolRadio.h @@ -0,0 +1,46 @@ +#pragma once + +#include "Crime.h" + +struct cAMCrime { + int32 type; + CVector position; + uint16 timer; + + cAMCrime() + { + type = CRIME_NONE; + position = CVector(0.0f, 0.0f, 0.0f); + timer = 0; + } +}; + +VALIDATE_SIZE(cAMCrime, 20); + +class cPoliceRadioQueue +{ +public: + int32 crimesSamples[60]; + uint8 policeChannelTimer; + uint8 policeChannelTimerSeconds; + uint8 policeChannelCounterSeconds; + cAMCrime crimes[10]; + + cPoliceRadioQueue() + { + policeChannelTimerSeconds = 0; + policeChannelCounterSeconds = 0; + policeChannelTimer = 0; + } + + void Add(uint32 sample) + { + if (policeChannelTimer != 60) { + crimesSamples[policeChannelTimerSeconds] = sample; + policeChannelTimer++; + policeChannelTimerSeconds = (policeChannelTimerSeconds + 1) % 60; + } + } +}; + +VALIDATE_SIZE(cPoliceRadioQueue, 444); -- cgit v1.2.3