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:
elasota
2020-04-05 18:34:37 -04:00
parent b827048c36
commit d7353ff6ed
8 changed files with 163 additions and 27 deletions

View 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);
}
};
}