mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-24 15:16:38 +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);
|
||||
}
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user