New Pieces Library code.

This commit is contained in:
leo
2012-09-29 00:16:43 +00:00
parent b5a940aca9
commit 71f27a45c2
9 changed files with 848 additions and 259 deletions
+8 -1
View File
@@ -208,7 +208,7 @@ void ObjArray<T>::Expand(int Grow)
{
if ((m_Length + Grow) > m_Alloc)
{
int NewSize = ((m_Length + Grow) / m_Grow + 1) * m_Grow;
int NewSize = ((m_Length + Grow + m_Grow - 1) / m_Grow) * m_Grow;
T* NewData = new T[NewSize];
@@ -252,6 +252,13 @@ void ObjArray<T>::Add(const T& Obj)
m_Data[m_Length++] = Obj;
}
template <class T>
T& ObjArray<T>::Add()
{
Expand(1);
return m_Data[m_Length++];
}
template <class T>
void ObjArray<T>::AddSorted (const T& Obj, LC_OBJARRAY_COMPARE_FUNC Func, void* SortData)
{