1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-23 03:20:00 +00:00

add debug render groups

This commit is contained in:
aap 2021-02-18 12:21:52 +01:00
parent bb8b823c30
commit 996772faf2
21 changed files with 136 additions and 1 deletions

View file

@ -1,5 +1,6 @@
#include "common.h" #include "common.h"
#include "main.h"
#include "Timer.h" #include "Timer.h"
#include "ModelIndices.h" #include "ModelIndices.h"
#include "Streaming.h" #include "Streaming.h"
@ -91,9 +92,11 @@ void
CRopes::Render(void) CRopes::Render(void)
{ {
int i; int i;
PUSH_RENDERGROUP("CRopes::Render");
for(i = 0; i < ARRAY_SIZE(aRopes); i++) for(i = 0; i < ARRAY_SIZE(aRopes); i++)
if(aRopes[i].m_bActive) if(aRopes[i].m_bActive)
aRopes[i].Render(); aRopes[i].Render();
POP_RENDERGROUP();
} }
bool bool

View file

@ -1261,6 +1261,7 @@ if(gbRenderEverythingBarRoads)
void void
RenderScene_new(void) RenderScene_new(void)
{ {
PUSH_RENDERGROUP("RenderScene_new");
CClouds::Render(); CClouds::Render();
DoRWRenderHorizon(); DoRWRenderHorizon();
@ -1268,6 +1269,7 @@ RenderScene_new(void)
DefinedState(); DefinedState();
// CMattRenderer::ResetRenderStates // CMattRenderer::ResetRenderStates
// moved CRenderer::RenderBoats to before transparent water // moved CRenderer::RenderBoats to before transparent water
POP_RENDERGROUP();
} }
// TODO // TODO
@ -1275,6 +1277,7 @@ bool FredIsInFirstPersonCam(void) { return false; }
void void
RenderEffects_new(void) RenderEffects_new(void)
{ {
PUSH_RENDERGROUP("RenderEffects_new");
CShadows::RenderStaticShadows(); CShadows::RenderStaticShadows();
// CRenderer::GenerateEnvironmentMap // CRenderer::GenerateEnvironmentMap
CShadows::RenderStoredShadows(); CShadows::RenderStoredShadows();
@ -1319,6 +1322,7 @@ if(gbRenderFadingInEntities)
CPointLights::RenderFogEffect(); CPointLights::RenderFogEffect();
CMovingThings::Render(); CMovingThings::Render();
CRenderer::RenderFirstPersonVehicle(); CRenderer::RenderFirstPersonVehicle();
POP_RENDERGROUP();
} }
#endif #endif
@ -1331,6 +1335,7 @@ RenderScene(void)
return; return;
} }
#endif #endif
PUSH_RENDERGROUP("RenderScene");
CClouds::Render(); CClouds::Render();
DoRWRenderHorizon(); DoRWRenderHorizon();
CRenderer::RenderRoads(); CRenderer::RenderRoads();
@ -1346,11 +1351,13 @@ RenderScene(void)
RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE); RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE);
CWeather::RenderRainStreaks(); CWeather::RenderRainStreaks();
CCoronas::RenderSunReflection(); CCoronas::RenderSunReflection();
POP_RENDERGROUP();
} }
void void
RenderDebugShit(void) RenderDebugShit(void)
{ {
PUSH_RENDERGROUP("RenderDebugShit");
CTheScripts::RenderTheScriptDebugLines(); CTheScripts::RenderTheScriptDebugLines();
#ifndef FINAL #ifndef FINAL
if(gbShowCollisionLines) if(gbShowCollisionLines)
@ -1359,6 +1366,7 @@ RenderDebugShit(void)
CDebug::DrawLines(); CDebug::DrawLines();
DefinedState(); DefinedState();
#endif #endif
POP_RENDERGROUP();
} }
void void
@ -1370,6 +1378,7 @@ RenderEffects(void)
return; return;
} }
#endif #endif
PUSH_RENDERGROUP("RenderEffects");
CGlass::Render(); CGlass::Render();
CWaterCannons::Render(); CWaterCannons::Render();
CSpecialFX::Render(); CSpecialFX::Render();
@ -1386,11 +1395,13 @@ RenderEffects(void)
CPointLights::RenderFogEffect(); CPointLights::RenderFogEffect();
CMovingThings::Render(); CMovingThings::Render();
CRenderer::RenderFirstPersonVehicle(); CRenderer::RenderFirstPersonVehicle();
POP_RENDERGROUP();
} }
void void
Render2dStuff(void) Render2dStuff(void)
{ {
PUSH_RENDERGROUP("Render2dStuff");
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
@ -1462,6 +1473,7 @@ Render2dStuff(void)
#ifdef DEBUGMENU #ifdef DEBUGMENU
DebugMenuRender(); DebugMenuRender();
#endif #endif
POP_RENDERGROUP();
} }
void void
@ -1469,7 +1481,9 @@ RenderMenus(void)
{ {
if (FrontEndMenuManager.m_bMenuActive) if (FrontEndMenuManager.m_bMenuActive)
{ {
PUSH_RENDERGROUP("RenderMenus");
FrontEndMenuManager.DrawFrontEnd(); FrontEndMenuManager.DrawFrontEnd();
POP_RENDERGROUP();
} }
#ifndef MASTER #ifndef MASTER
else else
@ -1480,6 +1494,7 @@ RenderMenus(void)
void void
Render2dStuffAfterFade(void) Render2dStuffAfterFade(void)
{ {
PUSH_RENDERGROUP("Render2dStuffAfterFade");
#ifndef MASTER #ifndef MASTER
DisplayGameDebugText(); DisplayGameDebugText();
#endif #endif
@ -1490,6 +1505,7 @@ Render2dStuffAfterFade(void)
CHud::DrawAfterFade(); CHud::DrawAfterFade();
CFont::DrawFonts(); CFont::DrawFonts();
CCredits::Render(); CCredits::Render();
POP_RENDERGROUP();
} }
void void

View file

@ -1,5 +1,11 @@
#pragma once #pragma once
#if defined(RW_OPENGL)
#define PUSH_RENDERGROUP(str) glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, str)
#define POP_RENDERGROUP() glPopDebugGroup()
#else
#endif
struct GlobalScene struct GlobalScene
{ {
RpWorld *world; RpWorld *world;

View file

@ -7,6 +7,7 @@
#error "Need librw for EXTENDED_COLOURFILTER" #error "Need librw for EXTENDED_COLOURFILTER"
#endif #endif
#include "main.h"
#include "RwHelper.h" #include "RwHelper.h"
#include "Camera.h" #include "Camera.h"
#include "MBlur.h" #include "MBlur.h"
@ -385,6 +386,8 @@ CPostFX::GetBackBuffer(RwCamera *cam)
void void
CPostFX::Render(RwCamera *cam, uint32 red, uint32 green, uint32 blue, uint32 blur, int32 type, uint32 bluralpha) CPostFX::Render(RwCamera *cam, uint32 red, uint32 green, uint32 blue, uint32 blur, int32 type, uint32 bluralpha)
{ {
PUSH_RENDERGROUP("CPostFX::Render");
if(pFrontBuffer == nil) if(pFrontBuffer == nil)
Open(cam); Open(cam);
assert(pFrontBuffer); assert(pFrontBuffer);
@ -446,6 +449,8 @@ CPostFX::Render(RwCamera *cam, uint32 red, uint32 green, uint32 blue, uint32 blu
bJustInitialised = false; bJustInitialised = false;
}else }else
bJustInitialised = true; bJustInitialised = true;
POP_RENDERGROUP();
} }
int CPostFX::PrevRed[NUMAVERAGE], CPostFX::AvgRed; int CPostFX::PrevRed[NUMAVERAGE], CPostFX::AvgRed;

View file

@ -1,5 +1,6 @@
#include "common.h" #include "common.h"
#include "main.h"
#include "Antennas.h" #include "Antennas.h"
CAntenna CAntennas::aAntennas[NUMANTENNAS]; CAntenna CAntennas::aAntennas[NUMANTENNAS];
@ -70,6 +71,7 @@ CAntennas::Render(void)
{ {
int i, j; int i, j;
PUSH_RENDERGROUP("CAntennas::Render");
for(i = 0; i < NUMANTENNAS; i++){ for(i = 0; i < NUMANTENNAS; i++){
if(!aAntennas[i].active) if(!aAntennas[i].active)
continue; continue;
@ -101,6 +103,8 @@ CAntennas::Render(void)
} }
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
POP_RENDERGROUP();
} }
void void

View file

@ -1,5 +1,6 @@
#include "common.h" #include "common.h"
#include "main.h"
#include "Sprite.h" #include "Sprite.h"
#include "Sprite2d.h" #include "Sprite2d.h"
#include "General.h" #include "General.h"
@ -119,6 +120,8 @@ CClouds::Render(void)
if(!CGame::CanSeeOutSideFromCurrArea()) if(!CGame::CanSeeOutSideFromCurrArea())
return; return;
PUSH_RENDERGROUP("CClouds::Render");
CCoronas::SunBlockedByClouds = false; CCoronas::SunBlockedByClouds = false;
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
@ -301,6 +304,8 @@ CClouds::Render(void)
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA); RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA); RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
POP_RENDERGROUP();
} }
bool bool
@ -313,6 +318,8 @@ void
CClouds::RenderBackground(int16 topred, int16 topgreen, int16 topblue, CClouds::RenderBackground(int16 topred, int16 topgreen, int16 topblue,
int16 botred, int16 botgreen, int16 botblue, int16 alpha) int16 botred, int16 botgreen, int16 botblue, int16 alpha)
{ {
PUSH_RENDERGROUP("CClouds::RenderBackground");
CVector right = CrossProduct(TheCamera.GetUp(), TheCamera.GetForward()); CVector right = CrossProduct(TheCamera.GetUp(), TheCamera.GetForward());
right.Normalise(); right.Normalise();
float c = right.Magnitude2D(); float c = right.Magnitude2D();
@ -415,6 +422,8 @@ CClouds::RenderBackground(int16 topred, int16 topgreen, int16 topblue,
ms_colourBottom.g = fogg; ms_colourBottom.g = fogg;
ms_colourBottom.b = fogb; ms_colourBottom.b = fogb;
} }
POP_RENDERGROUP();
} }
void void
@ -423,6 +432,8 @@ CClouds::RenderHorizon(void)
if(UseDarkBackground()) if(UseDarkBackground())
return; return;
PUSH_RENDERGROUP("CClouds::RenderHorizon");
ms_colourBottom.a = 230; ms_colourBottom.a = 230;
ms_colourTop.a = 80; ms_colourTop.a = 80;
@ -457,4 +468,6 @@ CClouds::RenderHorizon(void)
CSprite2d::DrawAnyRect(0.0f, topleft, SCREEN_WIDTH, topright, 0.0f, botleft, SCREEN_WIDTH, botright, CSprite2d::DrawAnyRect(0.0f, topleft, SCREEN_WIDTH, topright, 0.0f, botleft, SCREEN_WIDTH, botright,
ms_colourBkGrd, ms_colourBkGrd, ms_colourBkGrd, ms_colourBkGrd); ms_colourBkGrd, ms_colourBkGrd, ms_colourBkGrd, ms_colourBkGrd);
POP_RENDERGROUP();
} }

View file

@ -249,6 +249,8 @@ CCoronas::Render(void)
int i, j; int i, j;
int screenw, screenh; int screenw, screenh;
PUSH_RENDERGROUP("CCoronas::Render");
screenw = RwRasterGetWidth(RwCameraGetRaster(Scene.camera)); screenw = RwRasterGetWidth(RwCameraGetRaster(Scene.camera));
screenh = RwRasterGetHeight(RwCameraGetRaster(Scene.camera)); screenh = RwRasterGetHeight(RwCameraGetRaster(Scene.camera));
@ -432,6 +434,8 @@ CCoronas::Render(void)
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
POP_RENDERGROUP();
} }
void void
@ -442,6 +446,8 @@ CCoronas::RenderReflections(void)
CEntity *entity; CEntity *entity;
if(CWeather::WetRoads > 0.0f){ if(CWeather::WetRoads > 0.0f){
PUSH_RENDERGROUP("CCoronas::RenderReflections");
CSprite::InitSpriteBuffer(); CSprite::InitSpriteBuffer();
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE);
@ -517,6 +523,8 @@ CCoronas::RenderReflections(void)
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE);
POP_RENDERGROUP();
}else{ }else{
for(i = 0; i < NUMCORONAS; i++) for(i = 0; i < NUMCORONAS; i++)
aCoronas[i].renderReflection = false; aCoronas[i].renderReflection = false;

View file

@ -459,6 +459,7 @@ void CMovingThings::Update()
void CMovingThings::Render() void CMovingThings::Render()
{ {
PUSH_RENDERGROUP("CMovingThings::Render");
CSmokeTrails::Update(); CSmokeTrails::Update();
int i; int i;
@ -471,6 +472,7 @@ void CMovingThings::Render()
CPlaneTrails::Render(); CPlaneTrails::Render();
CSmokeTrails::Render(); CSmokeTrails::Render();
CPlaneBanners::Render(); CPlaneBanners::Render();
POP_RENDERGROUP();
} }
void CMovingThings::RegisterOne(CEntity *pEnt, uint16 nType) { void CMovingThings::RegisterOne(CEntity *pEnt, uint16 nType) {

View file

@ -276,6 +276,8 @@ CGlass::Render(void)
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void *)rwBLENDONE); RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void *)rwBLENDONE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)TRUE);
PUSH_RENDERGROUP("CGlass::Render");
for ( int32 i = 0; i < NUM_GLASSPANES; i++ ) for ( int32 i = 0; i < NUM_GLASSPANES; i++ )
{ {
if ( aGlassPanes[i].m_bActive ) if ( aGlassPanes[i].m_bActive )
@ -285,6 +287,8 @@ CGlass::Render(void)
for ( uint32 i = 0; i < NumGlassEntities; i++ ) for ( uint32 i = 0; i < NumGlassEntities; i++ )
RenderEntityInGlass(apEntitiesToBeRendered[i]); RenderEntityInGlass(apEntitiesToBeRendered[i]);
POP_RENDERGROUP();
NumGlassEntities = 0; NumGlassEntities = 0;
RenderHiLightPolys(); RenderHiLightPolys();

View file

@ -6,6 +6,7 @@
#include <d3d8caps.h> #include <d3d8caps.h>
#endif #endif
#include "main.h"
#include "General.h" #include "General.h"
#include "RwHelper.h" #include "RwHelper.h"
#include "Camera.h" #include "Camera.h"
@ -333,6 +334,7 @@ CMBlur::MotionBlurRender(RwCamera *cam, uint32 red, uint32 green, uint32 blue, u
#ifdef EXTENDED_COLOURFILTER #ifdef EXTENDED_COLOURFILTER
CPostFX::Render(cam, red, green, blue, blur, type, bluralpha); CPostFX::Render(cam, red, green, blue, blur, type, bluralpha);
#else #else
PUSH_RENDERGROUP("CMBlur::MotionBlurRender");
RwRGBA color = { (RwUInt8)red, (RwUInt8)green, (RwUInt8)blue, (RwUInt8)blur }; RwRGBA color = { (RwUInt8)red, (RwUInt8)green, (RwUInt8)blue, (RwUInt8)blur };
#ifdef GTA_PS2 #ifdef GTA_PS2
if( pFrontBuffer ) if( pFrontBuffer )
@ -348,6 +350,7 @@ CMBlur::MotionBlurRender(RwCamera *cam, uint32 red, uint32 green, uint32 blue, u
RwRasterPopContext(); RwRasterPopContext();
} }
#endif #endif
POP_RENDERGROUP();
#endif #endif
} }

View file

@ -1,5 +1,6 @@
#include "common.h" #include "common.h"
#include "main.h"
#include "General.h" #include "General.h"
#include "Timer.h" #include "Timer.h"
#include "TxdStore.h" #include "TxdStore.h"
@ -1785,6 +1786,8 @@ void CParticle::Update()
void CParticle::Render() void CParticle::Render()
{ {
PUSH_RENDERGROUP("CParticle::Render");
RwRenderStateSet(rwRENDERSTATETEXTUREADDRESS, (void *)rwTEXTUREADDRESSWRAP); RwRenderStateSet(rwRENDERSTATETEXTUREADDRESS, (void *)rwTEXTUREADDRESSWRAP);
RwRenderStateSet(rwRENDERSTATETEXTUREPERSPECTIVE, (void *)TRUE); RwRenderStateSet(rwRENDERSTATETEXTUREPERSPECTIVE, (void *)TRUE);
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void *)FALSE); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void *)FALSE);
@ -2282,6 +2285,8 @@ void CParticle::Render()
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void *)TRUE); RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void *)TRUE);
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void *)rwBLENDSRCALPHA); RwRenderStateSet(rwRENDERSTATESRCBLEND, (void *)rwBLENDSRCALPHA);
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void *)rwBLENDINVSRCALPHA); RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void *)rwBLENDINVSRCALPHA);
POP_RENDERGROUP();
} }
void CParticle::RemovePSystem(tParticleType type) void CParticle::RemovePSystem(tParticleType type)

View file

@ -159,6 +159,8 @@ CPointLights::RenderFogEffect(void)
if(CCutsceneMgr::IsRunning()) if(CCutsceneMgr::IsRunning())
return; return;
PUSH_RENDERGROUP("CPointLights::RenderFogEffect");
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDONE); RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDONE);
@ -302,6 +304,8 @@ CPointLights::RenderFogEffect(void)
} }
CSprite::FlushSpriteBuffer(); CSprite::FlushSpriteBuffer();
POP_RENDERGROUP();
} }
bool bool

View file

@ -130,8 +130,13 @@ CRenderer::RenderOneRoad(CEntity *e)
return; return;
if(gbShowCollisionPolys) if(gbShowCollisionPolys)
CCollision::DrawColModel_Coloured(e->GetMatrix(), *CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel(), e->GetModelIndex()); CCollision::DrawColModel_Coloured(e->GetMatrix(), *CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel(), e->GetModelIndex());
else else{
PUSH_RENDERGROUP(CModelInfo::GetModelInfo(e->GetModelIndex())->GetModelName());
e->Render(); e->Render();
POP_RENDERGROUP();
}
} }
void void
@ -178,6 +183,8 @@ CRenderer::RenderOneNonRoad(CEntity *e)
} }
#endif #endif
PUSH_RENDERGROUP(CModelInfo::GetModelInfo(e->GetModelIndex())->GetModelName());
resetLights = e->SetupLighting(); resetLights = e->SetupLighting();
if(e->IsVehicle()){ if(e->IsVehicle()){
@ -206,6 +213,8 @@ CRenderer::RenderOneNonRoad(CEntity *e)
} }
e->RemoveLighting(resetLights); e->RemoveLighting(resetLights);
POP_RENDERGROUP();
} }
void void
@ -231,6 +240,7 @@ CRenderer::RenderRoads(void)
int i; int i;
CEntity *e; CEntity *e;
PUSH_RENDERGROUP("CRenderer::RenderRoads");
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
SetCullMode(rwCULLMODECULLBACK); SetCullMode(rwCULLMODECULLBACK);
@ -242,6 +252,7 @@ CRenderer::RenderRoads(void)
if(IsRoad(e)) if(IsRoad(e))
RenderOneRoad(e); RenderOneRoad(e);
} }
POP_RENDERGROUP();
} }
inline bool PutIntoSortedVehicleList(CVehicle *veh) inline bool PutIntoSortedVehicleList(CVehicle *veh)
@ -264,6 +275,7 @@ CRenderer::RenderEverythingBarRoads(void)
CEntity *e; CEntity *e;
EntityInfo ei; EntityInfo ei;
PUSH_RENDERGROUP("CRenderer::RenderEverythingBarRoads");
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
SetCullMode(rwCULLMODECULLBACK); SetCullMode(rwCULLMODECULLBACK);
@ -295,6 +307,7 @@ CRenderer::RenderEverythingBarRoads(void)
}else }else
RenderOneNonRoad(e); RenderOneNonRoad(e);
} }
POP_RENDERGROUP();
} }
void void
@ -302,6 +315,7 @@ CRenderer::RenderBoats(void)
{ {
CLink<EntityInfo> *node; CLink<EntityInfo> *node;
PUSH_RENDERGROUP("CRenderer::RenderBoats");
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
SetCullMode(rwCULLMODECULLBACK); SetCullMode(rwCULLMODECULLBACK);
@ -330,6 +344,7 @@ CRenderer::RenderBoats(void)
CVehicle *v = (CVehicle*)node->item.ent; CVehicle *v = (CVehicle*)node->item.ent;
RenderOneNonRoad(v); RenderOneNonRoad(v);
} }
POP_RENDERGROUP();
} }
#ifdef NEW_RENDERER #ifdef NEW_RENDERER
@ -433,6 +448,7 @@ CRenderer::RenderWorld(int pass)
switch(pass){ switch(pass){
case 0: case 0:
// Roads // Roads
PUSH_RENDERGROUP("CRenderer::RenderWorld - Roads");
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
for(i = 0; i < ms_nNoOfVisibleBuildings; i++){ for(i = 0; i < ms_nNoOfVisibleBuildings; i++){
e = ms_aVisibleBuildingPtrs[i]; e = ms_aVisibleBuildingPtrs[i];
@ -446,9 +462,11 @@ CRenderer::RenderWorld(int pass)
if(e->bIsBIGBuilding || IsRoad(e)) if(e->bIsBIGBuilding || IsRoad(e))
RenderOneBuilding(e, node->item.sort); RenderOneBuilding(e, node->item.sort);
} }
POP_RENDERGROUP();
break; break;
case 1: case 1:
// Opaque // Opaque
PUSH_RENDERGROUP("CRenderer::RenderWorld - Opaque");
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
for(i = 0; i < ms_nNoOfVisibleBuildings; i++){ for(i = 0; i < ms_nNoOfVisibleBuildings; i++){
e = ms_aVisibleBuildingPtrs[i]; e = ms_aVisibleBuildingPtrs[i];
@ -469,14 +487,17 @@ CRenderer::RenderWorld(int pass)
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE);
WorldRender::RenderBlendPass(PASS_NOZ); WorldRender::RenderBlendPass(PASS_NOZ);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
POP_RENDERGROUP();
break; break;
case 2: case 2:
// Transparent // Transparent
PUSH_RENDERGROUP("CRenderer::RenderWorld - Transparent");
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDONE); RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDONE);
WorldRender::RenderBlendPass(PASS_ADD); WorldRender::RenderBlendPass(PASS_ADD);
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA); RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
WorldRender::RenderBlendPass(PASS_BLEND); WorldRender::RenderBlendPass(PASS_BLEND);
POP_RENDERGROUP();
break; break;
} }
} }
@ -487,11 +508,13 @@ CRenderer::RenderPeds(void)
int i; int i;
CEntity *e; CEntity *e;
PUSH_RENDERGROUP("CRenderer::RenderPeds");
for(i = 0; i < ms_nNoOfVisibleVehicles; i++){ for(i = 0; i < ms_nNoOfVisibleVehicles; i++){
e = ms_aVisibleVehiclePtrs[i]; e = ms_aVisibleVehiclePtrs[i];
if(e->IsPed()) if(e->IsPed())
RenderOneNonRoad(e); RenderOneNonRoad(e);
} }
POP_RENDERGROUP();
} }
void void
@ -502,6 +525,7 @@ CRenderer::RenderVehicles(void)
EntityInfo ei; EntityInfo ei;
CLink<EntityInfo> *node; CLink<EntityInfo> *node;
PUSH_RENDERGROUP("CRenderer::RenderVehicles");
// not the real thing // not the real thing
for(i = 0; i < ms_nNoOfVisibleVehicles; i++){ for(i = 0; i < ms_nNoOfVisibleVehicles; i++){
e = ms_aVisibleVehiclePtrs[i]; e = ms_aVisibleVehiclePtrs[i];
@ -518,6 +542,7 @@ CRenderer::RenderVehicles(void)
node != &gSortedVehiclesAndPeds.head; node != &gSortedVehiclesAndPeds.head;
node = node->prev) node = node->prev)
RenderOneNonRoad(node->item.ent); RenderOneNonRoad(node->item.ent);
POP_RENDERGROUP();
} }
void void
@ -526,6 +551,7 @@ CRenderer::RenderTransparentWater(void)
int i; int i;
CEntity *e; CEntity *e;
PUSH_RENDERGROUP("CRenderer::RenderTransparentWater");
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, nil); RwRenderStateSet(rwRENDERSTATETEXTURERASTER, nil);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE);
@ -549,6 +575,7 @@ CRenderer::RenderTransparentWater(void)
CWaterLevel::RenderTransparentWater(); CWaterLevel::RenderTransparentWater();
SetStencilState(0); SetStencilState(0);
POP_RENDERGROUP();
} }
void void
@ -569,20 +596,24 @@ CRenderer::ClearForFrame(void)
void void
CRenderer::RenderFadingInEntities(void) CRenderer::RenderFadingInEntities(void)
{ {
PUSH_RENDERGROUP("CRenderer::RenderFadingInEntities");
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
SetCullMode(rwCULLMODECULLBACK); SetCullMode(rwCULLMODECULLBACK);
DeActivateDirectional(); DeActivateDirectional();
SetAmbientColours(); SetAmbientColours();
CVisibilityPlugins::RenderFadingEntities(); CVisibilityPlugins::RenderFadingEntities();
POP_RENDERGROUP();
} }
void void
CRenderer::RenderFadingInUnderwaterEntities(void) CRenderer::RenderFadingInUnderwaterEntities(void)
{ {
PUSH_RENDERGROUP("CRenderer::RenderFadingInUnderwaterEntities");
DeActivateDirectional(); DeActivateDirectional();
SetAmbientColours(); SetAmbientColours();
CVisibilityPlugins::RenderFadingUnderwaterEntities(); CVisibilityPlugins::RenderFadingUnderwaterEntities();
POP_RENDERGROUP();
} }
void void

View file

@ -54,6 +54,8 @@ CRubbish::Render(void)
if(RubbishVisibility == 0) if(RubbishVisibility == 0)
return; return;
PUSH_RENDERGROUP("CRubbish::Render");
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
@ -150,6 +152,8 @@ CRubbish::Render(void)
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
POP_RENDERGROUP();
} }
void void

View file

@ -1068,6 +1068,8 @@ CShadows::SetRenderModeForShadowType(uint8 ShadowType)
void void
CShadows::RenderStoredShadows(void) CShadows::RenderStoredShadows(void)
{ {
PUSH_RENDERGROUP("CShadows::RenderStoredShadows");
RenderBuffer::ClearRenderBuffer(); RenderBuffer::ClearRenderBuffer();
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)FALSE);
@ -1241,12 +1243,16 @@ CShadows::RenderStoredShadows(void)
RwRenderStateSet(rwRENDERSTATETEXTUREADDRESS, (void *)rwTEXTUREADDRESSWRAP); RwRenderStateSet(rwRENDERSTATETEXTUREADDRESS, (void *)rwTEXTUREADDRESSWRAP);
ShadowsStoredToBeRendered = 0; ShadowsStoredToBeRendered = 0;
POP_RENDERGROUP();
} }
void void
CShadows::RenderStaticShadows(void) CShadows::RenderStaticShadows(void)
{ {
PUSH_RENDERGROUP("CShadows::RenderStaticShadows");
RenderBuffer::ClearRenderBuffer(); RenderBuffer::ClearRenderBuffer();
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)FALSE);
@ -1313,6 +1319,8 @@ CShadows::RenderStaticShadows(void)
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)FALSE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)FALSE);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)TRUE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)TRUE);
POP_RENDERGROUP();
} }

View file

@ -96,6 +96,8 @@ CSkidmarks::Render(void)
{ {
int i, j; int i, j;
PUSH_RENDERGROUP("CSkidmarks::Render");
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA); RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
@ -152,6 +154,8 @@ CSkidmarks::Render(void)
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE);
POP_RENDERGROUP();
} }
void void

View file

@ -164,6 +164,7 @@ CSpecialFX::Shutdown(void)
void void
CSpecialFX::Render(void) CSpecialFX::Render(void)
{ {
PUSH_RENDERGROUP("CSpecialFX::Render");
CMotionBlurStreaks::Render(); CMotionBlurStreaks::Render();
CBulletTraces::Render(); CBulletTraces::Render();
CBrightLights::Render(); CBrightLights::Render();
@ -173,6 +174,7 @@ CSpecialFX::Render(void)
if(!(gbNewRenderer && FredIsInFirstPersonCam())) if(!(gbNewRenderer && FredIsInFirstPersonCam()))
#endif #endif
C3dMarkers::Render(); C3dMarkers::Render();
POP_RENDERGROUP();
} }
void void

View file

@ -307,9 +307,11 @@ void CWaterCannons::Update(void)
void CWaterCannons::Render(void) void CWaterCannons::Render(void)
{ {
PUSH_RENDERGROUP("CWaterCannons::Render");
for ( int32 i = 0; i < NUM_WATERCANNONS; i++ ) for ( int32 i = 0; i < NUM_WATERCANNONS; i++ )
{ {
if ( aCannons[i].m_nId != 0 ) if ( aCannons[i].m_nId != 0 )
aCannons[i].Render(); aCannons[i].Render();
} }
POP_RENDERGROUP();
} }

View file

@ -1202,6 +1202,8 @@ CWaterLevel::RenderTransparentWater(void)
if ( !CGame::CanSeeWaterFromCurrArea() ) if ( !CGame::CanSeeWaterFromCurrArea() )
return; return;
PUSH_RENDERGROUP("CWaterLevel::RenderTransparentWater");
float fWaterDrawDist = _GetWavyDrawDist(); float fWaterDrawDist = _GetWavyDrawDist();
float fWaterDrawDistLarge = fWaterDrawDist + 90.0f; float fWaterDrawDistLarge = fWaterDrawDist + 90.0f;
float fWavySectorMaxRenderDistSqr = SQR(fWaterDrawDist); float fWavySectorMaxRenderDistSqr = SQR(fWaterDrawDist);
@ -1485,6 +1487,8 @@ CWaterLevel::RenderTransparentWater(void)
DefinedState(); DefinedState();
#endif #endif
POP_RENDERGROUP();
} }
void CWaterLevel::RenderOneFlatSmallWaterPoly(float fX, float fY, float fZ, RwRGBA const &color) void CWaterLevel::RenderOneFlatSmallWaterPoly(float fX, float fY, float fZ, RwRGBA const &color)

View file

@ -233,7 +233,9 @@ CVisibilityPlugins::RenderFadingEntities(CLinkList<AlphaObjectInfo> &list)
DeActivateDirectional(); DeActivateDirectional();
SetAmbientColours(); SetAmbientColours();
e->bImBeingRendered = true; e->bImBeingRendered = true;
PUSH_RENDERGROUP(mi->GetModelName());
RenderFadingAtomic((RpAtomic*)e->m_rwObject, node->item.sort); RenderFadingAtomic((RpAtomic*)e->m_rwObject, node->item.sort);
POP_RENDERGROUP();
e->bImBeingRendered = false; e->bImBeingRendered = false;
}else }else
CRenderer::RenderOneNonRoad(e); CRenderer::RenderOneNonRoad(e);

View file

@ -1,5 +1,6 @@
#include "common.h" #include "common.h"
#include "main.h"
#include "WeaponEffects.h" #include "WeaponEffects.h"
#include "TxdStore.h" #include "TxdStore.h"
#include "Sprite.h" #include "Sprite.h"
@ -103,6 +104,8 @@ CWeaponEffects::Render(void)
float w, h; float w, h;
if ( CSprite::CalcScreenCoors(gCrossHair.m_vecPos, &pos, &w, &h, true) ) if ( CSprite::CalcScreenCoors(gCrossHair.m_vecPos, &pos, &w, &h, true) )
{ {
PUSH_RENDERGROUP("CWeaponEffects::Render");
float recipz = 1.0f / pos.z; float recipz = 1.0f / pos.z;
CSprite::RenderOneXLUSprite_Rotate_Aspect(pos.x, pos.y, pos.z, CSprite::RenderOneXLUSprite_Rotate_Aspect(pos.x, pos.y, pos.z,
w, h, w, h,
@ -119,6 +122,8 @@ CWeaponEffects::Render(void)
gCrossHair.m_fRotation += 0.02f; gCrossHair.m_fRotation += 0.02f;
if ( gCrossHair.m_fRotation > TWOPI ) if ( gCrossHair.m_fRotation > TWOPI )
gCrossHair.m_fRotation = 0.0; gCrossHair.m_fRotation = 0.0;
POP_RENDERGROUP();
} }
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)FALSE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)FALSE);