Fixed debug output (trying to print a std::vector ;) ), removed compiler
warnings (which indicate a possible bug). git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10971 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
8f2ee68b16
commit
b9f6b6f0d5
@ -52,7 +52,7 @@ protected:
|
|||||||
struct KartReplayEvent
|
struct KartReplayEvent
|
||||||
{
|
{
|
||||||
/** The type of event. */
|
/** The type of event. */
|
||||||
enum {KRE_NONE, KRE_SKID_TOGGLE} m_type;
|
enum KartReplayEventType {KRE_NONE, KRE_SKID_TOGGLE} m_type;
|
||||||
|
|
||||||
/** Time at which this event happens. */
|
/** Time at which this event happens. */
|
||||||
float m_time;
|
float m_time;
|
||||||
|
@ -236,8 +236,12 @@ void ReplayPlay::readKartData(FILE *fd, char *next_line)
|
|||||||
{
|
{
|
||||||
fgets(s, 1023, fd);
|
fgets(s, 1023, fd);
|
||||||
KartReplayEvent kre;
|
KartReplayEvent kre;
|
||||||
if(sscanf(s, "%f %d\n", &kre.m_time, &kre.m_type)==2)
|
int type;
|
||||||
|
if(sscanf(s, "%f %d\n", &kre.m_time, &type)==2)
|
||||||
|
{
|
||||||
|
kre.m_type = (KartReplayEvent::KartReplayEventType)type;
|
||||||
m_ghost_karts[m_ghost_karts.size()-1].addReplayEvent(kre);
|
m_ghost_karts[m_ghost_karts.size()-1].addReplayEvent(kre);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Invalid record found
|
// Invalid record found
|
||||||
|
@ -138,8 +138,8 @@ void ReplayRecorder::update(float dt)
|
|||||||
void ReplayRecorder::Save()
|
void ReplayRecorder::Save()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("%d frames %d transform events %d frequency compressed\n",
|
printf("%d frames, %d removed because of frequency compression\n",
|
||||||
m_count, m_count_transforms, m_count_skipped_time);
|
m_count, m_count_skipped_time);
|
||||||
#endif
|
#endif
|
||||||
FILE *fd = openReplayFile(/*writeable*/true);
|
FILE *fd = openReplayFile(/*writeable*/true);
|
||||||
if(!fd)
|
if(!fd)
|
||||||
@ -177,7 +177,7 @@ void ReplayRecorder::Save()
|
|||||||
p->m_transform.getRotation().getW()
|
p->m_transform.getRotation().getW()
|
||||||
);
|
);
|
||||||
} // for i
|
} // for i
|
||||||
fprintf(fd, "events: %d\n", m_kart_replay_event[k].size());
|
fprintf(fd, "events: %d\n", (int)m_kart_replay_event[k].size());
|
||||||
for(unsigned int i=0; i<m_kart_replay_event[k].size(); i++)
|
for(unsigned int i=0; i<m_kart_replay_event[k].size(); i++)
|
||||||
{
|
{
|
||||||
const KartReplayEvent *p=&(m_kart_replay_event[k][i]);
|
const KartReplayEvent *p=&(m_kart_replay_event[k][i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user