mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-11-25 14:52:30 +01:00
Numberplates code optimised
This commit is contained in:
parent
4b8d9be799
commit
675c2d114b
@ -44,7 +44,7 @@ bool CVehicle::CustomCarPlate_TextureCreate(CVehicleModelInfo* pModelInfo)
|
||||
return true;
|
||||
}
|
||||
|
||||
static RwTexture* pPushedTextures[NUM_MAX_PLATES];
|
||||
//static RwTexture* pPushedTextures[NUM_MAX_PLATES];
|
||||
|
||||
void CVehicle::CustomCarPlate_BeforeRenderingStart(CVehicleModelInfo* pModelInfo)
|
||||
{
|
||||
@ -52,10 +52,10 @@ void CVehicle::CustomCarPlate_BeforeRenderingStart(CVehicleModelInfo* pModelInfo
|
||||
{
|
||||
if ( pModelInfo->m_apPlateMaterials[i] )
|
||||
{
|
||||
RwTexture* pPlateTex = RpMaterialGetTexture(pModelInfo->m_apPlateMaterials[i]);
|
||||
//RwTexture* pPlateTex = RpMaterialGetTexture(pModelInfo->m_apPlateMaterials[i]);
|
||||
|
||||
RwTextureAddRef(pPlateTex);
|
||||
pPushedTextures[i] = pPlateTex;
|
||||
//RwTextureAddRef(pPlateTex);
|
||||
//pPushedTextures[i] = pPlateTex;
|
||||
|
||||
RpMaterialSetTexture(pModelInfo->m_apPlateMaterials[i], PlateTexture);
|
||||
}
|
||||
@ -71,8 +71,8 @@ void CVehicle::CustomCarPlate_BeforeRenderingStart(CVehicleModelInfo* pModelInfo
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CVehicle::CustomCarPlate_AfterRenderingStop(CVehicleModelInfo* pModelInfo)
|
||||
// This is not needed
|
||||
/*void CVehicle::CustomCarPlate_AfterRenderingStop(CVehicleModelInfo* pModelInfo)
|
||||
{
|
||||
for ( int i = 0; i < NUM_MAX_PLATES; i++ )
|
||||
{
|
||||
@ -83,13 +83,13 @@ void CVehicle::CustomCarPlate_AfterRenderingStop(CVehicleModelInfo* pModelInfo)
|
||||
//RwTextureAddRef(pPlateTex);
|
||||
//pPushedTextures[i] = pPlateTex;
|
||||
|
||||
RpMaterialSetTexture(pModelInfo->m_apPlateMaterials[i], pPushedTextures[i]);
|
||||
RwTextureDestroy(pPushedTextures[i]);
|
||||
pPushedTextures[i] = nullptr;
|
||||
//RpMaterialSetTexture(pModelInfo->m_apPlateMaterials[i], pPushedTextures[i]);
|
||||
//RwTextureDestroy(pPushedTextures[i]);
|
||||
//pPushedTextures[i] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
void CHeli::Render()
|
||||
{
|
||||
|
@ -111,7 +111,7 @@ public:
|
||||
|
||||
bool CustomCarPlate_TextureCreate(CVehicleModelInfo* pModelInfo);
|
||||
void CustomCarPlate_BeforeRenderingStart(CVehicleModelInfo* pModelInfo);
|
||||
void CustomCarPlate_AfterRenderingStop(CVehicleModelInfo* pModelInfo);
|
||||
//void CustomCarPlate_AfterRenderingStop(CVehicleModelInfo* pModelInfo);
|
||||
|
||||
bool IsLawEnforcementVehicle();
|
||||
|
||||
|
@ -2388,10 +2388,11 @@ __forceinline void Patch_SA_10()
|
||||
mov [pFunc], eax
|
||||
}
|
||||
Patch<const void*>(&pVMT[7], pFunc);
|
||||
Patch<BYTE>(0x6D0E43, 0xEB);
|
||||
InjectMethodVP(0x4C9660, CVehicleModelInfo::SetCarCustomPlate, PATCH_NOTHING);
|
||||
InjectMethodVP(0x6D6A58, CVehicle::CustomCarPlate_TextureCreate, PATCH_NOTHING);
|
||||
InjectMethodVP(0x6D651C, CVehicle::CustomCarPlate_BeforeRenderingStart, PATCH_NOTHING);
|
||||
InjectMethodVP(0x6D0E53, CVehicle::CustomCarPlate_AfterRenderingStop, PATCH_NOTHING);
|
||||
//InjectMethodVP(0x6D0E53, CVehicle::CustomCarPlate_AfterRenderingStop, PATCH_NOTHING);
|
||||
|
||||
// Fixed police scanner names
|
||||
char* pScannerNames = *(char**)0x4E72D4;
|
||||
|
Loading…
Reference in New Issue
Block a user