summaryrefslogtreecommitdiffstats
path: root/src/control/Phones.h
diff options
context:
space:
mode:
authorFire_Head <Fire-Head@users.noreply.github.com>2019-07-11 02:48:36 +0200
committerGitHub <noreply@github.com>2019-07-11 02:48:36 +0200
commitaa449b6fe162d8960351c5fe164a9120b8572652 (patch)
treefa82496d356ac2b77ffa1ab00684b0150907f009 /src/control/Phones.h
parentfixfixfix (diff)
parentMerge pull request #129 from erorcun/erorcun (diff)
downloadre3-aa449b6fe162d8960351c5fe164a9120b8572652.tar
re3-aa449b6fe162d8960351c5fe164a9120b8572652.tar.gz
re3-aa449b6fe162d8960351c5fe164a9120b8572652.tar.bz2
re3-aa449b6fe162d8960351c5fe164a9120b8572652.tar.lz
re3-aa449b6fe162d8960351c5fe164a9120b8572652.tar.xz
re3-aa449b6fe162d8960351c5fe164a9120b8572652.tar.zst
re3-aa449b6fe162d8960351c5fe164a9120b8572652.zip
Diffstat (limited to '')
-rw-r--r--src/control/Phones.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/control/Phones.h b/src/control/Phones.h
index a29043ed..74f24d25 100644
--- a/src/control/Phones.h
+++ b/src/control/Phones.h
@@ -1,6 +1,55 @@
#pragma once
+#include "Physical.h"
#include "AnimBlendAssociation.h"
+enum {
+ PHONE_STATE_FREE,
+ PHONE_STATE_1,
+ PHONE_STATE_2,
+ PHONE_STATE_MESSAGE_REMOVED,
+ PHONE_STATE_ONETIME_MESSAGE_SET,
+ PHONE_STATE_REPEATED_MESSAGE_SET,
+ PHONE_STATE_REPEATED_MESSAGE_SHOWN_ONCE,
+ PHONE_STATE_ONETIME_MESSAGE_SHOWN,
+ PHONE_STATE_REPEATED_MESSAGE_SHOWN,
+ PHONE_STATE_9
+};
+
+struct CPhone
+{
+ CVector m_vecPos;
+ uint16 *m_apMessages[6];
+ uint32 m_lastTimeRepeatedMsgShown;
+ CEntity *m_pEntity; // it's building pool index in save files
+ int32 m_nState;
+ uint8 field_30;
+};
+
+static_assert(sizeof(CPhone) == 0x34, "CPhone: error");
+
+class CPhoneInfo {
+ static bool &isPhonePickedUp;
+ static bool &isPhoneBeingPickedUp;
+ static CPhone *&pickedUpPhone;
+public:
+ int32 m_nMax;
+ int32 m_nNum;
+ CPhone m_aPhones[50];
+
+ CPhoneInfo() { }
+ ~CPhoneInfo() { }
+
+ int FindNearestFreePhone(CVector*);
+ bool PhoneAtThisPosition(CVector);
+ bool HasMessageBeenDisplayed(int);
+ bool IsMessageBeingDisplayed(int);
+ void Load(CPhoneInfo *source, uint8 buffer);
+ void SetPhoneMessage_JustOnce(int phoneId, uint16 *msg1, uint16 *msg2, uint16 *msg3, uint16 *msg4, uint16 *msg5, uint16 *msg6);
+ void SetPhoneMessage_Repeatedly(int phoneId, uint16 *msg1, uint16 *msg2, uint16 *msg3, uint16 *msg4, uint16 *msg5, uint16 *msg6);
+};
+
+extern CPhoneInfo &gPhoneInfo;
+
void PhonePutDownCB(CAnimBlendAssociation *assoc, void *arg);
void PhonePickUpCB(CAnimBlendAssociation *assoc, void *arg); \ No newline at end of file