From: <bal...@us...> - 2004-01-11 16:16:00
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs1:/tmp/cvs-serv4817/plugins/Core Modified Files: Animation.h Animation.cpp Log Message: Animation.cpp / .h : - Another Little Optimization Index: Animation.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Animation.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Animation.h 30 Dec 2003 17:54:51 -0000 1.9 --- Animation.h 11 Jan 2004 16:15:56 -0000 1.10 *************** *** 43,49 **** { private: ! std::vector<unsigned short> indices; std::vector<Sprite2D*> frames; std::vector<int> link; unsigned int startpos; unsigned long starttime; --- 43,51 ---- { private: ! //std::vector<unsigned short> indices; std::vector<Sprite2D*> frames; std::vector<int> link; + unsigned short *indices; + unsigned long indicesCount; unsigned int startpos; unsigned long starttime; Index: Animation.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Animation.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Animation.cpp 30 Dec 2003 17:54:51 -0000 1.12 --- Animation.cpp 11 Jan 2004 16:15:56 -0000 1.13 *************** *** 33,38 **** Animation::Animation(unsigned short * frames, int count) { ! for(int i = 0; i < count; i++) ! indices.push_back(frames[i]); pos = rand()%count; starttime = 0; --- 33,41 ---- Animation::Animation(unsigned short * frames, int count) { ! indices = new unsigned short[count]; ! indicesCount = count; ! memcpy(indices, frames, count*sizeof(unsigned short)); ! //for(int i = 0; i < count; i++) ! // indices.push_back(frames[i]); pos = rand()%count; starttime = 0; *************** *** 55,58 **** --- 58,62 ---- Animation::~Animation(void) { + delete(indices); if(!free) return; |