summaryrefslogtreecommitdiffstats
path: root/src/audio/PolRadio.h
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-02-26 09:56:26 +0100
committerSergeanur <s.anureev@yandex.ua>2021-02-26 09:57:11 +0100
commitb01d6be3f4fe4f0555fd98393b13297b267f860a (patch)
tree9bc64e3502291262d03bd66d3a1c5443aa051a1b /src/audio/PolRadio.h
parentFix stack corruption in HandleGraphEvent (diff)
downloadre3-b01d6be3f4fe4f0555fd98393b13297b267f860a.tar
re3-b01d6be3f4fe4f0555fd98393b13297b267f860a.tar.gz
re3-b01d6be3f4fe4f0555fd98393b13297b267f860a.tar.bz2
re3-b01d6be3f4fe4f0555fd98393b13297b267f860a.tar.lz
re3-b01d6be3f4fe4f0555fd98393b13297b267f860a.tar.xz
re3-b01d6be3f4fe4f0555fd98393b13297b267f860a.tar.zst
re3-b01d6be3f4fe4f0555fd98393b13297b267f860a.zip
Diffstat (limited to 'src/audio/PolRadio.h')
-rw-r--r--src/audio/PolRadio.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/audio/PolRadio.h b/src/audio/PolRadio.h
new file mode 100644
index 00000000..d7c928e2
--- /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, 0x1BC);