1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-24 17:40:00 +00:00

some quick cosmetic fixes

This commit is contained in:
aap 2020-05-07 14:41:35 +02:00
parent 54662674e6
commit 6a7d08ecc2
2 changed files with 12 additions and 34 deletions

View file

@ -105,6 +105,7 @@ void CMovingThings::Init()
EndCloseList.m_pPrev = &CMovingThings::StartCloseList; EndCloseList.m_pPrev = &CMovingThings::StartCloseList;
Num = 0; Num = 0;
#ifndef MIAMI // something is still used here actually
// Initialize scroll bars // Initialize scroll bars
aScrollBars[0].Init(CVector( 228.3f, -669.0f, 39.0f ), SCROLL_BUSINESS, 0.0f, 0.5f, 0.5f, 255, 128, 0, 0.3f); aScrollBars[0].Init(CVector( 228.3f, -669.0f, 39.0f ), SCROLL_BUSINESS, 0.0f, 0.5f, 0.5f, 255, 128, 0, 0.3f);
aScrollBars[1].Init(CVector( 772.0f, 164.0f, -9.5f ), SCROLL_TRAFFIC, 0.0f, 0.5f, 0.25f, 128, 255, 0, 0.3f); aScrollBars[1].Init(CVector( 772.0f, 164.0f, -9.5f ), SCROLL_TRAFFIC, 0.0f, 0.5f, 0.25f, 128, 255, 0, 0.3f);
@ -137,6 +138,7 @@ void CMovingThings::Init()
CVector(58.145f - sz.y * 0.05f - sz.x * 0.3f, -1079.268f + sz.x * 0.05f - sz.y * 0.3f, 32.803f), CVector(58.145f - sz.y * 0.05f - sz.x * 0.3f, -1079.268f + sz.x * 0.05f - sz.y * 0.3f, 32.803f),
-sz.x, -sz.y, 0, 255, 0, 100.0f, 0.8f -sz.x, -sz.y, 0, 255, 0, 100.0f, 0.8f
); );
#endif
} }
void CMovingThings::Shutdown() void CMovingThings::Shutdown()

View file

@ -11,8 +11,6 @@ CSkidmark CSkidmarks::aSkidmarks[NUMSKIDMARKS];
RwImVertexIndex SkidmarkIndexList[SKIDMARK_LENGTH * 6]; RwImVertexIndex SkidmarkIndexList[SKIDMARK_LENGTH * 6];
RwIm3DVertex SkidmarkVertices[SKIDMARK_LENGTH * 2]; RwIm3DVertex SkidmarkVertices[SKIDMARK_LENGTH * 2];
RwTexture *gpSkidTex; RwTexture *gpSkidTex;
RwTexture *gpSkidBloodTex;
RwTexture *gpSkidMudTex;
void void
CSkidmarks::Init(void) CSkidmarks::Init(void)
@ -22,8 +20,6 @@ CSkidmarks::Init(void)
slot = CTxdStore::FindTxdSlot("particle"); slot = CTxdStore::FindTxdSlot("particle");
CTxdStore::SetCurrentTxd(slot); CTxdStore::SetCurrentTxd(slot);
gpSkidTex = RwTextureRead("particleskid", nil); gpSkidTex = RwTextureRead("particleskid", nil);
gpSkidBloodTex = RwTextureRead("particleskidblood", nil);
gpSkidMudTex = RwTextureRead("particleskidmud", nil);
CTxdStore::PopCurrentTxd(); CTxdStore::PopCurrentTxd();
for(i = 0; i < NUMSKIDMARKS; i++){ for(i = 0; i < NUMSKIDMARKS; i++){
@ -54,17 +50,7 @@ void
CSkidmarks::Shutdown(void) CSkidmarks::Shutdown(void)
{ {
RwTextureDestroy(gpSkidTex); RwTextureDestroy(gpSkidTex);
#ifdef GTA3_1_1_PATCH
gpSkidTex = nil; gpSkidTex = nil;
#endif
RwTextureDestroy(gpSkidBloodTex);
#ifdef GTA3_1_1_PATCH
gpSkidBloodTex = nil;
#endif
RwTextureDestroy(gpSkidMudTex);
#ifdef GTA3_1_1_PATCH
gpSkidMudTex = nil;
#endif
} }
void void
@ -116,33 +102,23 @@ void
CSkidmarks::Render(void) CSkidmarks::Render(void)
{ {
int i, j; int i, j;
RwTexture *lastTex = nil;
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA); RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA); RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpSkidTex));
for(i = 0; i < NUMSKIDMARKS; i++){ for(i = 0; i < NUMSKIDMARKS; i++){
if(aSkidmarks[i].m_state == 0 || aSkidmarks[i].m_last < 1) if(aSkidmarks[i].m_state == 0 || aSkidmarks[i].m_last < 1)
continue; continue;
if(aSkidmarks[i].m_isBloody){ CRGBA color(0, 0, 0, 255);
if(lastTex != gpSkidBloodTex){ // TODO(MIAMI): we have a type field here actually (0-3)
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpSkidBloodTex)); if(aSkidmarks[i].m_isBloody) // TODO: type 3
lastTex = gpSkidBloodTex; color = CRGBA(132, 34, 11, 255);
} else if(aSkidmarks[i].m_isMuddy) // TODO: type 1
}else if(aSkidmarks[i].m_isMuddy){ color = CRGBA(90, 62, 9, 255);
if(lastTex != gpSkidMudTex){
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpSkidMudTex));
lastTex = gpSkidMudTex;
}
}else{
if(lastTex != gpSkidTex){
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpSkidTex));
lastTex = gpSkidTex;
}
}
uint32 fade, alpha; uint32 fade, alpha;
if(aSkidmarks[i].m_state == 1 || CTimer::GetTimeInMilliseconds() < aSkidmarks[i].m_fadeStart) if(aSkidmarks[i].m_state == 1 || CTimer::GetTimeInMilliseconds() < aSkidmarks[i].m_fadeStart)
@ -158,9 +134,9 @@ CSkidmarks::Render(void)
CVector p1 = aSkidmarks[i].m_pos[j] + aSkidmarks[i].m_side[j]; CVector p1 = aSkidmarks[i].m_pos[j] + aSkidmarks[i].m_side[j];
CVector p2 = aSkidmarks[i].m_pos[j] - aSkidmarks[i].m_side[j]; CVector p2 = aSkidmarks[i].m_pos[j] - aSkidmarks[i].m_side[j];
RwIm3DVertexSetRGBA(&SkidmarkVertices[j*2+0], 255, 255, 255, alpha); RwIm3DVertexSetRGBA(&SkidmarkVertices[j*2+0], color.red, color.green, color.blue, alpha);
RwIm3DVertexSetPos(&SkidmarkVertices[j*2+0], p1.x, p1.y, p1.z+0.1f); RwIm3DVertexSetPos(&SkidmarkVertices[j*2+0], p1.x, p1.y, p1.z+0.1f);
RwIm3DVertexSetRGBA(&SkidmarkVertices[j*2+1], 255, 255, 255, alpha); RwIm3DVertexSetRGBA(&SkidmarkVertices[j*2+1], color.red, color.green, color.blue, alpha);
RwIm3DVertexSetPos(&SkidmarkVertices[j*2+1], p2.x, p2.y, p2.z+0.1f); RwIm3DVertexSetPos(&SkidmarkVertices[j*2+1], p2.x, p2.y, p2.z+0.1f);
} }