Insert placeholder pieces when loading files with pieces not in the library.

This commit is contained in:
leo
2012-02-05 05:03:59 +00:00
parent 19bb01ab7c
commit 32b598ce1b
7 changed files with 288 additions and 64 deletions
+16 -1
View File
@@ -22,10 +22,19 @@ PtrArray<T>::~PtrArray()
free(m_pData);
}
template <class T>
void PtrArray<T>::SetSize(int Size)
{
if (Size > m_nLength)
Expand(Size - m_nLength);
m_nLength = Size;
}
template <class T>
void PtrArray<T>::Expand(int nGrow)
{
if((m_nLength + nGrow) > m_nAlloc)
if ((m_nLength + nGrow) > m_nAlloc)
{
m_pData =(T**)realloc(m_pData,(m_nLength + nGrow) * sizeof(T*));
memset(m_pData + m_nLength, 0, nGrow * sizeof(T*));
@@ -95,6 +104,12 @@ void PtrArray<T>::AddSorted(T* pObj, LC_PTRARRAY_COMPARE_FUNC pFunc, void* pData
Add(pObj);
}
template <class T>
void PtrArray<T>::SetAt(int Index, T* Ptr)
{
m_pData[Index] = Ptr;
}
template <class T>
void PtrArray<T>::InsertAt(int nIndex, T* pObj)
{