mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-12-29 15:23:02 +05:00
Out of map bounds bug fixed
Steam subtitle sizes Ready for 1.1 beta release, I guess
This commit is contained in:
parent
d226dcc055
commit
41588e0d2d
3 changed files with 50 additions and 12 deletions
|
@ -78,7 +78,7 @@
|
||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
|
|
|
@ -17,23 +17,18 @@ static unsigned int nSamplesLeftToProcess = 0;
|
||||||
|
|
||||||
unsigned int CAEDataStream::Seek(long nToSeek, int nPoint)
|
unsigned int CAEDataStream::Seek(long nToSeek, int nPoint)
|
||||||
{
|
{
|
||||||
LONG nRealDistToSeek;
|
|
||||||
|
|
||||||
switch ( nPoint )
|
switch ( nPoint )
|
||||||
{
|
{
|
||||||
case FILE_BEGIN:
|
case FILE_BEGIN:
|
||||||
nRealDistToSeek = nToSeek + dwStartPosition;
|
nToSeek = nToSeek + dwStartPosition;
|
||||||
break;
|
|
||||||
case FILE_CURRENT:
|
|
||||||
nRealDistToSeek = nToSeek;
|
|
||||||
break;
|
break;
|
||||||
case FILE_END:
|
case FILE_END:
|
||||||
nPoint = FILE_BEGIN;
|
nPoint = FILE_BEGIN;
|
||||||
nRealDistToSeek = dwStartPosition + dwLength - nToSeek;
|
nToSeek = dwStartPosition + dwLength - nToSeek;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
dwCurrentPosition = SetFilePointer(hHandle, nRealDistToSeek, nullptr, nPoint);
|
dwCurrentPosition = SetFilePointer(hHandle, nToSeek, nullptr, nPoint);
|
||||||
|
|
||||||
return dwCurrentPosition - dwStartPosition;
|
return dwCurrentPosition - dwStartPosition;
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,6 +187,8 @@ void __stdcall Recalculate(float& fX, float& fY, signed int nShadow)
|
||||||
static CLinkList<AlphaObjectInfo>& m_alphaList = **(CLinkList<AlphaObjectInfo>**)0x733A4D;
|
static CLinkList<AlphaObjectInfo>& m_alphaList = **(CLinkList<AlphaObjectInfo>**)0x733A4D;
|
||||||
static CLinkList<CEntity*>& ms_weaponPedsForPC = **(CLinkList<CEntity*>**)0x53EACA;
|
static CLinkList<CEntity*>& ms_weaponPedsForPC = **(CLinkList<CEntity*>**)0x53EACA;
|
||||||
|
|
||||||
|
static unsigned char* ZonesVisited = *(unsigned char**)0x57216A - 9;
|
||||||
|
|
||||||
#ifndef SA_STEAM_TEST
|
#ifndef SA_STEAM_TEST
|
||||||
void** rwengine = *(void***)0x58FFC0;
|
void** rwengine = *(void***)0x58FFC0;
|
||||||
#else
|
#else
|
||||||
|
@ -236,8 +238,6 @@ RpMaterial* AlphaTest(RpMaterial* pMaterial, void* pData)
|
||||||
return pMaterial;
|
return pMaterial;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <cassert>
|
|
||||||
|
|
||||||
RpMaterial* AlphaTestAndPush(RpMaterial* pMaterial, void* pData)
|
RpMaterial* AlphaTestAndPush(RpMaterial* pMaterial, void* pData)
|
||||||
{
|
{
|
||||||
if ( RpMaterialGetTexture(pMaterial) )
|
if ( RpMaterialGetTexture(pMaterial) )
|
||||||
|
@ -325,7 +325,6 @@ RpAtomic* TwoPassAlphaRender(RpAtomic* atomic)
|
||||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, reinterpret_cast<void*>(nAlphaBlending));
|
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, reinterpret_cast<void*>(nAlphaBlending));
|
||||||
|
|
||||||
return pAtomic;
|
return pAtomic;
|
||||||
//return nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RpAtomic* StaticPropellerRender(RpAtomic* pAtomic)
|
RpAtomic* StaticPropellerRender(RpAtomic* pAtomic)
|
||||||
|
@ -403,6 +402,19 @@ void RenderWeaponsList()
|
||||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, reinterpret_cast<void*>(nAlphaBlending));
|
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, reinterpret_cast<void*>(nAlphaBlending));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GetCurrentZoneLockedOrUnlocked(float fPosX, float fPosY)
|
||||||
|
{
|
||||||
|
int Xindex = (fPosX+3000.0f) * (1.0f/600.0f);
|
||||||
|
int Yindex = (fPosY+3000.0f) * (1.0f/600.0f);
|
||||||
|
|
||||||
|
// "Territories fix"
|
||||||
|
if ( (Xindex >= 0 && Xindex < 10) && (Yindex >= 0 && Yindex < 10) )
|
||||||
|
return ZonesVisited[10*Xindex - Yindex + 9] != 0;
|
||||||
|
|
||||||
|
// Outside of map bounds
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template<int pFltX, int pFltY>
|
template<int pFltX, int pFltY>
|
||||||
|
@ -1922,6 +1934,12 @@ void StartNewMission_BasketballFix()
|
||||||
BasketballFix(ScriptSpace+200000, 69000);
|
BasketballFix(ScriptSpace+200000, 69000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const float fSteamSubtitleSizeX = 0.45f;
|
||||||
|
static const float fSteamSubtitleSizeY = 0.9f;
|
||||||
|
static const float fSteamRadioNamePosY = 33.0f;
|
||||||
|
static const float fSteamRadioNameSizeX = 0.4f;
|
||||||
|
static const float fSteamRadioNameSizeY = 0.6f;
|
||||||
|
|
||||||
BOOL InjectDelayedPatches_10()
|
BOOL InjectDelayedPatches_10()
|
||||||
{
|
{
|
||||||
if ( !IsAlreadyRunning() )
|
if ( !IsAlreadyRunning() )
|
||||||
|
@ -1974,6 +1992,28 @@ BOOL InjectDelayedPatches_10()
|
||||||
Patch<float>(*(float**)0x7034C0, 0.0);
|
Patch<float>(*(float**)0x7034C0, 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( GetPrivateProfileInt("SilentPatch", "SkipIntroSplashes", TRUE, ".\\SilentPatchSA.ini") != FALSE )
|
||||||
|
{
|
||||||
|
// Skip the damn intro splash
|
||||||
|
Patch<WORD>(0x748AA8, 0x3DEB);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetPrivateProfileInt("SilentPatch", "SmallSteamTexts", TRUE, ".\\SilentPatchSA.ini") != FALSE )
|
||||||
|
{
|
||||||
|
// We're on 1.0 - make texts smaller
|
||||||
|
Patch<const void*>(0x58C387, &fSteamSubtitleSizeY);
|
||||||
|
Patch<const void*>(0x58C40F, &fSteamSubtitleSizeY);
|
||||||
|
Patch<const void*>(0x58C4CE, &fSteamSubtitleSizeY);
|
||||||
|
|
||||||
|
Patch<const void*>(0x58C39D, &fSteamSubtitleSizeX);
|
||||||
|
Patch<const void*>(0x58C425, &fSteamSubtitleSizeX);
|
||||||
|
Patch<const void*>(0x58C4E4, &fSteamSubtitleSizeX);
|
||||||
|
|
||||||
|
Patch<const void*>(0x4E9FD8, &fSteamRadioNamePosY);
|
||||||
|
Patch<const void*>(0x4E9F22, &fSteamRadioNameSizeY);
|
||||||
|
Patch<const void*>(0x4E9F38, &fSteamRadioNameSizeX);
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -2150,6 +2190,9 @@ __forceinline void Patch_SA_10()
|
||||||
//Patch<const void*>(0x4F35E7, &UserTrackExtensions[1].Codec);
|
//Patch<const void*>(0x4F35E7, &UserTrackExtensions[1].Codec);
|
||||||
Patch<BYTE>(0x4F322D, sizeof(UserTrackExtensions));
|
Patch<BYTE>(0x4F322D, sizeof(UserTrackExtensions));
|
||||||
|
|
||||||
|
// Zones fix
|
||||||
|
InjectHook(0x572130, GetCurrentZoneLockedOrUnlocked, PATCH_JUMP);
|
||||||
|
|
||||||
// Fixed police scanner names
|
// Fixed police scanner names
|
||||||
char* pScannerNames = *(char**)0x4E72D4;
|
char* pScannerNames = *(char**)0x4E72D4;
|
||||||
strncpy(pScannerNames + (8*113), "WESTP", 8);
|
strncpy(pScannerNames + (8*113), "WESTP", 8);
|
||||||
|
|
Loading…
Reference in a new issue