1
0
Fork 0
mirror of https://github.com/halpz/re3.git synced 2024-12-26 18:15:27 +00:00

CBrightLight::render

This commit is contained in:
Roman Masanin 2020-10-12 13:28:06 +03:00
parent ca1d899413
commit e6a1ea9d4f
2 changed files with 30 additions and 3 deletions

View file

@ -988,6 +988,9 @@ CBrightLights::Render(void)
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA); RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, nil); RwRenderStateSet(rwRENDERSTATETEXTURERASTER, nil);
TempBufferVerticesStored = 0;
TempBufferIndicesStored = 0;
for(i = 0; i < NumBrightLights; i++){ for(i = 0; i < NumBrightLights; i++){
if(TempBufferIndicesStored > TEMPBUFFERINDEXSIZE-40 || TempBufferVerticesStored > TEMPBUFFERVERTSIZE-40) if(TempBufferIndicesStored > TEMPBUFFERINDEXSIZE-40 || TempBufferVerticesStored > TEMPBUFFERVERTSIZE-40)
RenderOutGeometryBuffer(); RenderOutGeometryBuffer();
@ -1024,6 +1027,13 @@ CBrightLights::Render(void)
g = aBrightLights[i].m_green; g = aBrightLights[i].m_green;
b = aBrightLights[i].m_blue; b = aBrightLights[i].m_blue;
break; break;
default:
#ifdef FIX_BUGS //just to make sure that color never will be undefined
r = 0;
g = 0;
b = 0;
#endif
break;
} }
if(aBrightLights[i].m_camDist < BRIGHTLIGHTS_FADE_DIST) if(aBrightLights[i].m_camDist < BRIGHTLIGHTS_FADE_DIST)
@ -1087,6 +1097,22 @@ CBrightLights::Render(void)
TempBufferIndicesStored += 12*3; TempBufferIndicesStored += 12*3;
break; break;
case BRIGHTLIGHT_FRONT_BIG:
case BRIGHTLIGHT_REAR_BIG:
for (j = 0; j < 8; j++) {
pos = BigCarHeadLightsSide[j] * aBrightLights[i].m_side +
BigCarHeadLightsUp[j] * aBrightLights[i].m_up +
BigCarHeadLightsFront[j] * aBrightLights[i].m_front +
aBrightLights[i].m_pos;
RwIm3DVertexSetRGBA(&TempBufferRenderVertices[TempBufferVerticesStored + j], r, g, b, a);
RwIm3DVertexSetPos(&TempBufferRenderVertices[TempBufferVerticesStored + j], pos.x, pos.y, pos.z);
}
for (j = 0; j < 12 * 3; j++)
TempBufferRenderIndexList[TempBufferIndicesStored + j] = CubeIndices[j] + TempBufferVerticesStored;
TempBufferVerticesStored += 8;
TempBufferIndicesStored += 12 * 3;
break;
case BRIGHTLIGHT_FRONT_TALL: case BRIGHTLIGHT_FRONT_TALL:
case BRIGHTLIGHT_REAR_TALL: case BRIGHTLIGHT_REAR_TALL:
for(j = 0; j < 8; j++){ for(j = 0; j < 8; j++){
@ -1105,8 +1131,8 @@ CBrightLights::Render(void)
case BRIGHTLIGHT_SIREN: case BRIGHTLIGHT_SIREN:
for(j = 0; j < 6; j++){ for(j = 0; j < 6; j++){
pos = SirenLightsSide[j]*aBrightLights[i].m_side + pos = SirenLightsSide[j]*TheCamera.GetRight() +
SirenLightsUp[j]*aBrightLights[i].m_up + SirenLightsUp[j]* TheCamera.GetUp() +
aBrightLights[i].m_pos; aBrightLights[i].m_pos;
RwIm3DVertexSetRGBA(&TempBufferRenderVertices[TempBufferVerticesStored+j], r, g, b, a); RwIm3DVertexSetRGBA(&TempBufferRenderVertices[TempBufferVerticesStored+j], r, g, b, a);
RwIm3DVertexSetPos(&TempBufferRenderVertices[TempBufferVerticesStored+j], pos.x, pos.y, pos.z); RwIm3DVertexSetPos(&TempBufferRenderVertices[TempBufferVerticesStored+j], pos.x, pos.y, pos.z);

View file

@ -165,6 +165,7 @@ public:
uint8 m_blue; uint8 m_blue;
}; };
//done
class CBrightLights class CBrightLights
{ {
static int NumBrightLights; static int NumBrightLights;
@ -173,7 +174,7 @@ public:
static void Init(void); //done static void Init(void); //done
static void RegisterOne(CVector pos, CVector up, CVector side, CVector front, static void RegisterOne(CVector pos, CVector up, CVector side, CVector front,
uint8 type, uint8 red = 0, uint8 green = 0, uint8 blue = 0); //done uint8 type, uint8 red = 0, uint8 green = 0, uint8 blue = 0); //done
static void Render(void); //looks similad but needs recheck !!!!!!!!!!!!!!!!! static void Render(void); //done
static void RenderOutGeometryBuffer(void); //done static void RenderOutGeometryBuffer(void); //done
}; };