mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-27 06:12:19 +00:00
- fixed: The clipper for the main scene may not be initialized before the camera textures have been drawn.
It looks like the memory management at use here is not capable of maintaining multiple instances simultaneously and the camera textures create another scene drawer so the initialization of the main scene drawer has to be delayed until after the camera textures are done.
This commit is contained in:
parent
3f7160183d
commit
7d8d69d01b
2 changed files with 12 additions and 11 deletions
|
@ -167,6 +167,8 @@ public:
|
|||
unsigned char *GetTextureBuffer(FTexture *tex, int &w, int &h);
|
||||
void SetupLevel();
|
||||
|
||||
void RenderView(player_t* player);
|
||||
|
||||
void RenderScreenQuad();
|
||||
void PostProcessScene(int fixedcm);
|
||||
void AmbientOccludeScene();
|
||||
|
|
|
@ -871,13 +871,12 @@ sector_t * GLSceneDrawer::RenderViewpoint (AActor * camera, GL_IRECT * bounds, f
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void GLSceneDrawer::RenderView (player_t* player)
|
||||
void FGLRenderer::RenderView (player_t* player)
|
||||
{
|
||||
|
||||
checkBenchActive();
|
||||
|
||||
gl_RenderState.SetVertexBuffer(GLRenderer->mVBO);
|
||||
GLRenderer->mVBO->Reset();
|
||||
gl_RenderState.SetVertexBuffer(mVBO);
|
||||
mVBO->Reset();
|
||||
|
||||
// reset statistics counters
|
||||
ResetProfilingData();
|
||||
|
@ -889,7 +888,7 @@ void GLSceneDrawer::RenderView (player_t* player)
|
|||
|
||||
P_FindParticleSubsectors ();
|
||||
|
||||
if (!gl.legacyMode) GLRenderer->mLights->Clear();
|
||||
if (!gl.legacyMode) mLights->Clear();
|
||||
|
||||
// NoInterpolateView should have no bearing on camera textures, but needs to be preserved for the main view below.
|
||||
bool saved_niv = NoInterpolateView;
|
||||
|
@ -910,15 +909,16 @@ void GLSceneDrawer::RenderView (player_t* player)
|
|||
{
|
||||
fovratio = ratio;
|
||||
}
|
||||
GLSceneDrawer drawer;
|
||||
|
||||
SetFixedColormap (player);
|
||||
drawer.SetFixedColormap (player);
|
||||
|
||||
// Check if there's some lights. If not some code can be skipped.
|
||||
TThinkerIterator<ADynamicLight> it(STAT_DLIGHT);
|
||||
GLRenderer->mLightCount = ((it.Next()) != NULL);
|
||||
mLightCount = ((it.Next()) != NULL);
|
||||
|
||||
GLRenderer->mShadowMap.Update();
|
||||
sector_t * viewsector = RenderViewpoint(player->camera, NULL, r_viewpoint.FieldOfView.Degrees, ratio, fovratio, true, true);
|
||||
mShadowMap.Update();
|
||||
sector_t * viewsector = drawer.RenderViewpoint(player->camera, NULL, r_viewpoint.FieldOfView.Degrees, ratio, fovratio, true, true);
|
||||
|
||||
All.Unclock();
|
||||
}
|
||||
|
@ -1068,8 +1068,7 @@ void FGLInterface::WriteSavePic (player_t *player, FileWriter *file, int width,
|
|||
|
||||
void FGLInterface::RenderView(player_t *player)
|
||||
{
|
||||
GLSceneDrawer drawer;
|
||||
drawer.RenderView(player);
|
||||
GLRenderer->RenderView(player);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
Loading…
Reference in a new issue