diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/ControllerConfig.h | 2 | ||||
-rw-r--r-- | src/core/CutsceneMgr.cpp | 5 | ||||
-rw-r--r-- | src/core/FileLoader.h | 2 | ||||
-rw-r--r-- | src/core/Frontend.cpp | 7 | ||||
-rw-r--r-- | src/core/Game.cpp | 3 | ||||
-rw-r--r-- | src/core/Lists.h | 2 | ||||
-rw-r--r-- | src/core/Messages.cpp | 26 | ||||
-rw-r--r-- | src/core/Messages.h | 56 | ||||
-rw-r--r-- | src/core/RwTexRead.cpp | 18 | ||||
-rw-r--r-- | src/core/Text.cpp | 276 | ||||
-rw-r--r-- | src/core/Text.h | 56 | ||||
-rw-r--r-- | src/core/User.cpp | 2 | ||||
-rw-r--r-- | src/core/User.h | 8 | ||||
-rw-r--r-- | src/core/common.h | 22 | ||||
-rw-r--r-- | src/core/config.h | 1 | ||||
-rw-r--r-- | src/core/re3.cpp | 2 |
16 files changed, 44 insertions, 444 deletions
diff --git a/src/core/ControllerConfig.h b/src/core/ControllerConfig.h index 150a76d4..e7abb21d 100644 --- a/src/core/ControllerConfig.h +++ b/src/core/ControllerConfig.h @@ -94,6 +94,8 @@ class CControllerState; #define JOY_BUTTONS 16 #define MAX_BUTTONS (JOY_BUTTONS+1) +#define ACTIONNAME_LENGTH 40 + class CControllerConfigManager { public: diff --git a/src/core/CutsceneMgr.cpp b/src/core/CutsceneMgr.cpp index 95abfcc9..f147e8c9 100644 --- a/src/core/CutsceneMgr.cpp +++ b/src/core/CutsceneMgr.cpp @@ -17,7 +17,6 @@ #include "RpAnimBlend.h" #include "ModelIndices.h" #include "TempColModels.h" -#include "MusicManager.h" const struct { const char *szTrackName; @@ -209,7 +208,7 @@ CCutsceneMgr::LoadCutsceneData(const char *szCutsceneName) CFileMgr::CloseFile(file);
if (strcmpi(ms_cutsceneName, "end")) {
- DMAudio.ChangeMusicMode(2);
+ DMAudio.ChangeMusicMode(MUSICMODE_CUTSCENE);
int trackId = FindCutsceneAudioTrackId(szCutsceneName);
if (trackId != -1) {
printf("Start preload audio %s\n", szCutsceneName);
@@ -368,7 +367,7 @@ CCutsceneMgr::DeleteCutsceneData(void) if (strcmpi(ms_cutsceneName, "end")) {
DMAudio.StopCutSceneMusic();
if (strcmpi(ms_cutsceneName, "bet"))
- DMAudio.ChangeMusicMode(1);
+ DMAudio.ChangeMusicMode(MUSICMODE_GAME);
}
CTimer::Stop();
//TheCamera.GetScreenFadeStatus() == 2; // what for??
diff --git a/src/core/FileLoader.h b/src/core/FileLoader.h index c3f5fe52..7ef96da3 100644 --- a/src/core/FileLoader.h +++ b/src/core/FileLoader.h @@ -9,7 +9,7 @@ public: static char *LoadLine(int fd); static RwTexDictionary *LoadTexDictionary(const char *filename); static void LoadCollisionFile(const char *filename); - static void LoadCollisionModel(uint8 *buf, CColModel &model, char *name); + static void LoadCollisionModel(uint8 *buf, struct CColModel &model, char *name); static void LoadModelFile(const char *filename); static RpAtomic *FindRelatedModelInfoCB(RpAtomic *atomic, void *data); static void LoadClumpFile(const char *filename); diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index 35302238..984e693f 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -11,7 +11,6 @@ #include "Timer.h" #include "Game.h" #include "DMAudio.h" -#include "MusicManager.h" #include "FileMgr.h" #include "Streaming.h" #include "TxdStore.h" @@ -535,7 +534,7 @@ void CMenuManager::Draw() if (m_nPrefsAudio3DProviderIndex == -1) textToPrint[MENUCOLUMN_RIGHT] = TheText.Get("FEA_NAH"); else { - char *provider = MusicManager.Get3DProviderName(m_nPrefsAudio3DProviderIndex); + char *provider = DMAudio.Get3DProviderName(m_nPrefsAudio3DProviderIndex); AsciiToUnicode(provider, gUString); textToPrint[MENUCOLUMN_RIGHT] = gUString; } @@ -1086,7 +1085,7 @@ void CMenuManager::LoadAllTextures() { if (!m_bSpritesLoaded) { CMenuManager::CentreMousePointer(); - DMAudio.ChangeMusicMode(0); + DMAudio.ChangeMusicMode(MUSICMODE_FRONTEND); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_STARTING, 0); m_nCurrOption = 0; m_PrefsRadioStation = DMAudio.GetRadioInCar(); @@ -2133,7 +2132,7 @@ WRAPPER void CMenuManager::RequestFrontEndShutdown() { EAXJMP(0x488750); } void CMenuManager::RequestFrontEndShutdown() { m_bShutDownFrontEndRequested = true; - DMAudio.ChangeMusicMode(1); + DMAudio.ChangeMusicMode(MUSICMODE_GAME); } #endif diff --git a/src/core/Game.cpp b/src/core/Game.cpp index 00d50fa8..b2bac8dd 100644 --- a/src/core/Game.cpp +++ b/src/core/Game.cpp @@ -80,12 +80,15 @@ WRAPPER void CGame::Initialise(const char *datFile) { EAXJMP(0x48BED0); } #if 0 WRAPPER void CGame::Process(void) { EAXJMP(0x48C850); } #else +extern void (*DebugMenuProcess)(void); void CGame::Process(void) { CPad::UpdatePads(); TheCamera.SetMotionBlurAlpha(0); if (TheCamera.m_BlurType == MBLUR_NONE || TheCamera.m_BlurType == MBLUR_SNIPER || TheCamera.m_BlurType == MBLUR_NORMAL) TheCamera.SetMotionBlur(0, 0, 0, 0, MBLUR_NONE); + + DebugMenuProcess(); CCutsceneMgr::Update(); if (!CCutsceneMgr::IsCutsceneProcessing() && !CTimer::GetIsCodePaused()) FrontEndMenuManager.Process(); diff --git a/src/core/Lists.h b/src/core/Lists.h index 7572e882..ecf24740 100644 --- a/src/core/Lists.h +++ b/src/core/Lists.h @@ -1,5 +1,7 @@ #pragma once +#include "common.h" + class CPtrNode { public: diff --git a/src/core/Messages.cpp b/src/core/Messages.cpp deleted file mode 100644 index 9b5342ac..00000000 --- a/src/core/Messages.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include "common.h" -#include "patcher.h" -#include "Messages.h" - -WRAPPER void CMessages::Display(void) { EAXJMP(0x529800); } -WRAPPER void CMessages::ClearAllMessagesDisplayedByGame(void) { EAXJMP(0x52B670); } -WRAPPER int CMessages::WideStringCopy(wchar* dst, wchar* src, unsigned short size) { EAXJMP(0x5294B0); } -WRAPPER char CMessages::WideStringCompare(wchar* str1, wchar* str2, unsigned short size) { EAXJMP(0x529510); } -WRAPPER void CMessages::InsertNumberInString(wchar* src, int n1, int n2, int n3, int n4, int n5, int n6, wchar* dst) { EAXJMP(0x52A1A0); } -WRAPPER void CMessages::InsertPlayerControlKeysInString(wchar* src) { EAXJMP(0x52A490); } -WRAPPER int CMessages::GetWideStringLength(wchar* src) { EAXJMP(0x529490); } -WRAPPER void CMessages::AddBigMessage(wchar* key, uint32 time, uint16 pos) { EAXJMP(0x529EB0); } -WRAPPER void CMessages::AddBigMessageWithNumber(wchar* key, uint32 time, uint16 pos, int n1, int n2, int n3, int n4, int n5, int n6) { EAXJMP(0x52AD10); } -WRAPPER void CMessages::AddBigMessageWithNumberQ(wchar* key, uint32 time, uint16 pos, int n1, int n2, int n3, int n4, int n5, int n6) { EAXJMP(0x52AE00); } -WRAPPER void CMessages::AddMessage(wchar* key, uint32 time, uint16 pos) { EAXJMP(0x529900); } -WRAPPER void CMessages::AddMessageJumpQ(wchar* key, uint32 time, uint16 pos) { EAXJMP(0x529A10); } -WRAPPER void CMessages::AddMessageSoon(wchar* key, uint32 time, uint16 pos) { EAXJMP(0x529AF0); } -WRAPPER void CMessages::AddMessageWithNumber(wchar* key, uint32 time, uint16 pos, int n1, int n2, int n3, int n4, int n5, int n6) { EAXJMP(0x52A850); } -WRAPPER void CMessages::AddMessageJumpQWithNumber(wchar* key, uint32 time, uint16 pos, int n1, int n2, int n3, int n4, int n5, int n6) { EAXJMP(0x52A9A0); } -WRAPPER void CMessages::AddMessageSoonWithNumber(wchar* key, uint32 time, uint16 pos, int n1, int n2, int n3, int n4, int n5, int n6) { EAXJMP(0x52AAC0); } -WRAPPER void CMessages::ClearMessages() { EAXJMP(0x529CE0); } -WRAPPER void CMessages::Init() { EAXJMP(0x529310); } -WRAPPER void CMessages::Process() { EAXJMP(0x529580); } -tPreviousBrief *CMessages::PreviousBriefs = (tPreviousBrief *)0x713C08; -tMessage *CMessages::BriefMessages = (tMessage *)0x8786E0; -tBigMessage *CMessages::BIGMessages = (tBigMessage *)0x773628; diff --git a/src/core/Messages.h b/src/core/Messages.h deleted file mode 100644 index 7caf5786..00000000 --- a/src/core/Messages.h +++ /dev/null @@ -1,56 +0,0 @@ -#pragma once - -struct tMessage -{ - wchar *m_pText; - uint16 m_nFlag; -private: - int8 _pad6[2]; -public: - uint32 m_nTime; - uint32 m_nStartTime; - int32 m_nNumber[6]; - wchar *m_pString; -}; - -struct tBigMessage -{ - tMessage m_Current; - tMessage m_Stack[3]; -}; - -struct tPreviousBrief -{ - wchar *m_pText; - int32 m_nNumber[6]; - wchar *m_pString; -}; - -class CMessages -{ -public: - static tPreviousBrief *PreviousBriefs; - static tMessage *BriefMessages; - static tBigMessage *BIGMessages; - -public: - static void Display(void); - static void ClearAllMessagesDisplayedByGame(void); - static int WideStringCopy(wchar* dst, wchar* src, unsigned short size); - static char WideStringCompare(wchar* str1, wchar* str2, unsigned short size); - static void InsertNumberInString(wchar* src, int n1, int n2, int n3, int n4, int n5, int n6, wchar* dst); - static void InsertPlayerControlKeysInString(wchar* src); - static int GetWideStringLength(wchar *src); - static void AddBigMessage(wchar* key, uint32 time, uint16 pos); - static void AddBigMessageWithNumber(wchar* key, uint32 time, uint16 pos, int n1, int n2, int n3, int n4, int n5, int n6); - static void AddBigMessageWithNumberQ(wchar* key, uint32 time, uint16 pos, int n1, int n2, int n3, int n4, int n5, int n6); - static void AddMessage(wchar* key, uint32 time, uint16 pos); - static void AddMessageJumpQ(wchar* key, uint32 time, uint16 pos); - static void AddMessageSoon(wchar* key, uint32 time, uint16 pos); - static void AddMessageWithNumber(wchar* key, uint32 time, uint16 pos, int n1, int n2, int n3, int n4, int n5, int n6); - static void AddMessageJumpQWithNumber(wchar* key, uint32 time, uint16 pos, int n1, int n2, int n3, int n4, int n5, int n6); - static void AddMessageSoonWithNumber(wchar* key, uint32 time, uint16 pos, int n1, int n2, int n3, int n4, int n5, int n6); - static void ClearMessages(); - static void Init(); - static void Process(); -}; diff --git a/src/core/RwTexRead.cpp b/src/core/RwTexRead.cpp index a1a7050a..6b717b34 100644 --- a/src/core/RwTexRead.cpp +++ b/src/core/RwTexRead.cpp @@ -1,5 +1,15 @@ +#pragma warning( push ) +#pragma warning( disable : 4005) +#define DIRECTINPUT_VERSION 0x0800 +#include <dinput.h> +#pragma warning( pop ) #include "common.h" +#include "win.h" #include "patcher.h" +#include "Timer.h" + +float &texLoadTime = *(float*)0x8F1B50; +int32 &texNumLoaded = *(int32*)0x8F252C; RwTexture* RwTextureGtaStreamRead(RwStream *stream) @@ -10,11 +20,15 @@ RwTextureGtaStreamRead(RwStream *stream) if(!RwStreamFindChunk(stream, rwID_TEXTURENATIVE, &size, &version)) return nil; - // TODO: unused timing + float preloadTime = (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond(); if(!RWSRCGLOBAL(stdFunc[rwSTANDARDNATIVETEXTUREREAD](stream, &tex, size))) return nil; - + + if (gGameState == GS_INIT_PLAYING_GAME) { + texLoadTime = (texNumLoaded * texLoadTime + (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond() - preloadTime) / (float)(texNumLoaded+1); + texNumLoaded++; + } return tex; } diff --git a/src/core/Text.cpp b/src/core/Text.cpp deleted file mode 100644 index dfa9815c..00000000 --- a/src/core/Text.cpp +++ /dev/null @@ -1,276 +0,0 @@ -#include "common.h" -#include "patcher.h" -#include "FileMgr.h" -#include "Frontend.h" -#include "Messages.h" -#include "Text.h" - -static wchar WideErrorString[25]; - -CText &TheText = *(CText*)0x941520; - -CText::CText(void) -{ - keyArray.entries = nil; - keyArray.numEntries = 0; - data.chars = nil; - data.numChars = 0; - encoding = 101; - memset(WideErrorString, 0, sizeof(WideErrorString)); -} - -CText::~CText(void) -{ - data.Unload(); - keyArray.Unload(); -} - -void -CText::Load(void) -{ - uint8 *filedata; - char filename[32], type[4]; - int length; - int offset, sectlen; - - Unload(); - filedata = new uint8[0x40000]; - - CFileMgr::SetDir("TEXT"); - switch(CMenuManager::m_PrefsLanguage){ - case LANGUAGE_AMERICAN: - sprintf(filename, "AMERICAN.GXT"); - break; - case LANGUAGE_FRENCH: - sprintf(filename, "FRENCH.GXT"); - break; - case LANGUAGE_GERMAN: - sprintf(filename, "GERMAN.GXT"); - break; - case LANGUAGE_ITALIAN: - sprintf(filename, "ITALIAN.GXT"); - break; - case LANGUAGE_SPANISH: - sprintf(filename, "SPANISH.GXT"); - break; - } - - length = CFileMgr::LoadFile(filename, filedata, 0x40000, "rb"); - CFileMgr::SetDir(""); - - offset = 0; - while(offset < length){ - type[0] = filedata[offset++]; - type[1] = filedata[offset++]; - type[2] = filedata[offset++]; - type[3] = filedata[offset++]; - sectlen = (int)filedata[offset+3]<<24 | (int)filedata[offset+2]<<16 | - (int)filedata[offset+1]<<8 | (int)filedata[offset+0]; - offset += 4; - if(sectlen != 0){ - if(strncmp(type, "TKEY", 4) == 0) - keyArray.Load(sectlen, filedata, &offset); - else if(strncmp(type, "TDAT", 4) == 0) - data.Load(sectlen, filedata, &offset); - else - offset += sectlen; - } - } - - keyArray.Update(data.chars); - - delete[] filedata; -} - -void -CText::Unload(void) -{ - CMessages::ClearAllMessagesDisplayedByGame(); - data.Unload(); - keyArray.Unload(); -} - -wchar* -CText::Get(const char *key) -{ - return keyArray.Search(key); -} - -wchar -CText::GetUpperCase(wchar c) -{ - // TODO: do this depending on encoding - if(islower(c)) - return toupper(c); - return c; -} - -void -CText::UpperCase(wchar *s) -{ - while(*s){ - *s = GetUpperCase(*s); - s++; - } -} - - -void -CKeyArray::Load(uint32 length, uint8 *data, int *offset) -{ - uint32 i; - uint8 *rawbytes; - - numEntries = length / sizeof(CKeyEntry); - entries = new CKeyEntry[numEntries]; - rawbytes = (uint8*)entries; - - for(i = 0; i < length; i++) - rawbytes[i] = data[(*offset)++]; -} - -void -CKeyArray::Unload(void) -{ - delete[] entries; - entries = nil; - numEntries = 0; -} - -void -CKeyArray::Update(wchar *chars) -{ - int i; - for(i = 0; i < numEntries; i++) - entries[i].value = (wchar*)((uint8*)chars + (uintptr)entries[i].value); -} - -CKeyEntry* -CKeyArray::BinarySearch(const char *key, CKeyEntry *entries, int16 low, int16 high) -{ - int mid; - int diff; - - if(low > high) - return nil; - - mid = (low + high)/2; - diff = strcmp(key, entries[mid].key); - if(diff == 0) - return &entries[mid]; - if(diff < 0) - return BinarySearch(key, entries, low, mid-1); - if(diff > 0) - return BinarySearch(key, entries, mid+1, high); - return nil; -} - -wchar* -CKeyArray::Search(const char *key) -{ - CKeyEntry *found; - char errstr[25]; - int i; - - found = BinarySearch(key, entries, 0, numEntries-1); - if(found) - return found->value; - sprintf(errstr, "%s missing", key); - for(i = 0; i < 25; i++) - WideErrorString[i] = errstr[i]; - return WideErrorString; -} - - -void -CData::Load(uint32 length, uint8 *data, int *offset) -{ - uint32 i; - uint8 *rawbytes; - - numChars = length / sizeof(wchar); - chars = new wchar[numChars]; - rawbytes = (uint8*)chars; - - for(i = 0; i < length; i++) - rawbytes[i] = data[(*offset)++]; -} - -void -CData::Unload(void) -{ - delete[] chars; - chars = nil; - numChars = 0; -} - -void -AsciiToUnicode(const char *src, uint16 *dst) -{ - while((*dst++ = *src++) != '\0'); -} - -char* -UnicodeToAscii(wchar *src) -{ - static char aStr[256]; - int len; - for(len = 0; src && *src != 0 && len < 256-1; len++, src++) - if(*src < 256) - aStr[len] = *src; - else - aStr[len] = '#'; - aStr[len] = '\0'; - return aStr; -} - -char* -UnicodeToAsciiForSaveLoad(wchar *src) -{ - // exact same code as above - static char aStr[256]; - int len; - for(len = 0; src && *src != 0 && len < 256-1; len++, src++) - if(*src < 256) - aStr[len] = *src; - else - aStr[len] = '#'; - aStr[len] = '\0'; - return aStr; -} - -void -UnicodeStrcpy(wchar *dst, const wchar *src) -{ - while((*dst++ = *src++) != '\0'); -} - -int -UnicodeStrlen(const wchar *str) -{ - int len; - for(len = 0; *str != 0; len++, str++); - return len; -} - -void -TextCopy(wchar *dst, const wchar *src) -{ - while((*dst++ = *src++) != '\0'); -} - - -STARTPATCHES - InjectHook(0x52C3C0, &CText::Load, PATCH_JUMP); - InjectHook(0x52C580, &CText::Unload, PATCH_JUMP); - InjectHook(0x52C5A0, &CText::Get, PATCH_JUMP); - - InjectHook(0x52BE70, &CKeyArray::Load, PATCH_JUMP); - InjectHook(0x52BF60, &CKeyArray::Unload, PATCH_JUMP); - InjectHook(0x52BF80, &CKeyArray::Update, PATCH_JUMP); - InjectHook(0x52C060, &CKeyArray::BinarySearch, PATCH_JUMP); - InjectHook(0x52BFB0, &CKeyArray::Search, PATCH_JUMP); - - InjectHook(0x52C120, &CData::Load, PATCH_JUMP); - InjectHook(0x52C200, &CData::Unload, PATCH_JUMP); -ENDPATCHES diff --git a/src/core/Text.h b/src/core/Text.h deleted file mode 100644 index f554628c..00000000 --- a/src/core/Text.h +++ /dev/null @@ -1,56 +0,0 @@ -#pragma once - -void AsciiToUnicode(const char *src, wchar *dst); -char *UnicodeToAscii(wchar *src); -char *UnicodeToAsciiForSaveLoad(wchar *src); -void UnicodeStrcpy(wchar *dst, const wchar *src); -int UnicodeStrlen(const wchar *str); -void TextCopy(wchar *dst, const wchar *src); - -struct CKeyEntry -{ - wchar *value; - char key[8]; -}; -// If this fails, CKeyArray::Load will have to be fixed -static_assert(sizeof(CKeyEntry) == 12, "CKeyEntry: error"); - -class CKeyArray -{ -public: - CKeyEntry *entries; - int numEntries; - - void Load(uint32 length, uint8 *data, int *offset); - void Unload(void); - void Update(wchar *chars); - CKeyEntry *BinarySearch(const char *key, CKeyEntry *entries, int16 low, int16 high); - wchar *Search(const char *key); -}; - -class CData -{ -public: - wchar *chars; - int numChars; - - void Load(uint32 length, uint8 *data, int *offset); - void Unload(void); -}; - -class CText -{ - CKeyArray keyArray; - CData data; - int8 encoding; -public: - CText(void); - ~CText(void); - void Load(void); - void Unload(void); - wchar *Get(const char *key); - wchar GetUpperCase(wchar c); - void UpperCase(wchar *s); -}; - -extern CText &TheText; diff --git a/src/core/User.cpp b/src/core/User.cpp index 693333b7..600fa443 100644 --- a/src/core/User.cpp +++ b/src/core/User.cpp @@ -13,8 +13,6 @@ COnscreenTimer& CUserDisplay::OnscnTimer = *(COnscreenTimer*)0x862238; CPager& CUserDisplay::Pager = *(CPager*)0x8F2744; CCurrentVehicle& CUserDisplay::CurrentVehicle = *(CCurrentVehicle*)0x8F5FE8; -WRAPPER void CPager::AddMessage(wchar*, uint16, uint16, uint16) { EAXJMP(0x52B940); } - WRAPPER void CUserDisplay::Process(void) { EAXJMP(0x4AD690); } void COnscreenTimer::Init() { diff --git a/src/core/User.h b/src/core/User.h index 27bb7f9e..90b2da55 100644 --- a/src/core/User.h +++ b/src/core/User.h @@ -1,5 +1,7 @@ #pragma once +#include "Pager.h" + class COnscreenTimerEntry { public: @@ -50,12 +52,6 @@ class CCurrentVehicle { }; -class CPager -{ -public: - void AddMessage(wchar*, uint16, uint16, uint16); -}; - class CUserDisplay { public: diff --git a/src/core/common.h b/src/core/common.h index 920b7108..a538ddb6 100644 --- a/src/core/common.h +++ b/src/core/common.h @@ -121,7 +121,7 @@ public: CRGBA(void) { } CRGBA(uint8 r, uint8 g, uint8 b, uint8 a) : r(r), g(g), b(b), a(a) { } - CRGBA &CRGBA::operator =(const CRGBA &right) + CRGBA &operator =(const CRGBA &right) { this->r = right.r; this->g = right.g; @@ -142,7 +142,7 @@ public: return rwRGBA; } - CRGBA &CRGBA::operator =(const RwRGBA &right) + CRGBA &operator =(const RwRGBA &right) { this->r = right.red; this->g = right.green; @@ -197,8 +197,6 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con #define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) #define BIT(num) (1<<(num)) -#define max(a, b) (((a) > (b)) ? (a) : (b)) -#define min(a, b) (((a) < (b)) ? (a) : (b)) #define ABS(a) (((a) < 0) ? (-(a)) : (a)) #define norm(value, min, max) (((value) < (min)) ? 0 : (((value) > (max)) ? 1 : (((value) - (min)) / ((max) - (min))))) @@ -337,7 +335,7 @@ inline void SkipSaveBuf(uint8 *&buf, int32 skip) template<typename T> inline const T ReadSaveBuf(uint8 *&buf) -{
+{ T &value = *(T*)buf; SkipSaveBuf(buf, sizeof(T)); return value; @@ -345,8 +343,8 @@ inline const T ReadSaveBuf(uint8 *&buf) template<typename T> inline T *WriteSaveBuf(uint8 *&buf, const T &value) -{
- T *p = (T*)buf;
+{ + T *p = (T*)buf; *p = value; SkipSaveBuf(buf, sizeof(T)); return p; @@ -355,11 +353,11 @@ inline T *WriteSaveBuf(uint8 *&buf, const T &value) #define SAVE_HEADER_SIZE (4*sizeof(char)+sizeof(uint32)) -#define WriteSaveHeader(buf,a,b,c,d,size) \
- WriteSaveBuf(buf, a);\
- WriteSaveBuf(buf, b);\
- WriteSaveBuf(buf, c);\
- WriteSaveBuf(buf, d);\
+#define WriteSaveHeader(buf,a,b,c,d,size) \ + WriteSaveBuf(buf, a);\ + WriteSaveBuf(buf, b);\ + WriteSaveBuf(buf, c);\ + WriteSaveBuf(buf, d);\ WriteSaveBuf(buf, size); #define CheckSaveHeader(buf,a,b,c,d,size)\ diff --git a/src/core/config.h b/src/core/config.h index 08ddd007..12cb7be8 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -67,6 +67,7 @@ enum Config { NUMANTENNAS = 8, NUMCORONAS = 56, NUMPOINTLIGHTS = 32, + NUM3DMARKERS = 32, NUMMONEYMESSAGES = 16, NUMPICKUPMESSAGES = 16, diff --git a/src/core/re3.cpp b/src/core/re3.cpp index c8b50d55..62e9a040 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -18,6 +18,7 @@ #include "Automobile.h" #include "Ped.h" #include "debugmenu_public.h" +#include "Particle.h" #include <vector> #include <list> @@ -352,6 +353,7 @@ DebugMenuPopulate(void) DebugMenuAddCmd("Debug", "Make peds follow you in formation", LetThemFollowYou); #ifndef MASTER DebugMenuAddVarBool8("Debug", "Toggle unused fight feature", (int8*)&CPed::bUnusedFightThingOnPlayer, nil); + DebugMenuAddVarBool8("Debug", "Toggle banned particles", (int8*)&CParticle::bEnableBannedParticles, nil); #endif DebugMenuAddCmd("Debug", "Start Credits", CCredits::Start); |