diff options
58 files changed, 566 insertions, 268 deletions
@@ -353,4 +353,8 @@ vendor/glew-2.1.0/ vendor/glfw-3.3.2.bin.WIN32/ vendor/glfw-3.3.2.bin.WIN64/ -sdk/
\ No newline at end of file +sdk/ + +codewarrior/reVC_Data/ +codewarrior/Release/ +codewarrior/Debug/
\ No newline at end of file diff --git a/codewarrior/Debug/gta-vc.txt b/codewarrior/Debug/gta-vc.txt new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/codewarrior/Debug/gta-vc.txt diff --git a/codewarrior/Release/gta-vc.txt b/codewarrior/Release/gta-vc.txt new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/codewarrior/Release/gta-vc.txt diff --git a/codewarrior/reVC.mcp b/codewarrior/reVC.mcp Binary files differnew file mode 100644 index 00000000..00b3fd74 --- /dev/null +++ b/codewarrior/reVC.mcp diff --git a/src/animation/AnimBlendAssocGroup.cpp b/src/animation/AnimBlendAssocGroup.cpp index 8fc2a8dc..7c0a10d4 100644 --- a/src/animation/AnimBlendAssocGroup.cpp +++ b/src/animation/AnimBlendAssocGroup.cpp @@ -1,7 +1,11 @@ #include "common.h" #if defined _WIN32 && !defined __MINGW32__ +#if defined __MWERKS__ +#include <wctype.h> +#else #include "ctype.h" +#endif #else #include <cwctype> #endif @@ -89,18 +93,18 @@ strcmpIgnoringDigits(const char *s1, const char *s2) if(c1) s1++; if(c2) s2++; if(c1 == '\0' && c2 == '\0') return true; -#if defined _WIN32 && !defined __MINGW32__ - if(__ascii_iswdigit(c1) && __ascii_iswdigit(c2)) -#else +#ifndef ASCII_STRCMP if(iswdigit(c1) && iswdigit(c2)) +#else + if(__ascii_iswdigit(c1) && __ascii_iswdigit(c2)) #endif continue; -#if defined _WIN32 && !defined __MINGW32__ - c1 = __ascii_toupper(c1); - c2 = __ascii_toupper(c2); -#else +#ifndef ASCII_STRCMP c1 = toupper(c1); c2 = toupper(c2); +#else + c1 = __ascii_toupper(c1); + c2 = __ascii_toupper(c2); #endif if(c1 && c2 && c1 != c2) diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index 36b9eb11..457e09c0 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -1,4 +1,4 @@ -#include "common.h" +#include "common.h" #include "AudioManager.h" #include "audio_enums.h" @@ -43,7 +43,7 @@ #include "Script.h" #include "Wanted.h" -const int channels = ARRAY_SIZE(cAudioManager::m_asActiveSamples); +const int channels = ARRAY_SIZE(AudioManager.m_asActiveSamples); const int policeChannel = channels + 1; const int allChannels = channels + 2; @@ -8115,7 +8115,7 @@ cAudioManager::ProcessWaterCannon(int32) } //positon of arcade machines -CVector aVecExtraSoundPosition[] = { {-1042.546f, 88.794f, 11.324f}, {-1004.476f, 181.697f, 11.324f} }; +CVector aVecExtraSoundPosition[] = { CVector(-1042.546f, 88.794f, 11.324f), CVector(-1004.476f, 181.697f, 11.324f) }; void cAudioManager::ProcessExtraSounds() diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index 721a7acc..2304b4c4 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -14,7 +14,7 @@ cAudioManager AudioManager; -const int channels = ARRAY_SIZE(cAudioManager::m_asActiveSamples); +const int channels = ARRAY_SIZE(AudioManager.m_asActiveSamples); const int policeChannel = channels + 1; const int allChannels = channels + 2; diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h index f715fb45..2eb2220b 100644 --- a/src/audio/AudioManager.h +++ b/src/audio/AudioManager.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "audio_enums.h" #include "AudioCollision.h" diff --git a/src/audio/AudioSamples.h b/src/audio/AudioSamples.h index 159809d0..403ef684 100644 --- a/src/audio/AudioSamples.h +++ b/src/audio/AudioSamples.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "common.h" diff --git a/src/audio/PoliceRadio.cpp b/src/audio/PoliceRadio.cpp index edfb8a7c..b8f44f60 100644 --- a/src/audio/PoliceRadio.cpp +++ b/src/audio/PoliceRadio.cpp @@ -15,7 +15,7 @@ #include "sampman.h" #include "Wanted.h" -const int channels = ARRAY_SIZE(cAudioManager::m_asActiveSamples); +const int channels = ARRAY_SIZE(AudioManager.m_asActiveSamples); const int policeChannel = channels + 1; struct tPoliceRadioZone { diff --git a/src/audio/sampman_miles.cpp b/src/audio/sampman_miles.cpp index d78c6d84..bf91a874 100644 --- a/src/audio/sampman_miles.cpp +++ b/src/audio/sampman_miles.cpp @@ -1,3 +1,5 @@ +#include "common.h" + #ifdef AUDIO_MSS #include <shlobj.h> #include <shlguid.h> @@ -8,7 +10,6 @@ #include "eax-util.h" #include "mss.h" -#include "common.h" #include "sampman.h" #include "AudioManager.h" #include "MusicManager.h" diff --git a/src/audio/soundlist.h b/src/audio/soundlist.h index 98982f61..4d88590e 100644 --- a/src/audio/soundlist.h +++ b/src/audio/soundlist.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once enum eSound { diff --git a/src/control/OnscreenTimer.cpp b/src/control/OnscreenTimer.cpp index 08e6fa3f..53ed14c7 100644 --- a/src/control/OnscreenTimer.cpp +++ b/src/control/OnscreenTimer.cpp @@ -14,7 +14,7 @@ void COnscreenTimer::Init() { for(uint32 i = 0; i < NUMONSCREENCOUNTERS; i++) { m_sCounters[i].m_nCounterOffset = 0; - for(uint32 j = 0; j < ARRAY_SIZE(COnscreenCounterEntry::m_aCounterText); j++) { + for(uint32 j = 0; j < ARRAY_SIZE(m_sCounters[0].m_aCounterText); j++) { m_sCounters[i].m_aCounterText[j] = 0; } @@ -24,7 +24,7 @@ void COnscreenTimer::Init() { for(uint32 i = 0; i < NUMONSCREENCLOCKS; i++) { m_sClocks[i].m_nClockOffset = 0; - for(uint32 j = 0; j < ARRAY_SIZE(COnscreenTimerEntry::m_aClockText); j++) { + for(uint32 j = 0; j < ARRAY_SIZE(m_sClocks[0].m_aClockText); j++) { m_sClocks[i].m_aClockText[j] = 0; } @@ -92,7 +92,7 @@ void COnscreenTimer::AddCounter(uint32 offset, uint16 type, char* text, uint16 p m_sCounters[pos].m_nCounterOffset = offset; if(text) { - strncpy(m_sCounters[pos].m_aCounterText, text, ARRAY_SIZE(COnscreenCounterEntry::m_aCounterText)); + strncpy(m_sCounters[pos].m_aCounterText, text, ARRAY_SIZE(m_sCounters[0].m_aCounterText)); } else { m_sCounters[pos].m_aCounterText[0] = 0; } @@ -114,7 +114,7 @@ void COnscreenTimer::AddClock(uint32 offset, char* text, bool bGoingDown) { m_sClocks[i].m_nClockOffset = offset; m_sClocks[i].m_bClockGoingDown = bGoingDown; if(text) { - strncpy(m_sClocks[i].m_aClockText, text, ARRAY_SIZE(COnscreenTimerEntry::m_aClockText)); + strncpy(m_sClocks[i].m_aClockText, text, ARRAY_SIZE(m_sClocks[0].m_aClockText)); } else { m_sClocks[i].m_aClockText[0] = 0; } diff --git a/src/control/Pickups.h b/src/control/Pickups.h index 08fb2bc8..fd8b15cd 100644 --- a/src/control/Pickups.h +++ b/src/control/Pickups.h @@ -147,7 +147,7 @@ public: class CPacManPickups { - friend CPacManPickup; + friend class CPacManPickup; static CPacManPickup aPMPickUps[NUMPACMANPICKUPS]; static CVector LastPickUpCoors; diff --git a/src/control/RoadBlocks.cpp b/src/control/RoadBlocks.cpp index f75b4f50..4f714e80 100644 --- a/src/control/RoadBlocks.cpp +++ b/src/control/RoadBlocks.cpp @@ -55,8 +55,8 @@ CRoadBlocks::Init(void) void CRoadBlocks::GenerateRoadBlockCopsForCar(CVehicle* pVehicle, int32 roadBlockType) { - static const CVector vecRoadBlockOffets[6] = { {-1.5, 1.8f, 0.0f}, {-1.5f, -1.8f, 0.0f}, {1.5f, 1.8f, 0.0f}, - {1.5f, -1.8f, 0.0f}, {-1.5f, 0.0f, 0.0f}, {1.5, 0.0, 0.0} }; + static const CVector vecRoadBlockOffets[6] = { CVector(-1.5, 1.8f, 0.0f), CVector(-1.5f, -1.8f, 0.0f), CVector(1.5f, 1.8f, 0.0f), + CVector(1.5f, -1.8f, 0.0f), CVector(-1.5f, 0.0f, 0.0f), CVector(1.5, 0.0, 0.0) }; CEntity* pEntityToAttack = (CEntity*)FindPlayerVehicle(); if (!pEntityToAttack) pEntityToAttack = (CEntity*)FindPlayerPed(); diff --git a/src/control/Script5.cpp b/src/control/Script5.cpp index 74d187ca..502bc005 100644 --- a/src/control/Script5.cpp +++ b/src/control/Script5.cpp @@ -2665,7 +2665,7 @@ bool CTheScripts::IsPedStopped(CPed* pPed) { if (pPed->InVehicle()) return IsVehicleStopped(pPed->m_pMyVehicle); - return (pPed->m_nMoveState == eMoveState::PEDMOVE_NONE || pPed->m_nMoveState == eMoveState::PEDMOVE_STILL) && + return (pPed->m_nMoveState == PEDMOVE_NONE || pPed->m_nMoveState == PEDMOVE_STILL) && !pPed->bIsInTheAir && !pPed->bIsLanding && pPed->bIsStanding && pPed->m_vecAnimMoveDelta.x == 0.0f && pPed->m_vecAnimMoveDelta.y == 0.0f; } @@ -2679,7 +2679,7 @@ bool CTheScripts::IsPlayerStopped(CPlayerInfo* pPlayer) RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_JUMP_LAUNCH) || RpAnimBlendClumpGetAssociation(pPed->GetClump(), ANIM_JUMP_GLIDE)) return false; - return (pPed->m_nMoveState == eMoveState::PEDMOVE_NONE || pPed->m_nMoveState == eMoveState::PEDMOVE_STILL) && + return (pPed->m_nMoveState == PEDMOVE_NONE || pPed->m_nMoveState == PEDMOVE_STILL) && !pPed->bIsInTheAir && !pPed->bIsLanding && pPed->bIsStanding && pPed->m_vecAnimMoveDelta.x == 0.0f && pPed->m_vecAnimMoveDelta.y == 0.0f; } diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp index 753254e0..4895ef6e 100644 --- a/src/core/Cam.cpp +++ b/src/core/Cam.cpp @@ -951,7 +951,7 @@ CVector CCam::DoAverageOnVector(const CVector &vec) { int i; - CVector Average = { 0.0f, 0.0f, 0.0f }; + CVector Average = CVector(0.0f, 0.0f, 0.0f); if(ResetStatics){ m_iRunningVectorArrayPos = 0; @@ -4033,7 +4033,7 @@ CCam::Process_Debug(const CVector&, float, float, float) if(CPad::GetPad(1)->GetLeftShockJustDown() && gbBigWhiteDebugLightSwitchedOn) CShadows::StoreShadowToBeRendered(SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &Source, 12.0f, 0.0f, 0.0f, -12.0f, - 128, 128, 128, 128, 1000.0f, false, 1.0f); + 128, 128, 128, 128, 1000.0f, false, 1.0f, nil, 1.0f); if(CHud::m_Wants_To_Draw_Hud){ char str[256]; diff --git a/src/core/CdStream.cpp b/src/core/CdStream.cpp index 4bb31ea4..da85a238 100644 --- a/src/core/CdStream.cpp +++ b/src/core/CdStream.cpp @@ -7,9 +7,6 @@ #include "RwHelper.h" #include "MemoryMgr.h" -#define CDDEBUG(f, ...) debug ("%s: " f "\n", "cdvd_stream", ## __VA_ARGS__) -#define CDTRACE(f, ...) printf("%s: " f "\n", "cdvd_stream", ## __VA_ARGS__) - struct CdReadInfo { uint32 nSectorOffset; @@ -60,7 +57,7 @@ CdStreamInitThread(void) if ( gpReadInfo[i].hSemaphore == nil ) { - CDTRACE("failed to create sync semaphore"); + printf("%s: failed to create sync semaphore\n", "cdvd_stream"); ASSERT(0); return; } @@ -81,7 +78,7 @@ CdStreamInitThread(void) if ( gCdStreamSema == nil ) { - CDTRACE("failed to create stream semaphore"); + printf("%s: failed to create stream semaphore\n", "cdvd_stream"); ASSERT(0); return; } @@ -90,7 +87,7 @@ CdStreamInitThread(void) if ( _gCdStreamThread == nil ) { - CDTRACE("failed to create streaming thread"); + printf("%s: failed to create streaming thread\n", "cdvd_stream"); ASSERT(0); return; } @@ -138,7 +135,7 @@ CdStreamInit(int32 numChannels) gpReadInfo = (CdReadInfo *)LocalAlloc(LMEM_ZEROINIT, sizeof(CdReadInfo) * numChannels); ASSERT( gpReadInfo != nil ); - CDDEBUG("read info %p", gpReadInfo); + debug("%s: read info %p\n", "cdvd_stream", gpReadInfo); CdStreamAddImage("MODELS\\GTA3.IMG"); diff --git a/src/core/ControllerConfig.cpp b/src/core/ControllerConfig.cpp index 64663b81..23e86a79 100644 --- a/src/core/ControllerConfig.cpp +++ b/src/core/ControllerConfig.cpp @@ -541,7 +541,7 @@ void CControllerConfigManager::UpdateJoyInConfigMenus_ButtonDown(int32 button, i break; case 12: #ifndef REGISTER_START_BUTTON - if (padNumber == 1) + if (padnumber == 1) #endif pad->PCTempJoyState.Start = 255; break; diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index 3a2d3b59..df00efde 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -1000,7 +1000,9 @@ CMenuManager::DrawStandardMenus(bool activeScreen) } wchar unicodeTemp[64]; +#ifdef ASPECT_RATIO_SCALE char asciiTemp[32]; +#endif bool weHaveLabel = aScreens[m_nCurrScreen].m_aEntries[0].m_Action == MENUACTION_LABEL; uint8 section = 0; // 0: highlight trapezoid 1: texts diff --git a/src/core/General.h b/src/core/General.h index 1ea7f2bd..2f205c39 100644 --- a/src/core/General.h +++ b/src/core/General.h @@ -133,7 +133,7 @@ public: static bool faststricmp(const char *str1, const char *str2) { for (; *str1; str1++, str2++) { -#if MUCH_SLOWER || !defined _WIN32 || defined __MINGW32__ +#ifndef ASCII_STRCMP if (toupper(*str1) != toupper(*str2)) #else if (__ascii_toupper(*str1) != __ascii_toupper(*str2)) diff --git a/src/core/Placeable.h b/src/core/Placeable.h index 22f7583c..b0f9a15a 100644 --- a/src/core/Placeable.h +++ b/src/core/Placeable.h @@ -4,7 +4,7 @@ class CPlaceable { public: // disable allocation - static void *operator new(size_t) = delete; + static void *operator new(size_t); CMatrix m_matrix; diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp index 96095d4f..f1bc1655 100644 --- a/src/core/Radar.cpp +++ b/src/core/Radar.cpp @@ -1,3 +1,6 @@ +#if (!defined(GTA_PS2_STUFF) && defined(RWLIBS)) || defined(__MWERKS__) +#define WITHD3D +#endif #include "config.h" #include "common.h" @@ -387,10 +390,10 @@ void CRadar::ClearBlipForEntity(eBlipType type, int32 id) int CRadar::ClipRadarPoly(CVector2D *poly, const CVector2D *rect) { CVector2D corners[4] = { - { 1.0f, -1.0f }, // top right - { 1.0f, 1.0f }, // bottom right - { -1.0f, 1.0f }, // bottom left - { -1.0f, -1.0f }, // top left + CVector2D( 1.0f, -1.0f ), // top right + CVector2D( 1.0f, 1.0f ), // bottom right + CVector2D( -1.0f, 1.0f ), // bottom left + CVector2D( -1.0f, -1.0f ), // top left }; CVector2D tmp; int i, j, n; diff --git a/src/core/Ropes.cpp b/src/core/Ropes.cpp index dbae9ee3..ffce36f9 100644 --- a/src/core/Ropes.cpp +++ b/src/core/Ropes.cpp @@ -116,7 +116,7 @@ CRopes::RegisterRope(uintptr id, CVector pos, bool setUpdateTimer) aRopes[i].m_unk = false; aRopes[i].m_bWasRegistered = true; aRopes[i].m_updateTimer = setUpdateTimer ? CTimer::GetTimeInMilliseconds() + 20000 : 0; - for(j = 1; j < ARRAY_SIZE(CRope::m_pos); j++){ + for(j = 1; j < ARRAY_SIZE(aRopes[0].m_pos); j++){ if(j & 1) aRopes[i].m_pos[j] = aRopes[i].m_pos[j-1] + CVector(0.0f, 0.0f, 0.625f); else @@ -147,7 +147,7 @@ CRopes::FindCoorsAlongRope(uintptr id, float t, CVector *coors) float f; for(i = 0; i < ARRAY_SIZE(aRopes); i++) if(aRopes[i].m_bActive && aRopes[i].m_id == id){ - t = (ARRAY_SIZE(CRope::m_pos)-1)*clamp(t, 0.0f, 0.999f); + t = (ARRAY_SIZE(aRopes[0].m_pos)-1)*clamp(t, 0.0f, 0.999f); j = t; f = t - j; *coors = (1.0f-f)*aRopes[i].m_pos[j] + f*aRopes[i].m_pos[j+1]; diff --git a/src/core/Stats.h b/src/core/Stats.h index 7fa69396..243ff0ec 100644 --- a/src/core/Stats.h +++ b/src/core/Stats.h @@ -21,7 +21,7 @@ public: static int32 NumberKillFrenziesPassed; static int32 PeopleKilledByOthers; static int32 HelisDestroyed; - static int32 PedsKilledOfThisType[ePedType::NUM_PEDTYPES]; + static int32 PedsKilledOfThisType[NUM_PEDTYPES]; static int32 TimesDied; static int32 TimesArrested; static int32 KillsSinceLastCheckpoint; diff --git a/src/core/common.h b/src/core/common.h index b059b8b7..65f43aae 100644 --- a/src/core/common.h +++ b/src/core/common.h @@ -7,10 +7,19 @@ #pragma warning(disable: 4838) // narrowing conversion #pragma warning(disable: 4996) // POSIX names +#ifdef __MWERKS__ +#define __STDC_LIMIT_MACROS // so we get UINT32_MAX etc +#endif + #include <stdint.h> #include <string.h> #include <math.h> +#ifdef __MWERKS__ +#define AUDIO_MSS +#define RWLIBS // codewarrior doesn't support project level defines - so not even this is enough, but still catches most ifdefs +#endif + #if !defined RW_D3D9 && defined LIBRW #undef WITHD3D #undef WITHDINPUT @@ -29,9 +38,9 @@ #define WITH_D3D // librw includes d3d9 itself via this right now #else #ifndef USE_D3D9 - #include <d3d8types.h> + #include <d3d8.h> #else - #include <d3d9types.h> + #include <d3d9.h> #endif #endif #endif @@ -79,8 +88,13 @@ typedef uint8_t uint8; typedef int8_t int8; typedef uint16_t uint16; typedef int16_t int16; +#ifndef __MWERKS__ typedef uint32_t uint32; typedef int32_t int32; +#else +typedef unsigned int uint32; +typedef int int32; +#endif typedef uintptr_t uintptr; typedef intptr_t intptr; typedef uint64_t uint64; @@ -92,7 +106,7 @@ typedef uint8 bool8; typedef uint16 bool16; typedef uint32 bool32; -#if defined(_MSC_VER) +#if defined(_MSC_VER) || defined (__MWERKS__) typedef ptrdiff_t ssize_t; #endif @@ -290,6 +304,22 @@ extern wchar *AllocUnicode(const char*src); inline float sq(float x) { return x*x; } #define SQR(x) ((x) * (x)) +#ifdef __MWERKS__ +#define M_E 2.71828182845904523536 // e +#define M_LOG2E 1.44269504088896340736 // log2(e) +#define M_LOG10E 0.434294481903251827651 // log10(e) +#define M_LN2 0.693147180559945309417 // ln(2) +#define M_LN10 2.30258509299404568402 // ln(10) +#define M_PI 3.14159265358979323846 // pi +#define M_PI_2 1.57079632679489661923 // pi/2 +#define M_PI_4 0.785398163397448309616 // pi/4 +#define M_1_PI 0.318309886183790671538 // 1/pi +#define M_2_PI 0.636619772367581343076 // 2/pi +#define M_2_SQRTPI 1.12837916709551257390 // 2/sqrt(pi) +#define M_SQRT2 1.41421356237309504880 // sqrt(2) +#define M_SQRT1_2 0.707106781186547524401 // 1/sqrt(2) +#endif + #define PI (float)M_PI #define TWOPI (PI*2) #define HALFPI (PI/2) @@ -319,14 +349,34 @@ void re3_usererror(const char *format, ...); #define DEV(f, ...) re3_debug("[DEV]: " f, ## __VA_ARGS__) #endif +#ifdef __MWERKS__ +void debug(char *f, ...); +void Error(char *f, ...); +__inline__ void TRACE(char *f, ...) { } // this is re3 only, and so the function needs to be inline - this way no call actually gets placed +// USERERROR only gets used in oal builds ... once +#else #define debug(f, ...) re3_debug("[DBG]: " f, ## __VA_ARGS__) -#define TRACE(f, ...) re3_trace(__FILE__, __LINE__, __FUNCTION__, f, ## __VA_ARGS__) #define Error(f, ...) re3_debug("[ERROR]: " f, ## __VA_ARGS__) +#ifndef MASTER +#define TRACE(f, ...) re3_trace(__FILE__, __LINE__, __FUNCTION__, f, ## __VA_ARGS__) #define USERERROR(f, ...) re3_usererror(f, ## __VA_ARGS__) +#else +#define TRACE(f, ...) +#define USERERROR(f, ...) +#endif +#endif +#ifndef MASTER #define assert(_Expression) (void)( (!!(_Expression)) || (re3_assert(#_Expression, __FILE__, __LINE__, __FUNCTION__), 0) ) +#else +#define assert(_Expression) +#endif #define ASSERT assert +#ifdef __MWERKS__ +#define static_assert(bool_constexpr, message) +#endif + #define _TODO(x) #define _TODOCONST(x) (x) @@ -350,6 +400,7 @@ void re3_usererror(const char *format, ...); #define CONCAT_(x,y) x##y #define CONCAT(x,y) CONCAT_(x,y) +#ifdef DEBUGMENU // Tweaking stuff for debugmenu #define TWEAKPATH ___tw___TWEAKPATH #define SETTWEAKPATH(path) static const char *___tw___TWEAKPATH = path; @@ -463,6 +514,7 @@ _TWEEKCLASS(CTweakUInt32, uint32); _TWEEKCLASS(CTweakFloat, float); #undef _TWEEKCLASS +#endif #ifdef VALIDATE_SAVE_SIZE extern int32 _saveBufCount; diff --git a/src/core/config.h b/src/core/config.h index 2685c687..c5799817 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -1,5 +1,8 @@ #pragma once +// disables (most) stuff that wasn't in original gta-vc.exe - check section at the bottom of this file +//#define VANILLA_DEFINES + enum Config { NUMPLAYERS = 1, @@ -404,3 +407,87 @@ static_assert(false, "SUPPORT_XBOX_SCRIPT and SUPPORT_MOBILE_SCRIPT are mutually #undef PS2_ALPHA_TEST #undef NO_ISLAND_LOADING #endif + +#if defined __MWERKS__ || defined VANILLA_DEFINES +#define FINAL +#undef CHATTYSPLASH +#undef TIMEBARS + +#define MASTER +#undef VALIDATE_SAVE_SIZE +#undef NO_MOVIES +#undef DEBUGMENU + +#undef DRAW_GAME_VERSION_TEXT + +//#undef NASTY_GAME +//#undef NO_CDCHECK + +#undef GTA_PS2_STUFF +#undef USE_PS2_RAND +#undef RANDOMSPLASH +#undef PS2_MATFX + +#undef FIX_BUGS +#define THIS_IS_STUPID +#undef MORE_LANGUAGES +#undef COMPATIBLE_SAVES +#undef LOAD_INI_SETTINGS +#undef FIX_HIGH_FPS_BUGS_ON_FRONTEND + +#undef ASPECT_RATIO_SCALE +#undef PROPER_SCALING +//#undef DEFAULT_NATIVE_RESOLUTION +#undef PS2_ALPHA_TEST +#undef IMPROVED_VIDEOMODE +#undef DISABLE_LOADING_SCREEN +#undef DISABLE_VSYNC_ON_TEXTURE_CONVERSION + +#undef FIX_SPRITES + +#define PC_WATER +#undef WATER_CHEATS + +#undef USE_CUTSCENE_SHADOW_FOR_PED +#undef DISABLE_CUTSCENE_SHADOWS + +#undef XINPUT +#undef DETECT_PAD_INPUT_SWITCH +#undef KANGAROO_CHEAT +#undef RESTORE_ALLCARSHELI_CHEAT +#undef BETTER_ALLCARSAREDODO_CHEAT +#undef WALLCLIMB_CHEAT +#undef REGISTER_START_BUTTON +#undef BIND_VEHICLE_FIREWEAPON +#undef BUTTON_ICONS + +#undef FIX_RADAR + +#undef MAP_ENHANCEMENTS +#undef MUCH_SHORTER_OUTRO_SCREEN +#undef CUSTOM_FRONTEND_OPTIONS + +#undef GRAPHICS_MENU_OPTIONS +#undef NO_ISLAND_LOADING +#undef CUTSCENE_BORDERS_SWITCH +#undef MULTISAMPLING +#undef INVERT_LOOK_FOR_PAD + +#undef USE_DEBUG_SCRIPT_LOADER +#undef USE_MEASUREMENTS_IN_METERS +#undef USE_PRECISE_MEASUREMENT_CONVERTION +#undef SUPPORT_JAPANESE_SCRIPT +#undef MISSION_REPLAY +#undef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT +#undef USE_BASIC_SCRIPT_DEBUG_OUTPUT + +#define DONT_FIX_REPLAY_BUGS + +#undef EXPLODING_AIRTRAIN +#undef CPLANE_ROTORS +#undef CAMERA_PICKUP +#undef CANCELLABLE_CAR_ENTER +#undef IMPROVED_CAMERA +#undef FREE_CAM +#undef BIG_IMG +#endif diff --git a/src/core/main.cpp b/src/core/main.cpp index 824255f6..c3286ea9 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -144,6 +144,24 @@ bool gbNewRenderer = true; bool bDisplayNumOfAtomicsRendered = false; bool bDisplayPosn = false; +#ifdef __MWERKS__ +void +debug(char *fmt, ...) +{ +#ifndef MASTER + // TODO put something here +#endif +} + +void +Error(char *fmt, ...) +{ +#ifndef MASTER + // TODO put something here +#endif +} +#endif + void ValidateVersion() { @@ -813,6 +831,7 @@ ProcessSlowMode(void) float FramesPerSecondCounter; int32 FrameSamples; +#ifndef MASTER struct tZonePrint { char name[11]; @@ -843,8 +862,6 @@ tZonePrint ZonePrint[] = { "WASHINBTM", "AC", CRect(-255.0f, -1200.0f, 500.0f, -1690.0f)} }; -#ifndef MASTER - void PrintMemoryUsage(void) { diff --git a/src/core/re3.cpp b/src/core/re3.cpp index 25e3e849..4a2dfe00 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -1025,9 +1025,13 @@ extern bool gbRenderDebugEnvMap; } #endif +#ifndef __MWERKS__ +#ifndef MASTER const int re3_buffsize = 1024; static char re3_buff[re3_buffsize]; +#endif +#ifndef MASTER void re3_assert(const char *expr, const char *filename, unsigned int lineno, const char *func) { #ifdef _WIN32 @@ -1081,9 +1085,11 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con assert(false); #endif } +#endif void re3_debug(const char *format, ...) { +#ifndef MASTER va_list va; va_start(va, format); #ifdef _WIN32 @@ -1095,8 +1101,10 @@ void re3_debug(const char *format, ...) printf("%s", re3_buff); CDebug::DebugAddText(re3_buff); +#endif } +#ifndef MASTER void re3_trace(const char *filename, unsigned int lineno, const char *func, const char *format, ...) { char buff[re3_buffsize *2]; @@ -1136,6 +1144,8 @@ void re3_usererror(const char *format, ...) assert(false); #endif } +#endif +#endif #ifdef VALIDATE_SAVE_SIZE int32 _saveBufCount; diff --git a/src/entities/Physical.cpp b/src/entities/Physical.cpp index de60c400..7be5df23 100644 --- a/src/entities/Physical.cpp +++ b/src/entities/Physical.cpp @@ -1288,7 +1288,7 @@ CPhysical::ProcessShiftSectorList(CPtrList *lists) int numCollisions; int mostColliding; CColPoint colpoints[MAX_COLLISION_POINTS]; - CVector shift = { 0.0f, 0.0f, 0.0f }; + CVector shift = CVector(0.0f, 0.0f, 0.0f); bool doShift = false; CEntity *boat = nil; @@ -1747,8 +1747,8 @@ CPhysical::ProcessCollisionSectorList(CPtrList *lists) if(numCollisions <= 0) continue; - CVector moveSpeed = { 0.0f, 0.0f, 0.0f }; - CVector turnSpeed = { 0.0f, 0.0f, 0.0f }; + CVector moveSpeed = CVector(0.0f, 0.0f, 0.0f); + CVector turnSpeed = CVector(0.0f, 0.0f, 0.0f); float maxImpulseA = 0.0f; numResponses = 0; if(A->bHasContacted){ @@ -2232,8 +2232,8 @@ CPhysical::ProcessCollision(void) }else if(IsObject() && ((CObject*)this)->ObjectCreatedBy != TEMP_OBJECT){ int responsecase = ((CObject*)this)->m_nSpecialCollisionResponseCases; if(responsecase == COLLRESPONSE_LAMPOST){ - CVector speedUp = { 0.0f, 0.0f, 0.0f }; - CVector speedDown = { 0.0f, 0.0f, 0.0f }; + CVector speedUp = CVector(0.0f, 0.0f, 0.0f); + CVector speedDown = CVector(0.0f, 0.0f, 0.0f); CColModel *colModel = GetColModel(); speedUp.z = colModel->boundingBox.max.z; speedDown.z = colModel->boundingBox.min.z; diff --git a/src/modelinfo/SimpleModelInfo.cpp b/src/modelinfo/SimpleModelInfo.cpp index dee483f9..8d0ea677 100644 --- a/src/modelinfo/SimpleModelInfo.cpp +++ b/src/modelinfo/SimpleModelInfo.cpp @@ -4,6 +4,7 @@ #include "General.h" #include "Renderer.h" #include "Camera.h" +#include "Renderer.h" #include "ModelInfo.h" #include "AnimManager.h" #include "custompipes.h" diff --git a/src/peds/PedAI.cpp b/src/peds/PedAI.cpp index 105cdbef..cf566aba 100644 --- a/src/peds/PedAI.cpp +++ b/src/peds/PedAI.cpp @@ -4138,7 +4138,7 @@ CPed::SetExitBoat(CVehicle *boat) RemoveInCarAnims(); CColModel* boatCol = boat->GetColModel(); if (boat->IsUpsideDown()) { - newPos = { 0.0f, 0.0f, boatCol->boundingBox.min.z }; + newPos = CVector(0.0f, 0.0f, boatCol->boundingBox.min.z); newPos = boat->GetMatrix() * newPos; newPos.z += 1.0f; m_vehDoor = CAR_DOOR_RF; diff --git a/src/peds/PedAttractor.cpp b/src/peds/PedAttractor.cpp index 22e0e779..de587270 100644 --- a/src/peds/PedAttractor.cpp +++ b/src/peds/PedAttractor.cpp @@ -104,7 +104,7 @@ bool CVehicleToEffect::HasThisEffect(C2dEffect* pEffect) const const C2dEffect* CPedAttractorManager::GetEffectForIceCreamVan(CVehicle* pVehicle, const CVector& pos) { if (!vVehicleToEffect.empty()) { - for (std::vector<CVehicleToEffect>::const_iterator assoc = vVehicleToEffect.cbegin(); assoc != vVehicleToEffect.cend(); ++assoc) { + for (std::vector<CVehicleToEffect>::const_iterator assoc = vVehicleToEffect.begin(); assoc != vVehicleToEffect.end(); ++assoc) { if (assoc->GetVehicle() == pVehicle) return assoc->ChooseEffect(pos); } @@ -120,7 +120,7 @@ CVehicle* CPedAttractorManager::GetIceCreamVanForEffect(C2dEffect* pEffect) { if (vVehicleToEffect.empty()) return nil; - for (std::vector<CVehicleToEffect>::const_iterator assoc = vVehicleToEffect.cbegin(); assoc != vVehicleToEffect.cend(); ++assoc) { + for (std::vector<CVehicleToEffect>::const_iterator assoc = vVehicleToEffect.begin(); assoc != vVehicleToEffect.end(); ++assoc) { if (assoc->HasThisEffect(pEffect)) return assoc->GetVehicle(); } @@ -131,7 +131,7 @@ const CPedAttractor* CPedAttractorManager::FindAssociatedAttractor(const C2dEffe { if (vecAttractors.empty()) return nil; - for (std::vector<CPedAttractor*>::const_iterator attractor = vecAttractors.cbegin(); attractor != vecAttractors.cend(); ++attractor) { + for (std::vector<CPedAttractor*>::const_iterator attractor = vecAttractors.begin(); attractor != vecAttractors.end(); ++attractor) { if ((*attractor)->GetEffect() == pEffect) return *attractor; } @@ -145,7 +145,7 @@ void CPedAttractorManager::RemoveIceCreamVanEffects(C2dEffect* pEffect) return; if (vVehicleToEffect.empty()) return; - for (std::vector<CVehicleToEffect>::const_iterator assoc = vVehicleToEffect.cbegin(); assoc != vVehicleToEffect.cend();) { + for (std::vector<CVehicleToEffect>::iterator assoc = vVehicleToEffect.begin(); assoc != vVehicleToEffect.end();) { if (assoc->GetVehicle() != pVehicle) { ++assoc; continue; @@ -229,7 +229,7 @@ CVector CPedShelterAttractor::GetDisplacement(int32 qid) const float fRandomOffset = CGeneral::GetRandomNumberInRange(0.0f, 2.0f); CVector vecDisplacement(fRandomOffset * Sin(fRandomAngle), fRandomOffset * Cos(fRandomAngle), 0.0f); bool close = false; - for (std::vector<CVector>::const_iterator v = ms_displacements.cbegin(); v != ms_displacements.cend(); ++v) { + for (std::vector<CVector>::const_iterator v = ms_displacements.begin(); v != ms_displacements.end(); ++v) { if ((*v - vecDisplacement).Magnitude() < 1.0f) { close = true; break; @@ -265,7 +265,7 @@ void CPedShelterAttractor::ComputeAttractHeading(int32 qid, float& heading) cons bool CPedAttractor::RegisterPed(CPed* pPed) { - for (std::vector<CPed*>::const_iterator pPedIt = vApproachingQueue.cbegin(); pPedIt != vApproachingQueue.cend(); ++pPedIt) { + for (std::vector<CPed*>::iterator pPedIt = vApproachingQueue.begin(); pPedIt != vApproachingQueue.end(); ++pPedIt) { if (*pPedIt == pPed) { vApproachingQueue.erase(pPedIt); return false; @@ -318,7 +318,7 @@ static bool IsPedUsingAttractorOfThisType(int8 type, CPed* pPed) bool CPedAttractor::DeRegisterPed(CPed* pPed) { - for (std::vector<CPed*>::const_iterator pPedIt = vApproachingQueue.cbegin(); pPedIt != vApproachingQueue.cend(); ++pPedIt) { + for (std::vector<CPed*>::iterator pPedIt = vApproachingQueue.begin(); pPedIt != vApproachingQueue.end(); ++pPedIt) { if (*pPedIt != pPed) continue; pPed->m_attractor = nil; @@ -340,12 +340,12 @@ bool CPedAttractor::DeRegisterPed(CPed* pPed) bool CPedAttractor::BroadcastArrival(CPed* pPed) { - for (std::vector<CPed*>::const_iterator pPedIt = vWaitingQueue.cbegin(); pPedIt != vWaitingQueue.cend(); ++pPedIt) { + for (std::vector<CPed*>::const_iterator pPedIt = vWaitingQueue.begin(); pPedIt != vWaitingQueue.end(); ++pPedIt) { if (*pPedIt == pPed) return false; } vWaitingQueue.push_back(pPed); - for (std::vector<CPed*>::const_iterator pPedIt = vApproachingQueue.cbegin(); pPedIt != vApproachingQueue.cend(); ++pPedIt) { + for (std::vector<CPed*>::iterator pPedIt = vApproachingQueue.begin(); pPedIt != vApproachingQueue.end(); ++pPedIt) { if (*pPedIt == pPed) { vApproachingQueue.erase(pPedIt); break; @@ -400,7 +400,7 @@ bool CPedAttractor::BroadcastDeparture(CPed* pPed) pPed->SetWanderPath(CGeneral::GetNodeHeadingFromVector(-vecQueueDir.y, -vecQueueDir.x)); UpdatePedStateOnDeparture(pPed); } - vWaitingQueue.erase(vWaitingQueue.cbegin() + qid); + vWaitingQueue.erase(vWaitingQueue.begin() + qid); for (std::vector<CPed*>::iterator pPedIt = vApproachingQueue.begin(); pPedIt != vApproachingQueue.end(); ++pPedIt) { CPed* pPed = *pPedIt; CVector pos; @@ -441,7 +441,7 @@ bool CPedShelterAttractor::BroadcastDeparture(CPed* pPed) pPed->SetWanderPath(CGeneral::GetNodeHeadingFromVector(-vecQueueDir.y, -vecQueueDir.x)); UpdatePedStateOnDeparture(pPed); } - vWaitingQueue.erase(vWaitingQueue.cbegin() + qid); + vWaitingQueue.erase(vWaitingQueue.begin() + qid); for (std::vector<CPed*>::iterator pPedIt = vApproachingQueue.begin(); pPedIt != vApproachingQueue.end(); ++pPedIt) { CPed* pPed = *pPedIt; CVector pos; @@ -458,11 +458,11 @@ bool CPedShelterAttractor::BroadcastDeparture(CPed* pPed) bool CPedAttractor::IsRegisteredWithPed(CPed* pPed) const { - for (std::vector<CPed*>::const_iterator pPedIt = vWaitingQueue.cbegin(); pPedIt != vWaitingQueue.cend(); ++pPedIt) { + for (std::vector<CPed*>::const_iterator pPedIt = vWaitingQueue.begin(); pPedIt != vWaitingQueue.end(); ++pPedIt) { if (*pPedIt == pPed) return true; } - for (std::vector<CPed*>::const_iterator pPedIt = vApproachingQueue.cbegin(); pPedIt != vApproachingQueue.cend(); ++pPedIt) { + for (std::vector<CPed*>::const_iterator pPedIt = vApproachingQueue.begin(); pPedIt != vApproachingQueue.end(); ++pPedIt) { if (*pPedIt == pPed) { return true; } @@ -472,7 +472,7 @@ bool CPedAttractor::IsRegisteredWithPed(CPed* pPed) const bool CPedAttractor::IsInQueue(CPed* pPed) const { - for (std::vector<CPed*>::const_iterator pPedIt = vWaitingQueue.cbegin(); pPedIt != vWaitingQueue.cend(); ++pPedIt) { + for (std::vector<CPed*>::const_iterator pPedIt = vWaitingQueue.begin(); pPedIt != vWaitingQueue.end(); ++pPedIt) { if (*pPedIt == pPed) return true; } @@ -640,7 +640,7 @@ void CPedAttractorManager::ComputeEffectUseDir(const C2dEffect* pEffect, const C CPedAttractor* CPedAttractorManager::RegisterPed(CPed* pPed, C2dEffect* pEffect, const CMatrix& matrix, std::vector<CPedAttractor*>& vecAttractors) { CPedAttractor* pRegisteredAttractor = nil; - for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.cbegin(); pAttractorIt != vecAttractors.cend(); ++pAttractorIt) { + for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.begin(); pAttractorIt != vecAttractors.end(); ++pAttractorIt) { CPedAttractor* pAttractor = *pAttractorIt; CVector vEffectPos; ComputeEffectPos(pAttractor->GetEffect(), matrix, vEffectPos); @@ -676,7 +676,7 @@ bool CPedAttractorManager::DeRegisterPed(CPed* pPed, CPedAttractor* pAttractor, if (!pAttractor) return false; CPedAttractor* pFound = nil; - for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.cbegin(); pAttractorIt != vecAttractors.cend(); ++pAttractorIt) { + for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.begin(); pAttractorIt != vecAttractors.end(); ++pAttractorIt) { if (*pAttractorIt == pAttractor) { pFound = *pAttractorIt; break; @@ -687,7 +687,7 @@ bool CPedAttractorManager::DeRegisterPed(CPed* pPed, CPedAttractor* pAttractor, pFound->DeRegisterPed(pPed); if (pFound->GetNoOfRegisteredPeds() != 0) return true; - for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.cbegin(); pAttractorIt != vecAttractors.cend(); ++pAttractorIt) { + for (std::vector<CPedAttractor*>::iterator pAttractorIt = vecAttractors.begin(); pAttractorIt != vecAttractors.end(); ++pAttractorIt) { if (*pAttractorIt == pAttractor) { vecAttractors.erase(pAttractorIt); break; @@ -702,7 +702,7 @@ bool CPedAttractorManager::BroadcastArrival(CPed* pPed, CPedAttractor* pAttracto if (!pAttractor) return false; CPedAttractor* pFound = nil; - for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.cbegin(); pAttractorIt != vecAttractors.cend(); ++pAttractorIt) { + for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.begin(); pAttractorIt != vecAttractors.end(); ++pAttractorIt) { if (*pAttractorIt == pAttractor) { pFound = *pAttractorIt; break; @@ -719,7 +719,7 @@ bool CPedAttractorManager::BroadcastDeparture(CPed* pPed, CPedAttractor* pAttrac if (!pAttractor) return false; CPedAttractor* pFound = nil; - for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.cbegin(); pAttractorIt != vecAttractors.cend(); ++pAttractorIt) { + for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.begin(); pAttractorIt != vecAttractors.end(); ++pAttractorIt) { if (*pAttractorIt == pAttractor) { pFound = *pAttractorIt; break; @@ -730,7 +730,7 @@ bool CPedAttractorManager::BroadcastDeparture(CPed* pPed, CPedAttractor* pAttrac pFound->DeRegisterPed(pPed); if (pFound->GetNoOfRegisteredPeds() != 0) return true; - for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.cbegin(); pAttractorIt != vecAttractors.cend(); ++pAttractorIt) { + for (std::vector<CPedAttractor*>::iterator pAttractorIt = vecAttractors.begin(); pAttractorIt != vecAttractors.end(); ++pAttractorIt) { if (*pAttractorIt == pAttractor) { vecAttractors.erase(pAttractorIt); break; @@ -744,7 +744,7 @@ bool CPedAttractorManager::IsInQueue(CPed* pPed, CPedAttractor* pAttractor, std: { if (!pAttractor) return false; - for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.cbegin(); pAttractorIt != vecAttractors.cend(); ++pAttractorIt) { + for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.begin(); pAttractorIt != vecAttractors.end(); ++pAttractorIt) { if (*pAttractorIt == pAttractor) { return (*pAttractorIt)->IsInQueue(pPed); } @@ -756,7 +756,7 @@ bool CPedAttractorManager::IsAtHeadOfQueue(CPed* pPed, CPedAttractor* pAttractor { if (!pAttractor) return false; - for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.cbegin(); pAttractorIt != vecAttractors.cend(); ++pAttractorIt) { + for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.begin(); pAttractorIt != vecAttractors.end(); ++pAttractorIt) { if (*pAttractorIt == pAttractor) { return (*pAttractorIt)->IsAtHeadOfQueue(pPed); } @@ -766,7 +766,7 @@ bool CPedAttractorManager::IsAtHeadOfQueue(CPed* pPed, CPedAttractor* pAttractor bool CPedAttractorManager::IsPedRegistered(CPed* pPed, std::vector<CPedAttractor*>& vecAttractors) { - for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.cbegin(); pAttractorIt != vecAttractors.cend(); ++pAttractorIt) { + for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.begin(); pAttractorIt != vecAttractors.end(); ++pAttractorIt) { if ((*pAttractorIt)->IsRegisteredWithPed(pPed)) return true; } diff --git a/src/peds/PedAttractor.h b/src/peds/PedAttractor.h index 85b4327b..c55e4028 100644 --- a/src/peds/PedAttractor.h +++ b/src/peds/PedAttractor.h @@ -126,8 +126,8 @@ public: class CPedAtmAttractor : public CPedAttractor { public: - virtual ePedAttractorType GetType() const override { return ATTRACTOR_ATM; }; - virtual void UpdatePedStateOnDeparture(CPed* pPed) const override; + virtual ePedAttractorType GetType() const { return ATTRACTOR_ATM; }; + virtual void UpdatePedStateOnDeparture(CPed* pPed) const; CPedAtmAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 maxpeds, float qdist, float waitTime, float approachTime, float distance, float headingdiff, float posdisp, float headdisp) : CPedAttractor(pEffect, matrix, maxpeds, qdist, waitTime, approachTime, distance, headingdiff, posdisp, headdisp) {}; @@ -136,9 +136,9 @@ public: class CPedIceCreamAttractor : public CPedAttractor { public: - virtual ~CPedIceCreamAttractor() override { GetPedAttractorManager()->RemoveIceCreamVanEffects(p2dEffect); } - virtual ePedAttractorType GetType() const override { return ATTRACTOR_ICECREAM; } - virtual void UpdatePedStateOnDeparture(CPed* pPed) const override {}; + virtual ~CPedIceCreamAttractor() { GetPedAttractorManager()->RemoveIceCreamVanEffects(p2dEffect); } + virtual ePedAttractorType GetType() const { return ATTRACTOR_ICECREAM; } + virtual void UpdatePedStateOnDeparture(CPed* pPed) const {}; CPedIceCreamAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 maxpeds, float qdist, float waitTime, float approachTime, float distance, float headingdiff, float posdisp, float headdisp) : CPedAttractor(pEffect, matrix, maxpeds, qdist, waitTime, approachTime, distance, headingdiff, posdisp, headdisp) {}; @@ -147,9 +147,9 @@ public: class CPedPizzaAttractor : public CPedAttractor { public: - virtual float GetHeadOfQueueWaitTime() override { return 2000.0f; } - virtual ePedAttractorType GetType() const override { return ATTRACTOR_PIZZA; } - virtual void UpdatePedStateOnDeparture(CPed* pPed) const override; + virtual float GetHeadOfQueueWaitTime() { return 2000.0f; } + virtual ePedAttractorType GetType() const { return ATTRACTOR_PIZZA; } + virtual void UpdatePedStateOnDeparture(CPed* pPed) const; CPedPizzaAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 maxpeds, float qdist, float waitTime, float approachTime, float distance, float headingdiff, float posdisp, float headdisp) : CPedAttractor(pEffect, matrix, maxpeds, qdist, waitTime, approachTime, distance, headingdiff, posdisp, headdisp) {}; @@ -158,8 +158,8 @@ public: class CPedSeatAttractor : public CPedAttractor { public: - virtual ePedAttractorType GetType() const override { return ATTRACTOR_SEAT; } - virtual void UpdatePedStateOnDeparture(CPed* pPed) const override {}; + virtual ePedAttractorType GetType() const { return ATTRACTOR_SEAT; } + virtual void UpdatePedStateOnDeparture(CPed* pPed) const {}; CPedSeatAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 maxpeds, float qdist, float waitTime, float approachTime, float distance, float headingdiff, float posdisp, float headdisp) : CPedAttractor(pEffect, matrix, maxpeds, qdist, waitTime, approachTime, distance, headingdiff, posdisp, headdisp) {}; @@ -169,12 +169,12 @@ class CPedShelterAttractor : public CPedAttractor { static std::vector<CVector> ms_displacements; public: - virtual ePedAttractorType GetType() const override { return ATTRACTOR_SHELTER; } - virtual bool BroadcastDeparture(CPed*) override; - virtual void UpdatePedStateOnDeparture(CPed* pPed) const override {}; - virtual bool IsAtHeadOfQueue(CPed* pPed) const override { return true; } - virtual void ComputeAttractPos(int qid, CVector& pos) const override; - virtual void ComputeAttractHeading(int qid, float& heading) const override; + virtual ePedAttractorType GetType() const { return ATTRACTOR_SHELTER; } + virtual bool BroadcastDeparture(CPed*); + virtual void UpdatePedStateOnDeparture(CPed* pPed) const {}; + virtual bool IsAtHeadOfQueue(CPed* pPed) const { return true; } + virtual void ComputeAttractPos(int qid, CVector& pos) const; + virtual void ComputeAttractHeading(int qid, float& heading) const; CPedShelterAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 maxpeds, float qdist, float waitTime, float approachTime, float distance, float headingdiff, float posdisp, float headdisp) : CPedAttractor(pEffect, matrix, maxpeds, qdist, waitTime, approachTime, distance, headingdiff, posdisp, headdisp) @@ -187,8 +187,8 @@ public: class CPedStopAttractor : public CPedAttractor { public: - virtual ePedAttractorType GetType() const override { return ATTRACTOR_STOP; } - virtual void UpdatePedStateOnDeparture(CPed* pPed) const override {}; + virtual ePedAttractorType GetType() const { return ATTRACTOR_STOP; } + virtual void UpdatePedStateOnDeparture(CPed* pPed) const {}; CPedStopAttractor(C2dEffect* pEffect, const CMatrix& matrix, int32 maxpeds, float qdist, float waitTime, float approachTime, float distance, float headingdiff, float posdisp, float headdisp) : CPedAttractor(pEffect, matrix, maxpeds, qdist, waitTime, approachTime, distance, headingdiff, posdisp, headdisp) diff --git a/src/render/Draw.cpp b/src/render/Draw.cpp index 507653f6..13cbd1b3 100644 --- a/src/render/Draw.cpp +++ b/src/render/Draw.cpp @@ -5,8 +5,8 @@ #include "Camera.h" #include "CutsceneMgr.h" -#ifdef ASPECT_RATIO_SCALE float CDraw::ms_fAspectRatio = DEFAULT_ASPECT_RATIO; +#ifdef ASPECT_RATIO_SCALE float CDraw::ms_fScaledFOV = 45.0f; #endif diff --git a/src/render/Draw.h b/src/render/Draw.h index 1a63c980..e67ab42b 100644 --- a/src/render/Draw.h +++ b/src/render/Draw.h @@ -16,10 +16,10 @@ private: static float ms_fNearClipZ; static float ms_fFarClipZ; static float ms_fFOV; -#ifdef ASPECT_RATIO_SCALE // we use this variable to scale a lot of 2D elements // so better cache it static float ms_fAspectRatio; +#ifdef ASPECT_RATIO_SCALE // similar thing for 3D rendering static float ms_fScaledFOV; #endif diff --git a/src/render/Font.h b/src/render/Font.h index 05c367fb..4046ebb5 100644 --- a/src/render/Font.h +++ b/src/render/Font.h @@ -1,5 +1,7 @@ #pragma once +#include "Sprite2d.h" + void AsciiToUnicode(const char *src, wchar *dst); void UnicodeStrcpy(wchar *dst, const wchar *src); void UnicodeStrcat(wchar *dst, wchar *append); diff --git a/src/render/Glass.cpp b/src/render/Glass.cpp index a11495a9..c6d02755 100644 --- a/src/render/Glass.cpp +++ b/src/render/Glass.cpp @@ -1,4 +1,4 @@ -#include "common.h" +#include "common.h" #include "Glass.h" #include "Timer.h" diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp index 231a1a08..12bfd040 100644 --- a/src/render/Hud.cpp +++ b/src/render/Hud.cpp @@ -1105,20 +1105,20 @@ void CHud::Draw() // Yeah, top and bottom changed place. R* vision if (IntroRect.m_bIsUsed && IntroRect.m_bBeforeFade) { if (IntroRect.m_nTextureId >= 0) { - CRect rect = { + CRect rect ( IntroRect.m_sRect.left, IntroRect.m_sRect.top, IntroRect.m_sRect.right, - IntroRect.m_sRect.bottom }; + IntroRect.m_sRect.bottom ); CTheScripts::ScriptSprites[IntroRect.m_nTextureId].Draw(rect, IntroRect.m_sColor); } else { - CRect rect = { + CRect rect ( IntroRect.m_sRect.left, IntroRect.m_sRect.top, IntroRect.m_sRect.right, - IntroRect.m_sRect.bottom }; + IntroRect.m_sRect.bottom ); CSprite2d::DrawRect(rect, IntroRect.m_sColor); } diff --git a/src/render/Instance.h b/src/render/Instance.h index 01dfb6a2..693cfdf1 100644 --- a/src/render/Instance.h +++ b/src/render/Instance.h @@ -9,6 +9,6 @@ class CInstance : public CPlaceable public: int m_modelIndex; public: - ~CInstance() = default; + ~CInstance() { } void Shutdown(); }; diff --git a/src/render/SpecialFX.cpp b/src/render/SpecialFX.cpp index 3387cb2e..161bf168 100644 --- a/src/render/SpecialFX.cpp +++ b/src/render/SpecialFX.cpp @@ -1419,7 +1419,7 @@ CMoneyMessages::RegisterOne(CVector vecPos, const char *pText, uint8 bRed, uint8 } CRGBA FoamColour(255, 255, 255, 255); -unsigned int CSpecialParticleStuff::BoatFromStart; +uint32 CSpecialParticleStuff::BoatFromStart; void CSpecialParticleStuff::CreateFoamAroundObject(CMatrix* pMatrix, float innerFw, float innerRg, float innerUp, int32 particles) diff --git a/src/rw/VisibilityPlugins.cpp b/src/rw/VisibilityPlugins.cpp index 754c8778..ae6eda47 100644 --- a/src/rw/VisibilityPlugins.cpp +++ b/src/rw/VisibilityPlugins.cpp @@ -463,7 +463,6 @@ CVisibilityPlugins::RenderVehicleHiDetailCB_Boat(RpAtomic *atomic) RpAtomic* CVisibilityPlugins::RenderVehicleHiDetailCB_Boat_Far(RpAtomic *atomic) { - if(DistToCameraSq < ms_bigVehicleLod1Dist) RENDERCALLBACK(atomic); return atomic; } @@ -499,6 +498,23 @@ CVisibilityPlugins::RenderVehicleLoDetailCB_Boat(RpAtomic *atomic) } RpAtomic* +CVisibilityPlugins::RenderVehicleLoDetailCB_Boat(RpAtomic *atomic) +{ + RpClump *clump; + int32 alpha; + + clump = RpAtomicGetClump(atomic); + if(DistToCameraSq >= ms_vehicleLod0Dist){ + alpha = GetClumpAlpha(clump); + if(alpha == 255) + RENDERCALLBACK(atomic); + else + RenderAlphaAtomic(atomic, alpha); + } + return atomic; +} + +RpAtomic* CVisibilityPlugins::RenderVehicleLoDetailCB_Boat_Far(RpAtomic *atomic) { RpClump *clump; diff --git a/src/skel/crossplatform.h b/src/skel/crossplatform.h index bfc03913..009b17c7 100644 --- a/src/skel/crossplatform.h +++ b/src/skel/crossplatform.h @@ -21,7 +21,11 @@ char *_strdate(char *buf); // As long as WITHWINDOWS isn't defined / <Windows.h> isn't included, we only need type definitions so let's include <IntSafe.h>. // NOTE: It's perfectly fine to include <Windows.h> here, but it can increase build size and time in *some* conditions, and maybe substantially in future if we'll use crossplatform.h more. #ifndef _INC_WINDOWS - #include <IntSafe.h> + #ifndef __MWERKS__ + #include <IntSafe.h> + #else + #include <Windows.h> + #endif #endif #if defined RW_D3D9 || defined RWLIBS #include "win.h" diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp index 3e7ba0ab..887ac6dc 100644 --- a/src/skel/glfw/glfw.cpp +++ b/src/skel/glfw/glfw.cpp @@ -2099,22 +2099,30 @@ void CapturePad(RwInt32 padID) const float *axes = glfwGetJoystickAxes(glfwPad, &numAxes); GLFWgamepadstate gamepadState; - if (ControlsManager.m_bFirstCapture == false) - { + if (ControlsManager.m_bFirstCapture == false) { memcpy(&ControlsManager.m_OldState, &ControlsManager.m_NewState, sizeof(ControlsManager.m_NewState)); + } else { + // In case connected gamepad doesn't have L-R trigger axes. + ControlsManager.m_NewState.mappedButtons[15] = ControlsManager.m_NewState.mappedButtons[16] = 0; } ControlsManager.m_NewState.buttons = (uint8*)buttons; ControlsManager.m_NewState.numButtons = numButtons; ControlsManager.m_NewState.id = glfwPad; - ControlsManager.m_NewState.isGamepad = glfwJoystickIsGamepad(glfwPad); + ControlsManager.m_NewState.isGamepad = glfwGetGamepadState(glfwPad, &gamepadState); if (ControlsManager.m_NewState.isGamepad) { - glfwGetGamepadState(glfwPad, &gamepadState); memcpy(&ControlsManager.m_NewState.mappedButtons, gamepadState.buttons, sizeof(gamepadState.buttons)); - ControlsManager.m_NewState.mappedButtons[15] = gamepadState.axes[4] > -0.8f; - ControlsManager.m_NewState.mappedButtons[16] = gamepadState.axes[5] > -0.8f; + float lt = gamepadState.axes[GLFW_GAMEPAD_AXIS_LEFT_TRIGGER], rt = gamepadState.axes[GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER]; + + // glfw returns 0.0 for non-existent axises(which is bullocks) so we treat it as deadzone, and keep value of previous frame. + // otherwise if this axis is present, -1 = released, 1 = pressed + if (lt != 0.0f) + ControlsManager.m_NewState.mappedButtons[15] = lt > -0.8f; + + if (rt != 0.0f) + ControlsManager.m_NewState.mappedButtons[16] = rt > -0.8f; } - // TODO I'm not sure how to find/what to do with L2-R2, if joystick isn't registered in SDL database. + // TODO? L2-R2 axes(not buttons-that's fine) on joysticks that don't have SDL gamepad mapping AREN'T handled, and I think it's impossible to do without mapping. if (ControlsManager.m_bFirstCapture == true) { memcpy(&ControlsManager.m_OldState, &ControlsManager.m_NewState, sizeof(ControlsManager.m_NewState)); @@ -2128,12 +2136,13 @@ void CapturePad(RwInt32 padID) RsPadEventHandler(rsPADBUTTONUP, (void *)&bs); // Gamepad axes are guaranteed to return 0.0f if that particular gamepad doesn't have that axis. + // And that's really good for sticks, because gamepads return 0.0 for them when sticks are in released state. if ( glfwPad != -1 ) { - leftStickPos.x = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[0] : numAxes >= 1 ? axes[0] : 0.0f; - leftStickPos.y = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[1] : numAxes >= 2 ? axes[1] : 0.0f; + leftStickPos.x = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[GLFW_GAMEPAD_AXIS_LEFT_X] : numAxes >= 1 ? axes[0] : 0.0f; + leftStickPos.y = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[GLFW_GAMEPAD_AXIS_LEFT_Y] : numAxes >= 2 ? axes[1] : 0.0f; - rightStickPos.x = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[2] : numAxes >= 3 ? axes[2] : 0.0f; - rightStickPos.y = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[3] : numAxes >= 4 ? axes[3] : 0.0f; + rightStickPos.x = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[GLFW_GAMEPAD_AXIS_RIGHT_X] : numAxes >= 3 ? axes[2] : 0.0f; + rightStickPos.y = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[GLFW_GAMEPAD_AXIS_RIGHT_Y] : numAxes >= 4 ? axes[3] : 0.0f; } { diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp index 87c3846a..650f1648 100644 --- a/src/skel/win/win.cpp +++ b/src/skel/win/win.cpp @@ -1,4 +1,4 @@ -#if defined RW_D3D9 || defined RWLIBS +#if defined RW_D3D9 || defined RWLIBS || defined __MWERKS__ #define _WIN32_WINDOWS 0x0500 #define WINVER 0x0500 @@ -19,6 +19,10 @@ #pragma warning( push ) #pragma warning( disable : 4005) +#ifdef __MWERKS__ +#define MAPVK_VK_TO_CHAR (2) // this is missing from codewarrior win32 headers - but it gets used ... how? +#endif + #include <ddraw.h> #include <DShow.h> #pragma warning( pop ) @@ -573,6 +577,9 @@ _RETEX: } } +#ifdef __MWERKS__ +#pragma dont_inline on +#endif void _psPrintCpuInfo() { RwUInt32 features = _psGetCpuFeatures(); @@ -587,6 +594,9 @@ void _psPrintCpuInfo() if ( FeaturesEx & 0x80000000 ) debug("with 3DNow"); } +#ifdef __MWERKS__ +#pragma dont_inline off +#endif #endif /* diff --git a/src/text/Text.cpp b/src/text/Text.cpp index 6385eb50..16250f79 100644 --- a/src/text/Text.cpp +++ b/src/text/Text.cpp @@ -205,7 +205,7 @@ CText::GetNameOfLoadedMissionText(char *outName) void CText::ReadChunkHeader(ChunkHeader *buf, int32 file, size_t *offset) { -#if THIS_IS_STUPID +#ifdef THIS_IS_STUPID char *_buf = (char*)buf; for (int i = 0; i < sizeof(ChunkHeader); i++) { CFileMgr::Read(file, &_buf[i], 1); @@ -323,7 +323,7 @@ CKeyArray::Load(size_t length, int file, size_t* offset) entries = new CKeyEntry[numEntries]; rawbytes = (char*)entries; -#if THIS_IS_STUPID +#ifdef THIS_IS_STUPID for (uint32 i = 0; i < length; i++) { CFileMgr::Read(file, &rawbytes[i], 1); (*offset)++; @@ -398,7 +398,7 @@ CKeyArray::Search(const char *key, uint8 *result) #endif *result = false; #ifdef MASTER - sprintf(errstr, "%"); + sprintf(errstr, ""); #else sprintf(errstr, "%s missing", key); #endif // MASTER @@ -417,7 +417,7 @@ CData::Load(size_t length, int file, size_t * offset) chars = new wchar[numChars]; rawbytes = (char*)chars; -#if THIS_IS_STUPID +#ifdef THIS_IS_STUPID for(uint32 i = 0; i < length; i++){ CFileMgr::Read(file, &rawbytes[i], 1); (*offset)++; @@ -439,7 +439,7 @@ CData::Unload(void) void CMissionTextOffsets::Load(size_t table_size, int file, size_t *offset, int) { -#if THIS_IS_STUPID +#ifdef THIS_IS_STUPID size_t num_of_entries = table_size / sizeof(CMissionTextOffsets::Entry); for (size_t mi = 0; mi < num_of_entries; mi++) { for (uint32 i = 0; i < sizeof(data[mi].szMissionName); i++) { diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp index 6d6b4833..4a7bce16 100644 --- a/src/vehicles/Automobile.cpp +++ b/src/vehicles/Automobile.cpp @@ -1,4 +1,4 @@ -#include "common.h" +#include "common.h" #include "main.h" #include "General.h" diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp index 381d13d8..d4dfcc7c 100644 --- a/src/vehicles/Boat.cpp +++ b/src/vehicles/Boat.cpp @@ -1,4 +1,4 @@ -#include "common.h" +#include "common.h" #include "main.h" #include "General.h" diff --git a/src/weapons/WeaponInfo.cpp b/src/weapons/WeaponInfo.cpp index acb11a88..1f78b7d4 100644 --- a/src/weapons/WeaponInfo.cpp +++ b/src/weapons/WeaponInfo.cpp @@ -57,7 +57,7 @@ int32 CWeaponInfo::ms_aMaxAmmoForWeapon[WEAPONTYPE_TOTALWEAPONS] = -1, -1, -1, -1, -1, -1, -1, -1, -1 }; -CWeaponInfo CWeaponInfo::ms_apWeaponInfos[WEAPONTYPE_TOTALWEAPONS]; +CWeaponInfo aWeaponInfo[WEAPONTYPE_TOTALWEAPONS]; char CWeaponInfo::ms_aWeaponNames[WEAPONTYPE_TOTALWEAPONS][32] = { "Unarmed", @@ -102,7 +102,7 @@ char CWeaponInfo::ms_aWeaponNames[WEAPONTYPE_TOTALWEAPONS][32] = CWeaponInfo* CWeaponInfo::GetWeaponInfo(eWeaponType weaponType) { - return &ms_apWeaponInfos[weaponType]; + return &aWeaponInfo[weaponType]; } void @@ -110,27 +110,27 @@ CWeaponInfo::Initialise(void) { debug("Initialising CWeaponInfo...\n"); for (int i = 0; i < WEAPONTYPE_TOTALWEAPONS; i++) { - ms_apWeaponInfos[i].m_eWeaponFire = WEAPON_FIRE_INSTANT_HIT; - ms_apWeaponInfos[i].m_fRange = 0.0f; - ms_apWeaponInfos[i].m_nFiringRate = 0; - ms_apWeaponInfos[i].m_nReload = 0; - ms_apWeaponInfos[i].m_nAmountofAmmunition = 0; - ms_apWeaponInfos[i].m_nDamage = 0; - ms_apWeaponInfos[i].m_fSpeed = 0.0f; - ms_apWeaponInfos[i].m_fRadius = 0.0f; - ms_apWeaponInfos[i].m_fLifespan = 0.0f; - ms_apWeaponInfos[i].m_fSpread = 0.0f; - ms_apWeaponInfos[i].m_vecFireOffset = CVector(0.0f, 0.0f, 0.0f); - ms_apWeaponInfos[i].m_AnimToPlay = ASSOCGRP_UNARMED; - ms_apWeaponInfos[i].m_fAnimLoopStart = 0.0f; - ms_apWeaponInfos[i].m_fAnimLoopEnd = 0.0f; - ms_apWeaponInfos[i].m_fAnimFrameFire = 0.0f; - ms_apWeaponInfos[i].m_fAnim2LoopStart = 0.0f; - ms_apWeaponInfos[i].m_fAnim2LoopEnd = 0.0f; - ms_apWeaponInfos[i].m_fAnim2FrameFire = 0.0f; - ms_apWeaponInfos[i].m_fAnimBreakout = 0.0f; - ms_apWeaponInfos[i].m_Flags = WEAPONFLAG_USE_GRAVITY | WEAPONFLAG_SLOWS_DOWN | WEAPONFLAG_RAND_SPEED | WEAPONFLAG_EXPANDS | WEAPONFLAG_EXPLODES; - ms_apWeaponInfos[i].m_nWeaponSlot = WEAPONSLOT_UNARMED; + aWeaponInfo[i].m_eWeaponFire = WEAPON_FIRE_INSTANT_HIT; + aWeaponInfo[i].m_fRange = 0.0f; + aWeaponInfo[i].m_nFiringRate = 0; + aWeaponInfo[i].m_nReload = 0; + aWeaponInfo[i].m_nAmountofAmmunition = 0; + aWeaponInfo[i].m_nDamage = 0; + aWeaponInfo[i].m_fSpeed = 0.0f; + aWeaponInfo[i].m_fRadius = 0.0f; + aWeaponInfo[i].m_fLifespan = 0.0f; + aWeaponInfo[i].m_fSpread = 0.0f; + aWeaponInfo[i].m_vecFireOffset = CVector(0.0f, 0.0f, 0.0f); + aWeaponInfo[i].m_AnimToPlay = ASSOCGRP_UNARMED; + aWeaponInfo[i].m_fAnimLoopStart = 0.0f; + aWeaponInfo[i].m_fAnimLoopEnd = 0.0f; + aWeaponInfo[i].m_fAnimFrameFire = 0.0f; + aWeaponInfo[i].m_fAnim2LoopStart = 0.0f; + aWeaponInfo[i].m_fAnim2LoopEnd = 0.0f; + aWeaponInfo[i].m_fAnim2FrameFire = 0.0f; + aWeaponInfo[i].m_fAnimBreakout = 0.0f; + aWeaponInfo[i].m_Flags = WEAPONFLAG_USE_GRAVITY | WEAPONFLAG_SLOWS_DOWN | WEAPONFLAG_RAND_SPEED | WEAPONFLAG_EXPANDS | WEAPONFLAG_EXPLODES; + aWeaponInfo[i].m_nWeaponSlot = WEAPONSLOT_UNARMED; } debug("Loading weapon data...\n"); LoadWeaponData(); @@ -221,31 +221,31 @@ CWeaponInfo::LoadWeaponData(void) CVector vecFireOffset(fireOffsetX, fireOffsetY, fireOffsetZ); - ms_apWeaponInfos[weaponType].m_eWeaponFire = FindWeaponFireType(fireType); - ms_apWeaponInfos[weaponType].m_fRange = range; - ms_apWeaponInfos[weaponType].m_nFiringRate = firingRate; - ms_apWeaponInfos[weaponType].m_nReload = reload; - ms_apWeaponInfos[weaponType].m_nAmountofAmmunition = ammoAmount; - ms_apWeaponInfos[weaponType].m_nDamage = damage; - ms_apWeaponInfos[weaponType].m_fSpeed = speed; - ms_apWeaponInfos[weaponType].m_fRadius = radius; - ms_apWeaponInfos[weaponType].m_fLifespan = lifeSpan; - ms_apWeaponInfos[weaponType].m_fSpread = spread; - ms_apWeaponInfos[weaponType].m_vecFireOffset = vecFireOffset; - ms_apWeaponInfos[weaponType].m_fAnimLoopStart = animLoopStart / 30.0f; - ms_apWeaponInfos[weaponType].m_fAnimLoopEnd = animLoopEnd / 30.0f; - ms_apWeaponInfos[weaponType].m_fAnim2LoopStart = anim2LoopStart / 30.0f; - ms_apWeaponInfos[weaponType].m_fAnim2LoopEnd = anim2LoopEnd / 30.0f; - ms_apWeaponInfos[weaponType].m_fAnimFrameFire = delayBetweenAnimAndFire / 30.0f; - ms_apWeaponInfos[weaponType].m_fAnim2FrameFire = delayBetweenAnim2AndFire / 30.0f; - ms_apWeaponInfos[weaponType].m_fAnimBreakout = animBreakout / 30.0f; - ms_apWeaponInfos[weaponType].m_nModelId = modelId; - ms_apWeaponInfos[weaponType].m_nModel2Id = modelId2; - ms_apWeaponInfos[weaponType].m_Flags = flags; - ms_apWeaponInfos[weaponType].m_nWeaponSlot = weaponSlot; + aWeaponInfo[weaponType].m_eWeaponFire = FindWeaponFireType(fireType); + aWeaponInfo[weaponType].m_fRange = range; + aWeaponInfo[weaponType].m_nFiringRate = firingRate; + aWeaponInfo[weaponType].m_nReload = reload; + aWeaponInfo[weaponType].m_nAmountofAmmunition = ammoAmount; + aWeaponInfo[weaponType].m_nDamage = damage; + aWeaponInfo[weaponType].m_fSpeed = speed; + aWeaponInfo[weaponType].m_fRadius = radius; + aWeaponInfo[weaponType].m_fLifespan = lifeSpan; + aWeaponInfo[weaponType].m_fSpread = spread; + aWeaponInfo[weaponType].m_vecFireOffset = vecFireOffset; + aWeaponInfo[weaponType].m_fAnimLoopStart = animLoopStart / 30.0f; + aWeaponInfo[weaponType].m_fAnimLoopEnd = animLoopEnd / 30.0f; + aWeaponInfo[weaponType].m_fAnim2LoopStart = anim2LoopStart / 30.0f; + aWeaponInfo[weaponType].m_fAnim2LoopEnd = anim2LoopEnd / 30.0f; + aWeaponInfo[weaponType].m_fAnimFrameFire = delayBetweenAnimAndFire / 30.0f; + aWeaponInfo[weaponType].m_fAnim2FrameFire = delayBetweenAnim2AndFire / 30.0f; + aWeaponInfo[weaponType].m_fAnimBreakout = animBreakout / 30.0f; + aWeaponInfo[weaponType].m_nModelId = modelId; + aWeaponInfo[weaponType].m_nModel2Id = modelId2; + aWeaponInfo[weaponType].m_Flags = flags; + aWeaponInfo[weaponType].m_nWeaponSlot = weaponSlot; if (animLoopEnd < 98.0f && weaponType != WEAPONTYPE_FLAMETHROWER && !CWeapon::IsShotgun(weaponType)) - ms_apWeaponInfos[weaponType].m_nFiringRate = ((ms_apWeaponInfos[weaponType].m_fAnimLoopEnd - ms_apWeaponInfos[weaponType].m_fAnimLoopStart) * 900.0f); + aWeaponInfo[weaponType].m_nFiringRate = ((aWeaponInfo[weaponType].m_fAnimLoopEnd - aWeaponInfo[weaponType].m_fAnimLoopStart) * 900.0f); if (weaponType == WEAPONTYPE_DETONATOR || weaponType == WEAPONTYPE_HELICANNON) modelId = -1; @@ -257,7 +257,7 @@ CWeaponInfo::LoadWeaponData(void) for (int i = 0; i < NUM_ANIM_ASSOC_GROUPS; i++) { if (!strcmp(animToPlay, CAnimManager::GetAnimGroupName((AssocGroupId)i))) { - ms_apWeaponInfos[weaponType].m_AnimToPlay = (AssocGroupId)i; + aWeaponInfo[weaponType].m_AnimToPlay = (AssocGroupId)i; break; } } diff --git a/src/weapons/WeaponInfo.h b/src/weapons/WeaponInfo.h index 0f53dded..d7f1563d 100644 --- a/src/weapons/WeaponInfo.h +++ b/src/weapons/WeaponInfo.h @@ -31,7 +31,6 @@ enum }; class CWeaponInfo { - static CWeaponInfo ms_apWeaponInfos[WEAPONTYPE_TOTALWEAPONS]; static char ms_aWeaponNames[WEAPONTYPE_TOTALWEAPONS][32]; public: static uint16 ms_aReloadSampleTime[WEAPONTYPE_TOTALWEAPONS]; diff --git a/vendor/openal-soft/dist/Win32/OpenAL32.dll b/vendor/openal-soft/dist/Win32/OpenAL32.dll Binary files differindex 6fc789e5..ffa0a787 100644 --- a/vendor/openal-soft/dist/Win32/OpenAL32.dll +++ b/vendor/openal-soft/dist/Win32/OpenAL32.dll diff --git a/vendor/openal-soft/dist/Win64/OpenAL32.dll b/vendor/openal-soft/dist/Win64/OpenAL32.dll Binary files differindex 3c631e3a..252c4285 100644 --- a/vendor/openal-soft/dist/Win64/OpenAL32.dll +++ b/vendor/openal-soft/dist/Win64/OpenAL32.dll diff --git a/vendor/openal-soft/include/AL/al.h b/vendor/openal-soft/include/AL/al.h index 413b3833..8749e1b7 100644 --- a/vendor/openal-soft/include/AL/al.h +++ b/vendor/openal-soft/include/AL/al.h @@ -22,7 +22,7 @@ extern "C" { #endif -/** Deprecated macro. */ +/* Deprecated macros. */ #define OPENAL #define ALAPI AL_API #define ALAPIENTRY AL_APIENTRY @@ -30,7 +30,7 @@ extern "C" { #define AL_ILLEGAL_ENUM AL_INVALID_ENUM #define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION -/** Supported AL version. */ +/* Supported AL versions. */ #define AL_VERSION_1_0 #define AL_VERSION_1_1 @@ -234,7 +234,7 @@ typedef void ALvoid; */ #define AL_SOURCE_STATE 0x1010 -/** Source state value. */ +/* Source state values. */ #define AL_INITIAL 0x1011 #define AL_PLAYING 0x1012 #define AL_PAUSED 0x1013 @@ -300,7 +300,7 @@ typedef void ALvoid; * Source maximum distance. * Type: ALfloat * Range: [0.0 - ] - * Default: +inf + * Default: FLT_MAX * * The distance above which the source is not attenuated any further with a * clamped distance model, or where attenuation reaches 0.0 gain for linear @@ -330,15 +330,18 @@ typedef void ALvoid; */ #define AL_SOURCE_TYPE 0x1027 -/** Source type value. */ +/* Source type values. */ #define AL_STATIC 0x1028 #define AL_STREAMING 0x1029 #define AL_UNDETERMINED 0x1030 -/** Buffer format specifier. */ +/** Unsigned 8-bit mono buffer format. */ #define AL_FORMAT_MONO8 0x1100 +/** Signed 16-bit mono buffer format. */ #define AL_FORMAT_MONO16 0x1101 +/** Unsigned 8-bit stereo buffer format. */ #define AL_FORMAT_STEREO8 0x1102 +/** Signed 16-bit stereo buffer format. */ #define AL_FORMAT_STEREO16 0x1103 /** Buffer frequency (query only). */ @@ -350,11 +353,7 @@ typedef void ALvoid; /** Buffer data size (query only). */ #define AL_SIZE 0x2004 -/** - * Buffer state. - * - * Not for public use. - */ +/* Buffer state. Not for public use. */ #define AL_UNUSED 0x2010 #define AL_PENDING 0x2011 #define AL_PROCESSED 0x2012 @@ -441,7 +440,7 @@ AL_API void AL_APIENTRY alSpeedOfSound(ALfloat value); #define AL_DISTANCE_MODEL 0xD000 AL_API void AL_APIENTRY alDistanceModel(ALenum distanceModel); -/** Distance model value. */ +/* Distance model values. */ #define AL_INVERSE_DISTANCE 0xD001 #define AL_INVERSE_DISTANCE_CLAMPED 0xD002 #define AL_LINEAR_DISTANCE 0xD003 @@ -449,12 +448,12 @@ AL_API void AL_APIENTRY alDistanceModel(ALenum distanceModel); #define AL_EXPONENT_DISTANCE 0xD005 #define AL_EXPONENT_DISTANCE_CLAMPED 0xD006 -/** Renderer State management. */ +/* Renderer State management. */ AL_API void AL_APIENTRY alEnable(ALenum capability); AL_API void AL_APIENTRY alDisable(ALenum capability); AL_API ALboolean AL_APIENTRY alIsEnabled(ALenum capability); -/** State retrieval. */ +/* State retrieval. */ AL_API const ALchar* AL_APIENTRY alGetString(ALenum param); AL_API void AL_APIENTRY alGetBooleanv(ALenum param, ALboolean *values); AL_API void AL_APIENTRY alGetIntegerv(ALenum param, ALint *values); @@ -465,25 +464,25 @@ AL_API ALint AL_APIENTRY alGetInteger(ALenum param); AL_API ALfloat AL_APIENTRY alGetFloat(ALenum param); AL_API ALdouble AL_APIENTRY alGetDouble(ALenum param); -/** - * Error retrieval. - * - * Obtain the first error generated in the AL context since the last check. - */ +/* Error retrieval. */ + +/** Obtain the first error generated in the AL context since the last check. */ AL_API ALenum AL_APIENTRY alGetError(void); +/** Query for the presence of an extension on the AL context. */ +AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extname); /** - * Extension support. - * - * Query for the presence of an extension, and obtain any appropriate function - * pointers and enum values. + * Retrieve the address of a function. The returned function may be context- + * specific. */ -AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extname); AL_API void* AL_APIENTRY alGetProcAddress(const ALchar *fname); +/** + * Retrieve the value of an enum. The returned value may be context-specific. + */ AL_API ALenum AL_APIENTRY alGetEnumValue(const ALchar *ename); -/** Set Listener parameters */ +/* Set Listener parameters */ AL_API void AL_APIENTRY alListenerf(ALenum param, ALfloat value); AL_API void AL_APIENTRY alListener3f(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); AL_API void AL_APIENTRY alListenerfv(ALenum param, const ALfloat *values); @@ -491,7 +490,7 @@ AL_API void AL_APIENTRY alListeneri(ALenum param, ALint value); AL_API void AL_APIENTRY alListener3i(ALenum param, ALint value1, ALint value2, ALint value3); AL_API void AL_APIENTRY alListeneriv(ALenum param, const ALint *values); -/** Get Listener parameters */ +/* Get Listener parameters */ AL_API void AL_APIENTRY alGetListenerf(ALenum param, ALfloat *value); AL_API void AL_APIENTRY alGetListener3f(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); AL_API void AL_APIENTRY alGetListenerfv(ALenum param, ALfloat *values); @@ -507,7 +506,7 @@ AL_API void AL_APIENTRY alDeleteSources(ALsizei n, const ALuint *sources); /** Verify a handle is a valid Source. */ AL_API ALboolean AL_APIENTRY alIsSource(ALuint source); -/** Set Source parameters. */ +/* Set Source parameters. */ AL_API void AL_APIENTRY alSourcef(ALuint source, ALenum param, ALfloat value); AL_API void AL_APIENTRY alSource3f(ALuint source, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); AL_API void AL_APIENTRY alSourcefv(ALuint source, ALenum param, const ALfloat *values); @@ -515,7 +514,7 @@ AL_API void AL_APIENTRY alSourcei(ALuint source, ALenum param, ALint value); AL_API void AL_APIENTRY alSource3i(ALuint source, ALenum param, ALint value1, ALint value2, ALint value3); AL_API void AL_APIENTRY alSourceiv(ALuint source, ALenum param, const ALint *values); -/** Get Source parameters. */ +/* Get Source parameters. */ AL_API void AL_APIENTRY alGetSourcef(ALuint source, ALenum param, ALfloat *value); AL_API void AL_APIENTRY alGetSource3f(ALuint source, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); AL_API void AL_APIENTRY alGetSourcefv(ALuint source, ALenum param, ALfloat *values); @@ -558,7 +557,7 @@ AL_API ALboolean AL_APIENTRY alIsBuffer(ALuint buffer); /** Specifies the data to be copied into a buffer */ AL_API void AL_APIENTRY alBufferData(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq); -/** Set Buffer parameters, */ +/* Set Buffer parameters, */ AL_API void AL_APIENTRY alBufferf(ALuint buffer, ALenum param, ALfloat value); AL_API void AL_APIENTRY alBuffer3f(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3); AL_API void AL_APIENTRY alBufferfv(ALuint buffer, ALenum param, const ALfloat *values); @@ -566,7 +565,7 @@ AL_API void AL_APIENTRY alBufferi(ALuint buffer, ALenum param, ALint value); AL_API void AL_APIENTRY alBuffer3i(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3); AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum param, const ALint *values); -/** Get Buffer parameters. */ +/* Get Buffer parameters. */ AL_API void AL_APIENTRY alGetBufferf(ALuint buffer, ALenum param, ALfloat *value); AL_API void AL_APIENTRY alGetBuffer3f(ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3); AL_API void AL_APIENTRY alGetBufferfv(ALuint buffer, ALenum param, ALfloat *values); @@ -574,7 +573,7 @@ AL_API void AL_APIENTRY alGetBufferi(ALuint buffer, ALenum param, ALint *value); AL_API void AL_APIENTRY alGetBuffer3i(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3); AL_API void AL_APIENTRY alGetBufferiv(ALuint buffer, ALenum param, ALint *values); -/** Pointer-to-function type, useful for dynamically getting AL entry points. */ +/* Pointer-to-function type, useful for dynamically getting AL entry points. */ typedef void (AL_APIENTRY *LPALENABLE)(ALenum capability); typedef void (AL_APIENTRY *LPALDISABLE)(ALenum capability); typedef ALboolean (AL_APIENTRY *LPALISENABLED)(ALenum capability); diff --git a/vendor/openal-soft/include/AL/alc.h b/vendor/openal-soft/include/AL/alc.h index 5786bad2..c73b6e91 100644 --- a/vendor/openal-soft/include/AL/alc.h +++ b/vendor/openal-soft/include/AL/alc.h @@ -22,7 +22,7 @@ extern "C" { #endif -/** Deprecated macro. */ +/* Deprecated macros. */ #define ALCAPI ALC_API #define ALCAPIENTRY ALC_APIENTRY #define ALC_INVALID 0 @@ -89,7 +89,7 @@ typedef void ALCvoid; /** Context attribute: <int> Hz. */ #define ALC_REFRESH 0x1008 -/** Context attribute: AL_TRUE or AL_FALSE. */ +/** Context attribute: AL_TRUE or AL_FALSE synchronous context? */ #define ALC_SYNC 0x1009 /** Context attribute: <int> requested Mono (3D) Sources. */ @@ -117,12 +117,14 @@ typedef void ALCvoid; #define ALC_OUT_OF_MEMORY 0xA005 -/** Runtime ALC version. */ +/** Runtime ALC major version. */ #define ALC_MAJOR_VERSION 0x1000 +/** Runtime ALC minor version. */ #define ALC_MINOR_VERSION 0x1001 -/** Context attribute list properties. */ +/** Context attribute list size. */ #define ALC_ATTRIBUTES_SIZE 0x1002 +/** Context attribute list properties. */ #define ALC_ALL_ATTRIBUTES 0x1003 /** String for the default device specifier. */ @@ -166,49 +168,80 @@ typedef void ALCvoid; #define ALC_ALL_DEVICES_SPECIFIER 0x1013 -/** Context management. */ -ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint* attrlist); +/* Context management. */ + +/** Create and attach a context to the given device. */ +ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint *attrlist); +/** + * Makes the given context the active process-wide context. Passing NULL clears + * the active context. + */ ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context); +/** Resumes processing updates for the given context. */ ALC_API void ALC_APIENTRY alcProcessContext(ALCcontext *context); +/** Suspends updates for the given context. */ ALC_API void ALC_APIENTRY alcSuspendContext(ALCcontext *context); +/** Remove a context from its device and destroys it. */ ALC_API void ALC_APIENTRY alcDestroyContext(ALCcontext *context); +/** Returns the currently active context. */ ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void); +/** Returns the device that a particular context is attached to. */ ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice(ALCcontext *context); -/** Device management. */ +/* Device management. */ + +/** Opens the named playback device. */ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename); +/** Closes the given playback device. */ ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device); +/* Error support. */ -/** - * Error support. - * - * Obtain the most recent Device error. - */ +/** Obtain the most recent Device error. */ ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device); +/* Extension support. */ + /** - * Extension support. - * - * Query for the presence of an extension, and obtain any appropriate - * function pointers and enum values. + * Query for the presence of an extension on the device. Pass a NULL device to + * query a device-inspecific extension. */ ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname); -ALC_API void* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *funcname); +/** + * Retrieve the address of a function. Given a non-NULL device, the returned + * function may be device-specific. + */ +ALC_API ALCvoid* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *funcname); +/** + * Retrieve the value of an enum. Given a non-NULL device, the returned value + * may be device-specific. + */ ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *enumname); -/** Query function. */ +/* Query functions. */ + +/** Returns information about the device, and error strings. */ ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum param); +/** Returns information about the device and the version of OpenAL. */ ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values); -/** Capture function. */ +/* Capture functions. */ + +/** + * Opens the named capture device with the given frequency, format, and buffer + * size. + */ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize); +/** Closes the given capture device. */ ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device); +/** Starts capturing samples into the device buffer. */ ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device); +/** Stops capturing samples. Samples in the device buffer remain available. */ ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device); +/** Reads samples from the device buffer. */ ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples); -/** Pointer-to-function type, useful for dynamically getting ALC entry points. */ +/* Pointer-to-function type, useful for dynamically getting ALC entry points. */ typedef ALCcontext* (ALC_APIENTRY *LPALCCREATECONTEXT)(ALCdevice *device, const ALCint *attrlist); typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)(ALCcontext *context); typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)(ALCcontext *context); @@ -220,7 +253,7 @@ typedef ALCdevice* (ALC_APIENTRY *LPALCOPENDEVICE)(const ALCchar *devicename typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)(ALCdevice *device); typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)(ALCdevice *device); typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)(ALCdevice *device, const ALCchar *extname); -typedef void* (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname); +typedef ALCvoid* (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname); typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname); typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)(ALCdevice *device, ALCenum param); typedef void (ALC_APIENTRY *LPALCGETINTEGERV)(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values); diff --git a/vendor/openal-soft/include/AL/alext.h b/vendor/openal-soft/include/AL/alext.h index bfc7c104..ef5e8cb6 100644 --- a/vendor/openal-soft/include/AL/alext.h +++ b/vendor/openal-soft/include/AL/alext.h @@ -25,6 +25,8 @@ /* Define int64_t and uint64_t types */ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #include <inttypes.h> +#elif defined(__cplusplus) && __cplusplus >= 201103L +#include <cinttypes> #elif defined(_WIN32) && defined(__GNUC__) #include <stdint.h> #elif defined(_WIN32) @@ -158,9 +160,9 @@ extern "C" { #ifndef AL_EXT_STATIC_BUFFER #define AL_EXT_STATIC_BUFFER 1 -typedef ALvoid (AL_APIENTRY*PFNALBUFFERDATASTATICPROC)(const ALint,ALenum,ALvoid*,ALsizei,ALsizei); +typedef void (AL_APIENTRY*PFNALBUFFERDATASTATICPROC)(const ALint,ALenum,ALvoid*,ALsizei,ALsizei); #ifdef AL_ALEXT_PROTOTYPES -AL_API ALvoid AL_APIENTRY alBufferDataStatic(const ALint buffer, ALenum format, ALvoid *data, ALsizei len, ALsizei freq); +AL_API void AL_APIENTRY alBufferDataStatic(const ALint buffer, ALenum format, ALvoid *data, ALsizei len, ALsizei freq); #endif #endif @@ -193,9 +195,9 @@ ALC_API ALCcontext* ALC_APIENTRY alcGetThreadContext(void); #define AL_SOFT_buffer_sub_data 1 #define AL_BYTE_RW_OFFSETS_SOFT 0x1031 #define AL_SAMPLE_RW_OFFSETS_SOFT 0x1032 -typedef ALvoid (AL_APIENTRY*PFNALBUFFERSUBDATASOFTPROC)(ALuint,ALenum,const ALvoid*,ALsizei,ALsizei); +typedef void (AL_APIENTRY*PFNALBUFFERSUBDATASOFTPROC)(ALuint,ALenum,const ALvoid*,ALsizei,ALsizei); #ifdef AL_ALEXT_PROTOTYPES -AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer,ALenum format,const ALvoid *data,ALsizei offset,ALsizei length); +AL_API void AL_APIENTRY alBufferSubDataSOFT(ALuint buffer,ALenum format,const ALvoid *data,ALsizei offset,ALsizei length); #endif #endif @@ -381,11 +383,11 @@ AL_API void AL_APIENTRY alGetSourcei64vSOFT(ALuint source, ALenum param, ALint64 #ifndef AL_SOFT_deferred_updates #define AL_SOFT_deferred_updates 1 #define AL_DEFERRED_UPDATES_SOFT 0xC002 -typedef ALvoid (AL_APIENTRY*LPALDEFERUPDATESSOFT)(void); -typedef ALvoid (AL_APIENTRY*LPALPROCESSUPDATESSOFT)(void); +typedef void (AL_APIENTRY*LPALDEFERUPDATESSOFT)(void); +typedef void (AL_APIENTRY*LPALPROCESSUPDATESSOFT)(void); #ifdef AL_ALEXT_PROTOTYPES -AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void); -AL_API ALvoid AL_APIENTRY alProcessUpdatesSOFT(void); +AL_API void AL_APIENTRY alDeferUpdatesSOFT(void); +AL_API void AL_APIENTRY alProcessUpdatesSOFT(void); #endif #endif @@ -530,6 +532,52 @@ ALC_API void ALC_APIENTRY alcGetInteger64vSOFT(ALCdevice *device, ALCenum pname, #define AL_N3D_SOFT 0x0002 #endif +#ifndef ALC_SOFT_loopback_bformat +#define ALC_SOFT_loopback_bformat 1 +#define ALC_AMBISONIC_LAYOUT_SOFT 0x1997 +#define ALC_AMBISONIC_SCALING_SOFT 0x1998 +#define ALC_AMBISONIC_ORDER_SOFT 0x1999 +#define ALC_MAX_AMBISONIC_ORDER_SOFT 0x199B + +#define ALC_BFORMAT3D_SOFT 0x1507 + +/* Ambisonic layouts */ +#define ALC_FUMA_SOFT 0x0000 +#define ALC_ACN_SOFT 0x0001 + +/* Ambisonic scalings (normalization) */ +/*#define ALC_FUMA_SOFT*/ +#define ALC_SN3D_SOFT 0x0001 +#define ALC_N3D_SOFT 0x0002 +#endif + +#ifndef AL_SOFT_effect_target +#define AL_SOFT_effect_target +#define AL_EFFECTSLOT_TARGET_SOFT 0x199C +#endif + +#ifndef AL_SOFT_events +#define AL_SOFT_events 1 +#define AL_EVENT_CALLBACK_FUNCTION_SOFT 0x19A2 +#define AL_EVENT_CALLBACK_USER_PARAM_SOFT 0x19A3 +#define AL_EVENT_TYPE_BUFFER_COMPLETED_SOFT 0x19A4 +#define AL_EVENT_TYPE_SOURCE_STATE_CHANGED_SOFT 0x19A5 +#define AL_EVENT_TYPE_DISCONNECTED_SOFT 0x19A6 +typedef void (AL_APIENTRY*ALEVENTPROCSOFT)(ALenum eventType, ALuint object, ALuint param, + ALsizei length, const ALchar *message, + void *userParam); +typedef void (AL_APIENTRY*LPALEVENTCONTROLSOFT)(ALsizei count, const ALenum *types, ALboolean enable); +typedef void (AL_APIENTRY*LPALEVENTCALLBACKSOFT)(ALEVENTPROCSOFT callback, void *userParam); +typedef void* (AL_APIENTRY*LPALGETPOINTERSOFT)(ALenum pname); +typedef void (AL_APIENTRY*LPALGETPOINTERVSOFT)(ALenum pname, void **values); +#ifdef AL_ALEXT_PROTOTYPES +AL_API void AL_APIENTRY alEventControlSOFT(ALsizei count, const ALenum *types, ALboolean enable); +AL_API void AL_APIENTRY alEventCallbackSOFT(ALEVENTPROCSOFT callback, void *userParam); +AL_API void* AL_APIENTRY alGetPointerSOFT(ALenum pname); +AL_API void AL_APIENTRY alGetPointervSOFT(ALenum pname, void **values); +#endif +#endif + #ifdef __cplusplus } #endif diff --git a/vendor/openal-soft/include/AL/efx.h b/vendor/openal-soft/include/AL/efx.h index 34085651..5ab64a64 100644 --- a/vendor/openal-soft/include/AL/efx.h +++ b/vendor/openal-soft/include/AL/efx.h @@ -243,41 +243,41 @@ typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTF)(ALuint, ALenum, ALfloat* typedef void (AL_APIENTRY *LPALGETAUXILIARYEFFECTSLOTFV)(ALuint, ALenum, ALfloat*); #ifdef AL_ALEXT_PROTOTYPES -AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects); -AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, const ALuint *effects); +AL_API void AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects); +AL_API void AL_APIENTRY alDeleteEffects(ALsizei n, const ALuint *effects); AL_API ALboolean AL_APIENTRY alIsEffect(ALuint effect); -AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue); -AL_API ALvoid AL_APIENTRY alEffectiv(ALuint effect, ALenum param, const ALint *piValues); -AL_API ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue); -AL_API ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, const ALfloat *pflValues); -AL_API ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piValue); -AL_API ALvoid AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *piValues); -AL_API ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pflValue); -AL_API ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pflValues); - -AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters); -AL_API ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, const ALuint *filters); +AL_API void AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue); +AL_API void AL_APIENTRY alEffectiv(ALuint effect, ALenum param, const ALint *piValues); +AL_API void AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue); +AL_API void AL_APIENTRY alEffectfv(ALuint effect, ALenum param, const ALfloat *pflValues); +AL_API void AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piValue); +AL_API void AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *piValues); +AL_API void AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pflValue); +AL_API void AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pflValues); + +AL_API void AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters); +AL_API void AL_APIENTRY alDeleteFilters(ALsizei n, const ALuint *filters); AL_API ALboolean AL_APIENTRY alIsFilter(ALuint filter); -AL_API ALvoid AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint iValue); -AL_API ALvoid AL_APIENTRY alFilteriv(ALuint filter, ALenum param, const ALint *piValues); -AL_API ALvoid AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat flValue); -AL_API ALvoid AL_APIENTRY alFilterfv(ALuint filter, ALenum param, const ALfloat *pflValues); -AL_API ALvoid AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *piValue); -AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piValues); -AL_API ALvoid AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *pflValue); -AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *pflValues); - -AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots); -AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *effectslots); +AL_API void AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint iValue); +AL_API void AL_APIENTRY alFilteriv(ALuint filter, ALenum param, const ALint *piValues); +AL_API void AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat flValue); +AL_API void AL_APIENTRY alFilterfv(ALuint filter, ALenum param, const ALfloat *pflValues); +AL_API void AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *piValue); +AL_API void AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piValues); +AL_API void AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *pflValue); +AL_API void AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *pflValues); + +AL_API void AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots); +AL_API void AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *effectslots); AL_API ALboolean AL_APIENTRY alIsAuxiliaryEffectSlot(ALuint effectslot); -AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint iValue); -AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, const ALint *piValues); -AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat flValue); -AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, const ALfloat *pflValues); -AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint *piValue); -AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALint *piValues); -AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat *pflValue); -AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, ALfloat *pflValues); +AL_API void AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint iValue); +AL_API void AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, const ALint *piValues); +AL_API void AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat flValue); +AL_API void AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, const ALfloat *pflValues); +AL_API void AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint *piValue); +AL_API void AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALint *piValues); +AL_API void AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat *pflValue); +AL_API void AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, ALfloat *pflValues); #endif /* Filter ranges and defaults. */ diff --git a/vendor/openal-soft/libs/Win32/OpenAL32.lib b/vendor/openal-soft/libs/Win32/OpenAL32.lib Binary files differindex 542f441a..9a81867b 100644 --- a/vendor/openal-soft/libs/Win32/OpenAL32.lib +++ b/vendor/openal-soft/libs/Win32/OpenAL32.lib diff --git a/vendor/openal-soft/libs/Win64/OpenAL32.lib b/vendor/openal-soft/libs/Win64/OpenAL32.lib Binary files differindex 2ea3cd9d..ab1790d9 100644 --- a/vendor/openal-soft/libs/Win64/OpenAL32.lib +++ b/vendor/openal-soft/libs/Win64/OpenAL32.lib |