diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-16 22:09:34 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-16 22:09:34 +0200 |
commit | 5c8888d2edb4f77a30ca52c5a48669d937ae9ef2 (patch) | |
tree | 62c1274fc38820d2f2037ae6dab48576439b1ed2 /src | |
parent | more script stuff (diff) | |
parent | Merge branch 'master' into miami (diff) | |
download | re3-5c8888d2edb4f77a30ca52c5a48669d937ae9ef2.tar re3-5c8888d2edb4f77a30ca52c5a48669d937ae9ef2.tar.gz re3-5c8888d2edb4f77a30ca52c5a48669d937ae9ef2.tar.bz2 re3-5c8888d2edb4f77a30ca52c5a48669d937ae9ef2.tar.lz re3-5c8888d2edb4f77a30ca52c5a48669d937ae9ef2.tar.xz re3-5c8888d2edb4f77a30ca52c5a48669d937ae9ef2.tar.zst re3-5c8888d2edb4f77a30ca52c5a48669d937ae9ef2.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/audio/AudioManager.cpp | 4 | ||||
-rw-r--r-- | src/fakerw/fake.cpp | 2 | ||||
-rw-r--r-- | src/rw/RwHelper.cpp | 11 |
3 files changed, 14 insertions, 3 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index 207d64ad..c30306c8 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -7459,7 +7459,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile * return; } if (processedAccelSampleStopped) { - if (!SampleManager.InitialiseChannel(m_nActiveSamples, soundOffset + 345, 0)) + if (!SampleManager.InitialiseChannel(m_nActiveSamples, soundOffset + SFX_CAR_ACCEL_1, 0)) return; SampleManager.SetChannelLoopCount(m_nActiveSamples, 1); SampleManager.SetChannelLoopPoints(m_nActiveSamples, 0, -1); @@ -7482,7 +7482,7 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile * } if (CurrentPretendGear < params->m_pTransmission->nNumberOfGears - 1) { ++CurrentPretendGear; - if (!SampleManager.InitialiseChannel(m_nActiveSamples, soundOffset + 345, 0)) + if (!SampleManager.InitialiseChannel(m_nActiveSamples, soundOffset + SFX_CAR_ACCEL_1, 0)) return; SampleManager.SetChannelLoopCount(m_nActiveSamples, 1); SampleManager.SetChannelLoopPoints(m_nActiveSamples, 0, -1); diff --git a/src/fakerw/fake.cpp b/src/fakerw/fake.cpp index 50d12b2f..71646020 100644 --- a/src/fakerw/fake.cpp +++ b/src/fakerw/fake.cpp @@ -470,7 +470,7 @@ RwBool RwRenderStateSet(RwRenderState state, void *value) uint32 uival = (uintptr)value; uint32 fog; switch(state){ - case rwRENDERSTATETEXTURERASTER: SetRenderState(TEXTURERASTER, uival); return true; + case rwRENDERSTATETEXTURERASTER: SetRenderStatePtr(TEXTURERASTER, value); return true; case rwRENDERSTATETEXTUREADDRESS: SetRenderState(TEXTUREADDRESS, uival); return true; case rwRENDERSTATETEXTUREADDRESSU: SetRenderState(TEXTUREADDRESSU, uival); return true; case rwRENDERSTATETEXTUREADDRESSV: SetRenderState(TEXTUREADDRESSV, uival); return true; diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp index 91916df3..a87874d7 100644 --- a/src/rw/RwHelper.cpp +++ b/src/rw/RwHelper.cpp @@ -60,6 +60,16 @@ void FlushObrsPrintfs() void * RwMallocAlign(RwUInt32 size, RwUInt32 align) { +#ifdef FIX_BUGS + uintptr ptralign = align-1; + void *mem = (void *)malloc(size + sizeof(uintptr) + ptralign); + + ASSERT(mem != nil); + + void *addr = (void *)((((uintptr)mem) + sizeof(uintptr) + ptralign) & ~ptralign); + + ASSERT(addr != nil); +#else void *mem = (void *)malloc(size + align); ASSERT(mem != nil); @@ -67,6 +77,7 @@ RwMallocAlign(RwUInt32 size, RwUInt32 align) void *addr = (void *)((((uintptr)mem) + align) & ~(align - 1)); ASSERT(addr != nil); +#endif *(((void **)addr) - 1) = mem; |