diff options
author | aap <aap@papnet.eu> | 2021-02-18 12:21:52 +0100 |
---|---|---|
committer | aap <aap@papnet.eu> | 2021-02-18 12:21:52 +0100 |
commit | 996772faf2b7ed17269af194c6d9dcbdb37732fe (patch) | |
tree | cfb4d76317a169f665bf1f500e36d4aa2c0e54ec /src/render/Renderer.cpp | |
parent | Merge branch 'miami' of github.com:GTAmodding/re3 into miami (diff) | |
download | re3-996772faf2b7ed17269af194c6d9dcbdb37732fe.tar re3-996772faf2b7ed17269af194c6d9dcbdb37732fe.tar.gz re3-996772faf2b7ed17269af194c6d9dcbdb37732fe.tar.bz2 re3-996772faf2b7ed17269af194c6d9dcbdb37732fe.tar.lz re3-996772faf2b7ed17269af194c6d9dcbdb37732fe.tar.xz re3-996772faf2b7ed17269af194c6d9dcbdb37732fe.tar.zst re3-996772faf2b7ed17269af194c6d9dcbdb37732fe.zip |
Diffstat (limited to 'src/render/Renderer.cpp')
-rw-r--r-- | src/render/Renderer.cpp | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index dfbc02d7..6b306b6c 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -130,8 +130,13 @@ CRenderer::RenderOneRoad(CEntity *e) return; if(gbShowCollisionPolys) CCollision::DrawColModel_Coloured(e->GetMatrix(), *CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel(), e->GetModelIndex()); - else + else{ + PUSH_RENDERGROUP(CModelInfo::GetModelInfo(e->GetModelIndex())->GetModelName()); + e->Render(); + + POP_RENDERGROUP(); + } } void @@ -178,6 +183,8 @@ CRenderer::RenderOneNonRoad(CEntity *e) } #endif + PUSH_RENDERGROUP(CModelInfo::GetModelInfo(e->GetModelIndex())->GetModelName()); + resetLights = e->SetupLighting(); if(e->IsVehicle()){ @@ -206,6 +213,8 @@ CRenderer::RenderOneNonRoad(CEntity *e) } e->RemoveLighting(resetLights); + + POP_RENDERGROUP(); } void @@ -231,6 +240,7 @@ CRenderer::RenderRoads(void) int i; CEntity *e; + PUSH_RENDERGROUP("CRenderer::RenderRoads"); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); SetCullMode(rwCULLMODECULLBACK); @@ -242,6 +252,7 @@ CRenderer::RenderRoads(void) if(IsRoad(e)) RenderOneRoad(e); } + POP_RENDERGROUP(); } inline bool PutIntoSortedVehicleList(CVehicle *veh) @@ -264,6 +275,7 @@ CRenderer::RenderEverythingBarRoads(void) CEntity *e; EntityInfo ei; + PUSH_RENDERGROUP("CRenderer::RenderEverythingBarRoads"); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); SetCullMode(rwCULLMODECULLBACK); @@ -295,6 +307,7 @@ CRenderer::RenderEverythingBarRoads(void) }else RenderOneNonRoad(e); } + POP_RENDERGROUP(); } void @@ -302,6 +315,7 @@ CRenderer::RenderBoats(void) { CLink<EntityInfo> *node; + PUSH_RENDERGROUP("CRenderer::RenderBoats"); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); SetCullMode(rwCULLMODECULLBACK); @@ -330,6 +344,7 @@ CRenderer::RenderBoats(void) CVehicle *v = (CVehicle*)node->item.ent; RenderOneNonRoad(v); } + POP_RENDERGROUP(); } #ifdef NEW_RENDERER @@ -433,6 +448,7 @@ CRenderer::RenderWorld(int pass) switch(pass){ case 0: // Roads + PUSH_RENDERGROUP("CRenderer::RenderWorld - Roads"); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE); for(i = 0; i < ms_nNoOfVisibleBuildings; i++){ e = ms_aVisibleBuildingPtrs[i]; @@ -446,9 +462,11 @@ CRenderer::RenderWorld(int pass) if(e->bIsBIGBuilding || IsRoad(e)) RenderOneBuilding(e, node->item.sort); } + POP_RENDERGROUP(); break; case 1: // Opaque + PUSH_RENDERGROUP("CRenderer::RenderWorld - Opaque"); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE); for(i = 0; i < ms_nNoOfVisibleBuildings; i++){ e = ms_aVisibleBuildingPtrs[i]; @@ -469,14 +487,17 @@ CRenderer::RenderWorld(int pass) RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE); WorldRender::RenderBlendPass(PASS_NOZ); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE); + POP_RENDERGROUP(); break; case 2: // Transparent + PUSH_RENDERGROUP("CRenderer::RenderWorld - Transparent"); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDONE); WorldRender::RenderBlendPass(PASS_ADD); RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA); WorldRender::RenderBlendPass(PASS_BLEND); + POP_RENDERGROUP(); break; } } @@ -487,11 +508,13 @@ CRenderer::RenderPeds(void) int i; CEntity *e; + PUSH_RENDERGROUP("CRenderer::RenderPeds"); for(i = 0; i < ms_nNoOfVisibleVehicles; i++){ e = ms_aVisibleVehiclePtrs[i]; if(e->IsPed()) RenderOneNonRoad(e); } + POP_RENDERGROUP(); } void @@ -502,6 +525,7 @@ CRenderer::RenderVehicles(void) EntityInfo ei; CLink<EntityInfo> *node; + PUSH_RENDERGROUP("CRenderer::RenderVehicles"); // not the real thing for(i = 0; i < ms_nNoOfVisibleVehicles; i++){ e = ms_aVisibleVehiclePtrs[i]; @@ -518,6 +542,7 @@ CRenderer::RenderVehicles(void) node != &gSortedVehiclesAndPeds.head; node = node->prev) RenderOneNonRoad(node->item.ent); + POP_RENDERGROUP(); } void @@ -526,6 +551,7 @@ CRenderer::RenderTransparentWater(void) int i; CEntity *e; + PUSH_RENDERGROUP("CRenderer::RenderTransparentWater"); RwRenderStateSet(rwRENDERSTATETEXTURERASTER, nil); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE); @@ -549,6 +575,7 @@ CRenderer::RenderTransparentWater(void) CWaterLevel::RenderTransparentWater(); SetStencilState(0); + POP_RENDERGROUP(); } void @@ -569,20 +596,24 @@ CRenderer::ClearForFrame(void) void CRenderer::RenderFadingInEntities(void) { + PUSH_RENDERGROUP("CRenderer::RenderFadingInEntities"); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); SetCullMode(rwCULLMODECULLBACK); DeActivateDirectional(); SetAmbientColours(); CVisibilityPlugins::RenderFadingEntities(); + POP_RENDERGROUP(); } void CRenderer::RenderFadingInUnderwaterEntities(void) { + PUSH_RENDERGROUP("CRenderer::RenderFadingInUnderwaterEntities"); DeActivateDirectional(); SetAmbientColours(); CVisibilityPlugins::RenderFadingUnderwaterEntities(); + POP_RENDERGROUP(); } void |