last ...
This commit is contained in:
@@ -7757,6 +7757,40 @@ void CleanupArray(
|
||||
);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void CleanupArray(
|
||||
int &removedIndexes[],
|
||||
T &buffer[] // Buffer to Cleanup ...
|
||||
)
|
||||
{
|
||||
//
|
||||
bool isValid = HasChild(buffer) &&
|
||||
HasChild(removedIndexes);
|
||||
if (!isValid)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
for (int i = 0; i < ArraySize(removedIndexes); i++)
|
||||
{
|
||||
//
|
||||
int idx = removedIndexes[i];
|
||||
if (IsValidIndex(idx) && ArraySize(buffer) > idx)
|
||||
{
|
||||
//
|
||||
ArrayRemove(
|
||||
buffer,
|
||||
idx,
|
||||
1 //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
Clean(removedIndexes);
|
||||
}
|
||||
|
||||
//
|
||||
// Search Array For Specific Item ...
|
||||
template <typename T>
|
||||
|
||||
@@ -1265,6 +1265,65 @@ bool IsBoxUsed(
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find an Inside Box of source in a Collection ...
|
||||
*
|
||||
* @param index: int, Founded Index ...
|
||||
* @param source: XBoxZone instance ...
|
||||
* @param dest: XBoxZone instance Collection ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool HasInsideBox(
|
||||
int &index,
|
||||
XBoxZone &source,
|
||||
XBoxZone &dest[] //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
index = -1;
|
||||
|
||||
//
|
||||
result = source.IsValid() &&
|
||||
HasChild(dest);
|
||||
|
||||
//
|
||||
int count = ArraySize(dest);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XBoxZone iBox = dest[i];
|
||||
|
||||
//
|
||||
bool isInside = !iBox.IsSameAs(source) &&
|
||||
IsBoxInside(
|
||||
iBox,
|
||||
source //
|
||||
);
|
||||
if (isInside)
|
||||
{
|
||||
//
|
||||
index = i;
|
||||
iBox.Clean();
|
||||
|
||||
//
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
iBox.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
result = IsValidIndex(index);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts to XBoxZone ...
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user