It's crazy, the crash happens in gl_setup.cpp line 166 in static int MergeMapSections(int num).
> zdoom.exe!MergeMapSections(int num) Line 166 C++
zdoom.exe!SetMapSections() Line 208 C++
zdoom.exe!PrepareSectorData() Line 298 C++
zdoom.exe!gl_PreprocessLevel() Line 603 C++
zdoom.exe!P_SetupLevel(const char * lumpname, int position) Line 4096 C++
zdoom.exe!G_DoLoadLevel(int position, bool autosave) Line 1007 C++
zdoom.exe!G_InitNew(const char * mapname, bool bTitleLevel) Line 542 C++
zdoom.exe!G_DoNewGame() Line 367 C++
zdoom.exe!G_Ticker() Line 1073 C++
zdoom.exe!TryRunTics() Line 1946 C++
zdoom.exe!D_DoomLoop() Line 1016 C++
zdoom.exe!D_DoomMain() Line 2673 C++
zdoom.exe!DoMain(HINSTANCE__ * hInstance) Line 1077 C++
zdoom.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * nothing, char * cmdline, int nCmdShow) Line 1332 C++
vsection = -85458944
Line 166 is sectvalid[vsection-1] = false;
Code: Select all
static int MergeMapSections(int num)
{
FSectionVertexMap vmap;
FSectionVertexMap::Pair *pair;
TArray<int> sectmap;
TArray<bool> sectvalid;
sectmap.Resize(num);
sectvalid.Resize(num);
for(int i=0;i<num;i++)
{
sectmap[i] = -1;
sectvalid[i] = true;
}
int mergecount = 1;
cvertex_t vt;
// first step: Set mapsection for all vertex positions.
for(DWORD i=0;i<(DWORD)numsegs;i++)
{
seg_t * seg = &segs[i];
int section = seg->Subsector->mapsection;
for(int j=0;j<2;j++)
{
vt = j==0? seg->v1:seg->v2;
vmap[vt] = section;
}
}
// second step: Check if any seg references more than one mapsection, either by subsector or by vertex
for(DWORD i=0;i<(DWORD)numsegs;i++)
{
seg_t * seg = &segs[i];
int section = seg->Subsector->mapsection;
for(int j=0;j<2;j++)
{
vt = j==0? seg->v1:seg->v2;
int vsection = vmap[vt];
if (vsection != section)
{
// These 2 sections should be merged
for(int k=0;k<numsubsectors;k++)
{
if (subsectors[k].mapsection == vsection) subsectors[k].mapsection = section;
}
FSectionVertexMap::Iterator it(vmap);
while (it.NextPair(pair))
{
if (pair->Value == vsection) pair->Value = section;
}
-> sectvalid[vsection-1] = false;
}
}
}
for(int i=0;i<num;i++)
{
if (sectvalid[i]) sectmap[i] = mergecount++;
}
for(int i=0;i<numsubsectors;i++)
{
subsectors[i].mapsection = sectmap[subsectors[i].mapsection-1];
assert(subsectors[i].mapsection!=-1);
}
return mergecount-1;
}
Perhaps i should change the floating point model?
Edit: Well, it should work with VS 2015... I forgot to mention XInput support works with MinGW just using the include from the full DX SDK, it's in the latest release.