Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //http://www.youtube.com/user/thecplusplusguy
- //paste this to the end of your functions.cpp file (the earlier version is uploaded here)
- //I will not upload the functions.h, just copy the prototype to there.
- void loadAnimation(std::vector<unsigned int>& frames,std::string filename,unsigned int num,objloader& obj)
- {
- char tmp[200];
- for(int i=1;i<=num;i++)
- {
- if(i<10)
- sprintf(tmp,"_00000%d",i);
- else if(i<100)
- sprintf(tmp,"_0000%d",i);
- else if(i<1000)
- sprintf(tmp,"_000%d",i);
- else if(i<10000)
- sprintf(tmp,"_00%d",i);
- else if(i<100000)
- sprintf(tmp,"_0%d",i);
- else if(i<1000000)
- sprintf(tmp,"_%d",i);
- std::string tmp2(filename+tmp);
- tmp2+=".obj";
- std::cout << tmp2 << std::endl;
- unsigned int id=obj.load(tmp2);
- frames.push_back(id);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment