mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-20 20:05:33 +00:00
Fix temporary buffer for scripting conversions.
This commit is contained in:
parent
478a04bea8
commit
c16b88d709
4 changed files with 32 additions and 7 deletions
|
|
@ -160,6 +160,7 @@ class Vector
|
|||
void erase(U32 index, U32 count);
|
||||
void erase_fast(iterator);
|
||||
void clear();
|
||||
void resetAndTreatAsScratchBuffer();
|
||||
void compact();
|
||||
void sort(compare_func f);
|
||||
void fill( const T& value );
|
||||
|
|
@ -529,6 +530,15 @@ template<class T> inline void Vector<T>::clear()
|
|||
mElementCount = 0;
|
||||
}
|
||||
|
||||
/// This method sets the vector as its 0 and will overwrite memory on subsequent usage.
|
||||
/// Note that the current memory in use is never freed or deallocated, so only use this if the vector
|
||||
/// is being used as a scratch buffer only.
|
||||
template<class T> inline
|
||||
void Vector<T>::resetAndTreatAsScratchBuffer()
|
||||
{
|
||||
mElementCount = 0;
|
||||
}
|
||||
|
||||
template<class T> inline void Vector<T>::compact()
|
||||
{
|
||||
resize(mElementCount);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue