This commit is contained in:
Rachael Alexanderson 2017-01-11 07:48:45 -05:00
commit 82ee9e7399
8 changed files with 24 additions and 27 deletions

View file

@ -483,7 +483,7 @@ FTextureID gl_GetSpriteFrame(unsigned sprite, int frame, int rot, angle_t ang, b
//========================================================================== //==========================================================================
// //
// Recalculate all heights affectting this vertex. // Recalculate all heights affecting this vertex.
// //
//========================================================================== //==========================================================================
void gl_RecalcVertexHeights(vertex_t * v) void gl_RecalcVertexHeights(vertex_t * v)

View file

@ -623,20 +623,6 @@ void gl_CleanLevelData()
mo=next; mo=next;
} }
for(auto &v : level.vertexes) if (v.numsectors > 0)
{
if (v.sectors != nullptr)
{
delete [] v.sectors;
v.sectors = nullptr;
}
if (v.heightlist != nullptr)
{
delete [] v.heightlist;
v.heightlist = nullptr;
}
}
if (level.sides.Size() > 0 && level.sides[0].segs) if (level.sides.Size() > 0 && level.sides[0].segs)
{ {
delete [] level.sides[0].segs; delete [] level.sides[0].segs;

View file

@ -164,7 +164,7 @@ void FGLRenderer::Initialize(int width, int height)
} }
else mVAOID = 0; else mVAOID = 0;
gllight = FTexture::CreateTexture(Wads.GetNumForFullName("glstuff/gllight.png"), FTexture::TEX_MiscPatch); if (gl.legacyMode) gllight = FTexture::CreateTexture(Wads.GetNumForFullName("glstuff/gllight.png"), FTexture::TEX_MiscPatch);
glpart2 = FTexture::CreateTexture(Wads.GetNumForFullName("glstuff/glpart2.png"), FTexture::TEX_MiscPatch); glpart2 = FTexture::CreateTexture(Wads.GetNumForFullName("glstuff/glpart2.png"), FTexture::TEX_MiscPatch);
glpart = FTexture::CreateTexture(Wads.GetNumForFullName("glstuff/glpart.png"), FTexture::TEX_MiscPatch); glpart = FTexture::CreateTexture(Wads.GetNumForFullName("glstuff/glpart.png"), FTexture::TEX_MiscPatch);
mirrortexture = FTexture::CreateTexture(Wads.GetNumForFullName("glstuff/mirror.png"), FTexture::TEX_MiscPatch); mirrortexture = FTexture::CreateTexture(Wads.GetNumForFullName("glstuff/mirror.png"), FTexture::TEX_MiscPatch);
@ -196,6 +196,7 @@ FGLRenderer::~FGLRenderer()
if (mLights != NULL) delete mLights; if (mLights != NULL) delete mLights;
if (glpart2) delete glpart2; if (glpart2) delete glpart2;
if (glpart) delete glpart; if (glpart) delete glpart;
if (gllight) delete gllight;
if (mirrortexture) delete mirrortexture; if (mirrortexture) delete mirrortexture;
if (mFBID != 0) glDeleteFramebuffers(1, &mFBID); if (mFBID != 0) glDeleteFramebuffers(1, &mFBID);
if (mVAOID != 0) if (mVAOID != 0)

View file

@ -394,16 +394,20 @@ bool FTexture::FindHoles(const unsigned char * buffer, int w, int h)
} }
if (startdraw==0 && lendraw==h) return false; // nothing saved so don't create a split list if (startdraw==0 && lendraw==h) return false; // nothing saved so don't create a split list
FloatRect * rcs = new FloatRect[gapc]; if (gapc > 0)
for(x=0;x<gapc;x++)
{ {
// gaps are stored as texture (u/v) coordinates FloatRect * rcs = new FloatRect[gapc];
rcs[x].width=rcs[x].left=-1.0f;
rcs[x].top=(float)gaps[x][0]/(float)h; for (x = 0; x < gapc; x++)
rcs[x].height=(float)gaps[x][1]/(float)h; {
// gaps are stored as texture (u/v) coordinates
rcs[x].width = rcs[x].left = -1.0f;
rcs[x].top = (float)gaps[x][0] / (float)h;
rcs[x].height = (float)gaps[x][1] / (float)h;
}
gl_info.areas = rcs;
} }
gl_info.areas=rcs; else gl_info.areas = nullptr;
gl_info.areacount=gapc; gl_info.areacount=gapc;
return true; return true;

View file

@ -764,7 +764,7 @@ void P_DrawRailTrail(AActor *source, TArray<SPortalHit> &portalhits, int color1,
int spiralduration = (duration == 0) ? 35 : duration; int spiralduration = (duration == 0) ? 35 : duration;
p->alpha = 1.f; p->alpha = 1.f;
p->ttl = duration; p->ttl = spiralduration;
p->fadestep = FADEFROMTTL(spiralduration); p->fadestep = FADEFROMTTL(spiralduration);
p->size = 3; p->size = 3;
p->bright = fullbright; p->bright = fullbright;

View file

@ -1488,7 +1488,7 @@ void P_SetRenderSector()
seg = ss->firstline; seg = ss->firstline;
for(j=0; j<ss->numlines; j++) for(j=0; j<ss->numlines; j++)
{ {
if(seg->sidedef && (seg->PartnerSeg == nullptr || seg->sidedef->sector!=seg->PartnerSeg->sidedef->sector)) if(seg->sidedef && (seg->PartnerSeg == nullptr || (seg->PartnerSeg->sidedef != nullptr && seg->sidedef->sector!=seg->PartnerSeg->sidedef->sector)))
{ {
ss->render_sector = seg->sidedef->sector; ss->render_sector = seg->sidedef->sector;
break; break;

View file

@ -156,6 +156,12 @@ struct vertex_t
heightlist = NULL; heightlist = NULL;
} }
~vertex_t()
{
if (sectors != nullptr) delete[] sectors;
if (heightlist != nullptr) delete[] heightlist;
}
bool operator== (const vertex_t &other) bool operator== (const vertex_t &other)
{ {
return p == other.p; return p == other.p;

View file

@ -1337,7 +1337,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE nothing, LPSTR cmdline, int n
_CrtSetDbgFlag (_CrtSetDbgFlag(0) | _CRTDBG_LEAK_CHECK_DF); _CrtSetDbgFlag (_CrtSetDbgFlag(0) | _CRTDBG_LEAK_CHECK_DF);
// Use this to break at a specific allocation number. // Use this to break at a specific allocation number.
//_crtBreakAlloc = 53039; _crtBreakAlloc = 124459;
#endif #endif
DoMain (hInstance); DoMain (hInstance);