summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFire_Head <Fire-Head@users.noreply.github.com>2019-10-27 05:46:54 +0100
committerGitHub <noreply@github.com>2019-10-27 05:46:54 +0100
commit649aea7bf776574c86a1ef3c69305bfd6ea4a09e (patch)
tree5ee9c556e80e4b0a254444e9d9cb3d9fe8976558 /src
parentfix Pad.h (diff)
downloadre3-649aea7bf776574c86a1ef3c69305bfd6ea4a09e.tar
re3-649aea7bf776574c86a1ef3c69305bfd6ea4a09e.tar.gz
re3-649aea7bf776574c86a1ef3c69305bfd6ea4a09e.tar.bz2
re3-649aea7bf776574c86a1ef3c69305bfd6ea4a09e.tar.lz
re3-649aea7bf776574c86a1ef3c69305bfd6ea4a09e.tar.xz
re3-649aea7bf776574c86a1ef3c69305bfd6ea4a09e.tar.zst
re3-649aea7bf776574c86a1ef3c69305bfd6ea4a09e.zip
Diffstat (limited to 'src')
-rw-r--r--src/text/Messages.cpp98
1 files changed, 49 insertions, 49 deletions
diff --git a/src/text/Messages.cpp b/src/text/Messages.cpp
index 0e8f5494..db5b9036 100644
--- a/src/text/Messages.cpp
+++ b/src/text/Messages.cpp
@@ -1,58 +1,58 @@
-#define DIRECTINPUT_VERSION 0x0800
-#include "dinput.h"
-
-#include "common.h"
-#include "patcher.h"
-#include "Messages.h"
-#include "RwHelper.h"
-#include "Hud.h"
-#include "User.h"
-#include "Timer.h"
-#include "Text.h"
-
-#include "ControllerConfig.h"
-
-tMessage(&CMessages::BriefMessages)[NUMBRIEFMESSAGES] = *(tMessage(*)[NUMBRIEFMESSAGES])*(uintptr*)0x8786E0;
-tPreviousBrief(&CMessages::PreviousBriefs)[NUMPREVIOUSBRIEFS] = *(tPreviousBrief(*)[NUMPREVIOUSBRIEFS])*(uintptr*)0x713C08;
-tBigMessage(&CMessages::BIGMessages)[NUMBIGMESSAGES] = *(tBigMessage(*)[NUMBIGMESSAGES])*(uintptr*)0x773628;
-char CMessages::PreviousMissionTitle[16]; // unused
-
-void
-CMessages::Init()
+#define DIRECTINPUT_VERSION 0x0800
+#include "dinput.h"
+
+#include "common.h"
+#include "patcher.h"
+#include "Messages.h"
+#include "RwHelper.h"
+#include "Hud.h"
+#include "User.h"
+#include "Timer.h"
+#include "Text.h"
+
+#include "ControllerConfig.h"
+
+tMessage(&CMessages::BriefMessages)[NUMBRIEFMESSAGES] = *(tMessage(*)[NUMBRIEFMESSAGES])*(uintptr*)0x8786E0;
+tPreviousBrief(&CMessages::PreviousBriefs)[NUMPREVIOUSBRIEFS] = *(tPreviousBrief(*)[NUMPREVIOUSBRIEFS])*(uintptr*)0x713C08;
+tBigMessage(&CMessages::BIGMessages)[NUMBIGMESSAGES] = *(tBigMessage(*)[NUMBIGMESSAGES])*(uintptr*)0x773628;
+char CMessages::PreviousMissionTitle[16]; // unused
+
+void
+CMessages::Init()
{
ClearMessages();
- for (int32 i = 0; i < NUMPREVIOUSBRIEFS; i++) {
- PreviousBriefs[i].m_pText = nil;
- PreviousBriefs[i].m_pString = nil;
- }
-}
-
-uint16
-CMessages::GetWideStringLength(wchar *src)
+ for (int32 i = 0; i < NUMPREVIOUSBRIEFS; i++) {
+ PreviousBriefs[i].m_pText = nil;
+ PreviousBriefs[i].m_pString = nil;
+ }
+}
+
+uint16
+CMessages::GetWideStringLength(wchar *src)
{
uint16 length = 0;
while (*(src++)) length++;
- return length;
-}
-
-void
-CMessages::WideStringCopy(wchar *dst, wchar *src, uint16 size)
+ return length;
+}
+
+void
+CMessages::WideStringCopy(wchar *dst, wchar *src, uint16 size)
{
int32 i = 0;
- if (src) {
+ if (src) {
while (i < size - 1) {
if (!src[i]) break;
dst[i] = src[i];
i++;
- }
- } else {
+ }
+ } else {
while (i < size - 1)
- dst[i++] = '\0';
- }
- dst[i] = '\0';
-}
-
+ dst[i++] = '\0';
+ }
+ dst[i] = '\0';
+}
+
bool
CMessages::WideStringCompare(wchar *str1, wchar *str2, uint16 size)
{
@@ -251,11 +251,11 @@ CMessages::AddMessageSoon(wchar *msg, uint32 time, uint16 flag)
void
CMessages::ClearMessages()
{
- for (int32 i = 0; i < NUMBIGMESSAGES; i++) {
- for (int32 j = 0; j < 4; j++) {
- BIGMessages[i].m_Stack[j].m_pText = nil;
- BIGMessages[i].m_Stack[j].m_pString = nil;
- }
+ for (int32 i = 0; i < NUMBIGMESSAGES; i++) {
+ for (int32 j = 0; j < 4; j++) {
+ BIGMessages[i].m_Stack[j].m_pText = nil;
+ BIGMessages[i].m_Stack[j].m_pString = nil;
+ }
}
ClearSmallMessagesOnly();
}
@@ -442,7 +442,7 @@ CMessages::InsertPlayerControlKeysInString(wchar *str)
for (i = 0; i < strSize;) {
if (str[i] == '~' && str[i + 1] == 'k' && str[i + 2] == '~') {
i += 4;
- for (int32 cont = 0; cont < TOTAL_CONTROL_ACTIONS; cont++) {
+ for (int32 cont = 0; cont < MAX_CONTROLLERACTIONS; cont++) {
uint16 contSize = GetWideStringLength(ControlsManager.m_aActionNames[cont]);
if (contSize != 0) {
if (WideStringCompare(&str[i], ControlsManager.m_aActionNames[cont], contSize)) {
@@ -832,4 +832,4 @@ STARTPATCHES
InjectHook(0x52B140, CMessages::ClearThisPrint, PATCH_JUMP);
InjectHook(0x52B3C0, CMessages::ClearThisBigPrint, PATCH_JUMP);
InjectHook(0x52B670, CMessages::ClearAllMessagesDisplayedByGame, PATCH_JUMP);
-ENDPATCHES \ No newline at end of file
+ENDPATCHES