summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-04-13 21:17:42 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-04-13 21:17:42 +0200
commit270944707387c0d7d7a35c789397a6fc2fa44752 (patch)
treefdf96f07bb709b6aa24d0341c8b1000c70fec30e /src/control
parentreview fix (diff)
parentfixed record (diff)
downloadre3-270944707387c0d7d7a35c789397a6fc2fa44752.tar
re3-270944707387c0d7d7a35c789397a6fc2fa44752.tar.gz
re3-270944707387c0d7d7a35c789397a6fc2fa44752.tar.bz2
re3-270944707387c0d7d7a35c789397a6fc2fa44752.tar.lz
re3-270944707387c0d7d7a35c789397a6fc2fa44752.tar.xz
re3-270944707387c0d7d7a35c789397a6fc2fa44752.tar.zst
re3-270944707387c0d7d7a35c789397a6fc2fa44752.zip
Diffstat (limited to 'src/control')
-rw-r--r--src/control/Record.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/control/Record.cpp b/src/control/Record.cpp
index aead1720..ca4128e3 100644
--- a/src/control/Record.cpp
+++ b/src/control/Record.cpp
@@ -21,8 +21,7 @@ tGameBuffer& CRecordDataForGame::pDataBufferForFrame = *(tGameBuffer*)0x72CED0;
void CRecordDataForGame::Init(void)
{
RecordingState = STATE_NONE;
- if (pDataBuffer)
- delete[] pDataBuffer;
+ delete[] pDataBuffer;
pDataBufferPointer = nil;
pDataBuffer = nil;
#ifndef GTA_PS2 // this stuff is not present on PS2
@@ -42,7 +41,7 @@ void CRecordDataForGame::Init(void)
if (RecordingState == STATE_PLAYBACK) {
pDataBufferPointer = new uint8[MEMORY_FOR_GAME_RECORD];
pDataBuffer = pDataBufferPointer;
- pDataBuffer[CFileMgr::Read(FId, (char*)pDataBufferPointer, MEMORY_FOR_GAME_RECORD) + 8] = -1;
+ pDataBuffer[CFileMgr::Read(FId, (char*)pDataBufferPointer, MEMORY_FOR_GAME_RECORD) + 8] = (uint8)-1;
CFileMgr::CloseFile(FId);
}
#else
@@ -71,7 +70,7 @@ void CRecordDataForGame::SaveOrRetrieveDataForThisFrame(void)
break;
}
case STATE_PLAYBACK:
- if (pDataBufferPointer[8] == -1)
+ if (pDataBufferPointer[8] == (uint8)-1)
CPad::GetPad(0)->NewState.Clear();
else {
tGameBuffer* pData = (tGameBuffer*)pDataBufferPointer;
@@ -92,7 +91,7 @@ void CRecordDataForGame::SaveOrRetrieveDataForThisFrame(void)
#define PROCESS_BUTTON_STATE_STORE(buf, os, ns, field, id) \
do { \
- if (os->field != os->field){ \
+ if (os->field != ns->field){ \
*buf++ = id; \
*buf++ = ns->field; \
} \
@@ -102,7 +101,7 @@ uint8* CRecordDataForGame::PackCurrentPadValues(uint8* buf, CControllerState* os
{
PROCESS_BUTTON_STATE_STORE(buf, os, ns, LeftStickX, 0);
PROCESS_BUTTON_STATE_STORE(buf, os, ns, LeftStickY, 1);
- PROCESS_BUTTON_STATE_STORE(buf, os, ns, LeftShoulder1, 2);
+ PROCESS_BUTTON_STATE_STORE(buf, os, ns, RightStickX, 2);
PROCESS_BUTTON_STATE_STORE(buf, os, ns, RightStickY, 3);
PROCESS_BUTTON_STATE_STORE(buf, os, ns, LeftShoulder1, 4);
PROCESS_BUTTON_STATE_STORE(buf, os, ns, LeftShoulder2, 5);
@@ -132,7 +131,7 @@ uint8* CRecordDataForGame::UnPackCurrentPadValues(uint8* buf, uint8 total, CCont
switch (*buf++) {
PROCESS_BUTTON_STATE_RESTORE(buf, state, LeftStickX, 0);
PROCESS_BUTTON_STATE_RESTORE(buf, state, LeftStickY, 1);
- PROCESS_BUTTON_STATE_RESTORE(buf, state, LeftShoulder1, 2);
+ PROCESS_BUTTON_STATE_RESTORE(buf, state, RightStickX, 2);
PROCESS_BUTTON_STATE_RESTORE(buf, state, RightStickY, 3);
PROCESS_BUTTON_STATE_RESTORE(buf, state, LeftShoulder1, 4);
PROCESS_BUTTON_STATE_RESTORE(buf, state, LeftShoulder2, 5);