[Opentnl-cvs] tnl/tnl tnlVector.h,1.1,1.2
Brought to you by:
mark_frohnmayer,
s_alanet
From: Mark F. <mar...@us...> - 2004-05-03 22:06:25
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14626/tnl Modified Files: tnlVector.h Log Message: Added sorting to Vector template class Updated Zap level2 to include a 30 second time limit Updated GameType base class to perform as a simple deathmatch game type Added correct player counts to server in server browser Fixed commander map scoping to scope fewer objects seen by remote players Soccer ball now slows down when it reaches the goal Scoping now handled in the game type instead of Ship Teams are randomized after each map Index: tnlVector.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlVector.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tnlVector.h 20 Apr 2004 04:27:19 -0000 1.1 --- tnlVector.h 3 May 2004 22:06:16 -0000 1.2 *************** *** 122,125 **** --- 122,127 ---- typedef U32 size_type; + typedef difference_type (QSORT_CALLBACK *compare_func)(T *a, T *b); + Vector<T>& operator=(const Vector<T>& p); *************** *** 175,178 **** --- 177,181 ---- void compact(); + void sort(compare_func f); T& first(); T& last(); *************** *** 566,569 **** --- 569,579 ---- } + typedef int (QSORT_CALLBACK *qsort_compare_func)(const void *, const void *); + + template<class T> inline void Vector<T>::sort(compare_func f) + { + qsort(address(), size(), sizeof(T), (qsort_compare_func) f); + } + }; |