Updated win32 project.
Fixed allocation of rcRegions, use placement new per array object, not for the whole array.
This commit is contained in:
parent
cd3a351f40
commit
377315641e
@ -438,7 +438,7 @@ static unsigned short* expandRegions(int maxIter, unsigned short level,
|
||||
|
||||
struct rcRegion
|
||||
{
|
||||
inline rcRegion() : count(0), id(0), area(0), remap(false) {}
|
||||
inline rcRegion(unsigned short i) : count(0), id(i), area(0), remap(false) {}
|
||||
|
||||
int count;
|
||||
unsigned short id;
|
||||
@ -697,7 +697,7 @@ static bool filterSmallRegions(int minRegionSize, int mergeRegionSize,
|
||||
const int h = chf.height;
|
||||
|
||||
const int nreg = maxRegionId+1;
|
||||
rcRegion* regions = new(rcAlloc(sizeof(rcRegion)*nreg, RC_ALLOC_TEMP)) rcRegion[nreg];
|
||||
rcRegion* regions = (rcRegion*)rcAlloc(sizeof(rcRegion)*nreg, RC_ALLOC_TEMP);
|
||||
if (!regions)
|
||||
{
|
||||
if (rcGetLog())
|
||||
@ -705,8 +705,9 @@ static bool filterSmallRegions(int minRegionSize, int mergeRegionSize,
|
||||
return false;
|
||||
}
|
||||
|
||||
// Construct regions
|
||||
for (int i = 0; i < nreg; ++i)
|
||||
regions[i].id = (unsigned short)i;
|
||||
new(®ions[i]) rcRegion((unsigned short)i);
|
||||
|
||||
// Find edge of a region and find connections around the contour.
|
||||
for (int y = 0; y < h; ++y)
|
||||
|
Binary file not shown.
@ -187,6 +187,10 @@
|
||||
RelativePath="..\..\..\Recast\Include\Recast.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Include\RecastAlloc.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Include\RecastLog.h"
|
||||
>
|
||||
@ -203,6 +207,10 @@
|
||||
RelativePath="..\..\..\Recast\Source\Recast.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Source\RecastAlloc.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Recast\Source\RecastArea.cpp"
|
||||
>
|
||||
@ -247,6 +255,10 @@
|
||||
<Filter
|
||||
Name="Include"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Include\DetourAlloc.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Include\DetourCommon.h"
|
||||
>
|
||||
@ -267,6 +279,10 @@
|
||||
<Filter
|
||||
Name="Source"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Source\DetourAlloc.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\Detour\Source\DetourCommon.cpp"
|
||||
>
|
||||
|
Loading…
x
Reference in New Issue
Block a user