Merge branch 'master' of https://github.com/coelckers/gzdoom into gzdoom

This commit is contained in:
Magnus Norddahl 2018-05-29 23:30:38 +02:00
commit ac207cce85
7 changed files with 24 additions and 6 deletions

View file

@ -2730,6 +2730,7 @@ void D_DoomMain (void)
ST_Clear();
D_ErrorCleanup ();
DThinker::DestroyThinkersInList(STAT_STATIC);
E_Shutdown(false);
P_FreeLevelData();
P_FreeExtraLevelData();
@ -2775,6 +2776,8 @@ void D_DoomMain (void)
restart++;
PClass::bShutdown = false;
PClass::bVMOperational = false;
gamestate = GS_STARTUP;
}
while (1);
}

View file

@ -606,10 +606,7 @@ void GLSkyboxPortal::DrawContents(FDrawInfo *di)
di->SetViewArea();
ClearClipper(di);
int mapsection = R_PointInSubsector(r_viewpoint.Pos)->mapsection;
di->CurrentMapSections.Zero();
di->CurrentMapSections.Set(mapsection);
di->UpdateCurrentMapSection();
drawer->DrawScene(di, DM_SKYPORTAL);
portal->mFlags &= ~PORTSF_INSKYBOX;
@ -770,6 +767,8 @@ void GLPlaneMirrorPortal::DrawContents(FDrawInfo *di)
drawer->SetupView(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, r_viewpoint.Angles.Yaw, !!(MirrorFlag & 1), !!(PlaneMirrorFlag & 1));
ClearClipper(di);
di->UpdateCurrentMapSection();
gl_RenderState.SetClipHeight(planez, PlaneMirrorMode < 0 ? -1.f : 1.f);
drawer->DrawScene(di, DM_PORTAL);
gl_RenderState.SetClipHeight(0.f, 0.f);
@ -875,6 +874,8 @@ void GLMirrorPortal::DrawContents(FDrawInfo *di)
return;
}
di->UpdateCurrentMapSection();
di->mClipPortal = this;
DAngle StartAngle = r_viewpoint.Angles.Yaw;
DVector3 StartPos = r_viewpoint.Pos;

View file

@ -739,6 +739,8 @@ void GLSceneDrawer::WriteSavePic (player_t *player, FileWriter *file, int width,
GLRenderer->CopyToBackbuffer(&bounds, false);
glFlush();
screen->SetOutputViewport(nullptr);
uint8_t * scr = (uint8_t *)M_Malloc(width * height * 3);
glReadPixels(0,0,width, height,GL_RGB,GL_UNSIGNED_BYTE,scr);
M_CreatePNG (file, scr + ((height-1) * width * 3), NULL, SS_RGB, width, height, -width * 3, Gamma);

View file

@ -32,7 +32,6 @@ public:
angle_t FrustumAngle();
void SetViewMatrix(float vx, float vy, float vz, bool mirror, bool planemirror);
void SetViewArea();
void SetupView(float vx, float vy, float vz, DAngle va, bool mirror, bool planemirror);
void SetViewAngle(DAngle viewangle);
void SetProjection(VSMatrix matrix);

View file

@ -175,6 +175,8 @@ public:
void PreparePlayerSprites(sector_t * viewsector, area_t in_area);
void PrepareTargeterSprites();
void UpdateCurrentMapSection();
virtual void DrawWall(GLWall *wall, int pass) = 0;
virtual void DrawFlat(GLFlat *flat, int pass, bool trans) = 0;
virtual void DrawSprite(GLSprite *sprite, int pass) = 0;

View file

@ -86,6 +86,12 @@ void HWDrawInfo::ClearBuffers()
mClipPortal = nullptr;
}
void HWDrawInfo::UpdateCurrentMapSection()
{
const int mapsection = R_PointInSubsector(r_viewpoint.Pos)->mapsection;
CurrentMapSections.Set(mapsection);
}
//==========================================================================
//
// Adds a subsector plane to a sector's render list

View file

@ -989,6 +989,11 @@ void FSerializer::ReadObjects(bool hubtravel)
{
DThinker::bSerialOverride = true;
r->mDObjects.Resize(ArraySize());
for (auto &p : r->mDObjects)
{
p = nullptr;
}
// First iteration: create all the objects but do nothing with them yet.
for (unsigned i = 0; i < r->mDObjects.Size(); i++)
{
@ -1060,7 +1065,7 @@ void FSerializer::ReadObjects(bool hubtravel)
// nuke all objects we created here.
for (auto obj : r->mDObjects)
{
if (!(obj->ObjectFlags & OF_EuthanizeMe)) obj->Destroy();
if (obj != nullptr && !(obj->ObjectFlags & OF_EuthanizeMe)) obj->Destroy();
}
r->mDObjects.Clear();