mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-13 19:49:36 +00:00
Refactor neighboring rooms sync-ups. Remove all of the neighboring room objects and recreate them, which fixes a bunch of problems with objects becoming out-of-frame after resize.
This commit is contained in:
21
PortabilityLayer/ArrayTools.h
Normal file
21
PortabilityLayer/ArrayTools.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace PortabilityLayer
|
||||
{
|
||||
class ArrayTools
|
||||
{
|
||||
public:
|
||||
template<class T, class TSize, class TIndex>
|
||||
static void RemoveFromArray(T *arr, TSize &count, TIndex index)
|
||||
{
|
||||
TSize countCopy = count;
|
||||
countCopy--;
|
||||
if (countCopy != index)
|
||||
arr[index] = arr[countCopy];
|
||||
|
||||
count = static_cast<TSize>(countCopy);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -146,6 +146,7 @@
|
||||
<ClInclude Include="AEHandlerDesc.h" />
|
||||
<ClInclude Include="AEManager.h" />
|
||||
<ClInclude Include="AntiAliasTable.h" />
|
||||
<ClInclude Include="ArrayTools.h" />
|
||||
<ClInclude Include="BinarySearch.h" />
|
||||
<ClInclude Include="BinHex4.h" />
|
||||
<ClInclude Include="BitmapImage.h" />
|
||||
|
||||
@@ -480,6 +480,9 @@
|
||||
<ClInclude Include="TextPlacer.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ArrayTools.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="CFileStream.cpp">
|
||||
|
||||
Reference in New Issue
Block a user