1) Fixed bug in memory allocation (world doesn't exist when it was used).

2) Some improvements to support the old history format, but not fully working
   (and probably not needed anymore).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/switch_coordinate_system@4967 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-03-10 10:16:26 +00:00
parent 1552693cf4
commit b691445f15

View File

@ -66,7 +66,7 @@ void History::initRecording()
void History::allocateMemory(int number_of_frames)
{
m_all_deltas.resize (number_of_frames);
unsigned int num_karts = World::getWorld()->getNumKarts();
unsigned int num_karts = race_manager->getNumberOfKarts();
m_all_controls.resize (number_of_frames*num_karts);
m_all_xyz.resize (number_of_frames*num_karts);
m_all_rotations.resize(number_of_frames*num_karts);
@ -306,10 +306,15 @@ void History::Load()
&x,
#ifdef KEEP_OLD_FORMAT
&z, &y,
//xyz
//yxz
//yzx
&rx, &rz, &ry, &rw
#else
&y, &z,
&rx, &ry, &rz, &rw
#endif
&rx, &ry, &rz, &rw);
);
m_all_xyz[i] = Vec3(x,y,z);
m_all_rotations[i] = btQuaternion(rx,ry,rz,rw);
m_all_controls[i].setButtonsCompressed(char(buttonsCompressed));