diff options
author | aap <aap@papnet.eu> | 2020-05-07 14:41:35 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-05-07 14:41:35 +0200 |
commit | 6a7d08ecc25f21e61a62c06ff4d58065508bbb92 (patch) | |
tree | 077023e53ea2521b39e0e3fa5a576c117435fc6c /src/render | |
parent | Merge branch 'miami' of github.com:GTAmodding/re3 into miami (diff) | |
download | re3-6a7d08ecc25f21e61a62c06ff4d58065508bbb92.tar re3-6a7d08ecc25f21e61a62c06ff4d58065508bbb92.tar.gz re3-6a7d08ecc25f21e61a62c06ff4d58065508bbb92.tar.bz2 re3-6a7d08ecc25f21e61a62c06ff4d58065508bbb92.tar.lz re3-6a7d08ecc25f21e61a62c06ff4d58065508bbb92.tar.xz re3-6a7d08ecc25f21e61a62c06ff4d58065508bbb92.tar.zst re3-6a7d08ecc25f21e61a62c06ff4d58065508bbb92.zip |
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/Fluff.cpp | 4 | ||||
-rw-r--r-- | src/render/Skidmarks.cpp | 42 |
2 files changed, 12 insertions, 34 deletions
diff --git a/src/render/Fluff.cpp b/src/render/Fluff.cpp index 9f3f6929..59ac1652 100644 --- a/src/render/Fluff.cpp +++ b/src/render/Fluff.cpp @@ -104,7 +104,8 @@ void CMovingThings::Init() EndCloseList.m_pNext = nil; EndCloseList.m_pPrev = &CMovingThings::StartCloseList; Num = 0; - + +#ifndef MIAMI // something is still used here actually // 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[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), -sz.x, -sz.y, 0, 255, 0, 100.0f, 0.8f ); +#endif } void CMovingThings::Shutdown() diff --git a/src/render/Skidmarks.cpp b/src/render/Skidmarks.cpp index 5d521041..7f057319 100644 --- a/src/render/Skidmarks.cpp +++ b/src/render/Skidmarks.cpp @@ -11,8 +11,6 @@ CSkidmark CSkidmarks::aSkidmarks[NUMSKIDMARKS]; RwImVertexIndex SkidmarkIndexList[SKIDMARK_LENGTH * 6]; RwIm3DVertex SkidmarkVertices[SKIDMARK_LENGTH * 2]; RwTexture *gpSkidTex; -RwTexture *gpSkidBloodTex; -RwTexture *gpSkidMudTex; void CSkidmarks::Init(void) @@ -22,8 +20,6 @@ CSkidmarks::Init(void) slot = CTxdStore::FindTxdSlot("particle"); CTxdStore::SetCurrentTxd(slot); gpSkidTex = RwTextureRead("particleskid", nil); - gpSkidBloodTex = RwTextureRead("particleskidblood", nil); - gpSkidMudTex = RwTextureRead("particleskidmud", nil); CTxdStore::PopCurrentTxd(); for(i = 0; i < NUMSKIDMARKS; i++){ @@ -54,17 +50,7 @@ void CSkidmarks::Shutdown(void) { RwTextureDestroy(gpSkidTex); -#ifdef GTA3_1_1_PATCH gpSkidTex = nil; -#endif - RwTextureDestroy(gpSkidBloodTex); -#ifdef GTA3_1_1_PATCH - gpSkidBloodTex = nil; -#endif - RwTextureDestroy(gpSkidMudTex); -#ifdef GTA3_1_1_PATCH - gpSkidMudTex = nil; -#endif } void @@ -116,33 +102,23 @@ void CSkidmarks::Render(void) { int i, j; - RwTexture *lastTex = nil; RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA); RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA); + RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpSkidTex)); for(i = 0; i < NUMSKIDMARKS; i++){ if(aSkidmarks[i].m_state == 0 || aSkidmarks[i].m_last < 1) continue; - if(aSkidmarks[i].m_isBloody){ - if(lastTex != gpSkidBloodTex){ - RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpSkidBloodTex)); - lastTex = gpSkidBloodTex; - } - }else if(aSkidmarks[i].m_isMuddy){ - if(lastTex != gpSkidMudTex){ - RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpSkidMudTex)); - lastTex = gpSkidMudTex; - } - }else{ - if(lastTex != gpSkidTex){ - RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpSkidTex)); - lastTex = gpSkidTex; - } - } + CRGBA color(0, 0, 0, 255); + // TODO(MIAMI): we have a type field here actually (0-3) + if(aSkidmarks[i].m_isBloody) // TODO: type 3 + color = CRGBA(132, 34, 11, 255); + else if(aSkidmarks[i].m_isMuddy) // TODO: type 1 + color = CRGBA(90, 62, 9, 255); uint32 fade, alpha; 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 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); - 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); } |