Save nitro and zipper GFX in replay

This commit is contained in:
Benau 2016-02-05 09:30:40 +08:00
parent 5810acb114
commit 0091c1555a
9 changed files with 109 additions and 140 deletions

View File

@ -46,6 +46,7 @@ class Material;
class Powerup; class Powerup;
class Skidding; class Skidding;
class SlipStream; class SlipStream;
class TerrainInfo;
/** An abstract interface for the actual karts. Some functions are actually /** An abstract interface for the actual karts. Some functions are actually
* implemented here in order to allow inlining. * implemented here in order to allow inlining.
@ -421,6 +422,9 @@ public:
/** Shows the star effect for a certain time. */ /** Shows the star effect for a certain time. */
virtual void showStarEffect(float t) = 0; virtual void showStarEffect(float t) = 0;
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
/** Returns the terrain info oject. */
virtual const TerrainInfo *getTerrainInfo() const = 0;
// ------------------------------------------------------------------------
/** Called when the kart crashes against another kart. /** Called when the kart crashes against another kart.
* \param k The kart that was hit. * \param k The kart that was hit.
* \param update_attachments If true the attachment of this kart and the * \param update_attachments If true the attachment of this kart and the

View File

@ -17,6 +17,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "karts/ghost_kart.hpp" #include "karts/ghost_kart.hpp"
#include "karts/kart_gfx.hpp"
#include "karts/kart_model.hpp" #include "karts/kart_model.hpp"
#include "modes/world.hpp" #include "modes/world.hpp"
@ -27,11 +28,10 @@ GhostKart::GhostKart(const std::string& ident)
: Kart(ident, /*world kart id*/99999, : Kart(ident, /*world kart id*/99999,
/*position*/-1, btTransform(), PLAYER_DIFFICULTY_NORMAL) /*position*/-1, btTransform(), PLAYER_DIFFICULTY_NORMAL)
{ {
m_current_transform = 0;
m_next_event = 0;
m_all_times.clear(); m_all_times.clear();
m_all_transform.clear(); m_all_transform.clear();
m_all_physic_info.clear(); m_all_physic_info.clear();
m_all_replay_events.clear();
} // GhostKart } // GhostKart
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -40,19 +40,15 @@ void GhostKart::reset()
m_node->setVisible(true); m_node->setVisible(true);
Kart::reset(); Kart::reset();
m_current_transform = 0; m_current_transform = 0;
m_next_event = 0;
// This will set the correct start position // This will set the correct start position
update(0); update(0);
} // reset } // reset
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
/** Sets the next time and transform. The current time and transform becomes void GhostKart::addReplayEvent(float time,
* the previous time and transform. const btTransform &trans,
* \param const ReplayBase::PhysicInfo &pi,
*/ const ReplayBase::KartReplayEvent &kre)
void GhostKart::addTransform(float time,
const btTransform &trans,
const ReplayBase::PhysicInfo &pi)
{ {
// FIXME: for now avoid that transforms for the same time are set // FIXME: for now avoid that transforms for the same time are set
// twice (to avoid division by zero in update). This should be // twice (to avoid division by zero in update). This should be
@ -62,6 +58,7 @@ void GhostKart::addTransform(float time,
m_all_times.push_back(time); m_all_times.push_back(time);
m_all_transform.push_back(trans); m_all_transform.push_back(trans);
m_all_physic_info.push_back(pi); m_all_physic_info.push_back(pi);
m_all_replay_events.push_back(kre);
// Use first frame of replay to calculate default suspension // Use first frame of replay to calculate default suspension
if (m_all_physic_info.size() == 1) if (m_all_physic_info.size() == 1)
@ -74,55 +71,45 @@ void GhostKart::addTransform(float time,
->setDefaultSuspension(); ->setDefaultSuspension();
} }
} // addTransform
// ----------------------------------------------------------------------------
/** Adds a replay event for this kart.
*/
void GhostKart::addReplayEvent(const ReplayBase::KartReplayEvent &kre)
{
m_replay_events.push_back(kre);
} // addReplayEvent } // addReplayEvent
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
/** Updates the ghost data each time step. It uses interpolation to get a new /** Updates the current event of the ghost kart using interpolation
* position and rotation.
* \param dt Time step size. * \param dt Time step size.
*/ */
void GhostKart::update(float dt) void GhostKart::update(float dt)
{ {
float t = World::getWorld()->getTime(); float t = World::getWorld()->getTime();
// Don't do anything at startup
if(t==0) return;
updateTransform(t, dt);
while(m_next_event < m_replay_events.size() &&
m_replay_events[m_next_event].m_time <= t)
{
Log::debug("Ghost_Kart", "Handling event %d", m_next_event);
// Handle the next event now
m_next_event++;
}
}
// ----------------------------------------------------------------------------
/** Updates the current transform of the ghost kart using interpolation
* \param t Current world time.
* \param dt Time step size.
*/
void GhostKart::updateTransform(float t, float dt)
{
// Find (if necessary) the next index to use // Find (if necessary) the next index to use
while(m_current_transform+1 < m_all_times.size() && if (t != 0.0f)
t>=m_all_times[m_current_transform+1])
{ {
m_current_transform ++; while (m_current_transform + 1 < m_all_times.size() &&
t >= m_all_times[m_current_transform+1])
{
m_current_transform++;
}
} }
if(m_current_transform+1>=m_all_times.size())
if (m_current_transform + 1 >= m_all_times.size())
{ {
m_node->setVisible(false); m_node->setVisible(false);
return; return;
} }
float nitro_frac = 0;
if (m_all_replay_events[m_current_transform].m_on_nitro)
{
nitro_frac = fabsf(m_all_physic_info[m_current_transform].m_speed) /
(m_kart_properties->getEngineMaxSpeed());
if (nitro_frac > 1.0f)
nitro_frac = 1.0f;
}
getKartGFX()->updateNitroGraphics(nitro_frac);
if (m_all_replay_events[m_current_transform].m_on_zipper)
showZipperFire();
float f =(t - m_all_times[m_current_transform]) float f =(t - m_all_times[m_current_transform])
/ ( m_all_times[m_current_transform+1] / ( m_all_times[m_current_transform+1]
- m_all_times[m_current_transform] ); - m_all_times[m_current_transform] );
@ -143,4 +130,6 @@ void GhostKart::updateTransform(float t, float dt)
m_all_physic_info[m_current_transform].m_steer, m_all_physic_info[m_current_transform].m_steer,
m_all_physic_info[m_current_transform].m_speed, m_all_physic_info[m_current_transform].m_speed,
m_current_transform); m_current_transform);
getKartGFX()->update(dt);
} // update } // update

View File

@ -44,23 +44,15 @@ private:
std::vector<ReplayBase::PhysicInfo> m_all_physic_info; std::vector<ReplayBase::PhysicInfo> m_all_physic_info;
std::vector<ReplayBase::KartReplayEvent> m_replay_events; std::vector<ReplayBase::KartReplayEvent> m_all_replay_events;
/** Pointer to the last index in m_all_times that is smaller than /** Pointer to the last index in m_all_times that is smaller than
* the current world time. */ * the current world time. */
unsigned int m_current_transform; unsigned int m_current_transform;
/** Index of the next kart replay event. */
unsigned int m_next_event;
void updateTransform(float t, float dt);
public: public:
GhostKart(const std::string& ident); GhostKart(const std::string& ident);
virtual void update (float dt); virtual void update (float dt);
virtual void addTransform(float time,
const btTransform &trans,
const ReplayBase::PhysicInfo &pi);
virtual void addReplayEvent(const ReplayBase::KartReplayEvent &kre);
virtual void reset(); virtual void reset();
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
/** No physics body for ghost kart, so nothing to adjust. */ /** No physics body for ghost kart, so nothing to adjust. */
@ -72,8 +64,13 @@ public:
// Not needed to create any physics for a ghost kart. // Not needed to create any physics for a ghost kart.
virtual void createPhysics() {} virtual void createPhysics() {}
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
const float getSuspensionLength(int index, int wheel) const const float getSuspensionLength(int index, int wheel) const
{ return m_all_physic_info[index].m_suspension_length[wheel]; } { return m_all_physic_info[index].m_suspension_length[wheel]; }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
void addReplayEvent(float time,
const btTransform &trans,
const ReplayBase::PhysicInfo &pi,
const ReplayBase::KartReplayEvent &kre);
// ------------------------------------------------------------------------
}; // GhostKart }; // GhostKart
#endif #endif

View File

@ -431,7 +431,7 @@ public:
virtual void showStarEffect(float t); virtual void showStarEffect(float t);
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
/** Returns the terrain info oject. */ /** Returns the terrain info oject. */
TerrainInfo *getTerrainInfo() { return m_terrain_info; } virtual const TerrainInfo *getTerrainInfo() const { return m_terrain_info; }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
virtual void setOnScreenText(const wchar_t *text); virtual void setOnScreenText(const wchar_t *text);
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------

View File

@ -817,11 +817,14 @@ void KartModel::update(float dt, float distance, float steer, float speed,
float suspension_length = 0.0f; float suspension_length = 0.0f;
GhostKart* gk = dynamic_cast<GhostKart*>(m_kart); GhostKart* gk = dynamic_cast<GhostKart*>(m_kart);
if (gk && gt_replay_index != -1) // Prevent using m_default_physics_suspension uninitialized
if (gk && gt_replay_index == -1) break;
if (gk)
{ {
suspension_length = gk->getSuspensionLength(gt_replay_index, i); suspension_length = gk->getSuspensionLength(gt_replay_index, i);
} }
else if (!gk) else
{ {
suspension_length = m_kart->getVehicle()->getWheelInfo(i). suspension_length = m_kart->getVehicle()->getWheelInfo(i).
m_raycastInfo.m_suspensionLength; m_raycastInfo.m_suspensionLength;

View File

@ -59,17 +59,12 @@ protected:
}; // PhysicInfo }; // PhysicInfo
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
/** Records all other events - atm start and end skidding. */ /** Records all other events - atm nitro and zipper handling. */
struct KartReplayEvent struct KartReplayEvent
{ {
/** The type of event. */ /** The type of event. */
enum KartReplayEventType {KRE_NONE, bool m_on_nitro;
KRE_SKID_LEFT, bool m_on_zipper;
KRE_SKID_MIN = KRE_SKID_LEFT,
KRE_SKID_RIGHT, KRE_SKID_RELEASE} m_type;
/** Time at which this event happens. */
float m_time;
}; // KartReplayEvent }; // KartReplayEvent
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------

View File

@ -173,27 +173,32 @@ void ReplayPlay::readKartData(FILE *fd, char *next_line)
{ {
fgets(s, 1023, fd); fgets(s, 1023, fd);
float x, y, z, rx, ry, rz, rw, time, speed, steer, w1, w2, w3, w4; float x, y, z, rx, ry, rz, rw, time, speed, steer, w1, w2, w3, w4;
int nitro, zipper;
// Check for EV_TRANSFORM event: // Check for EV_TRANSFORM event:
// ----------------------------- // -----------------------------
if(sscanf(s, "%f %f %f %f %f %f %f %f %f %f %f %f %f %f\n", if(sscanf(s, "%f %f %f %f %f %f %f %f %f %f %f %f %f %f %d %d\n",
&time, &time,
&x, &y, &z, &x, &y, &z,
&rx, &ry, &rz, &rw, &rx, &ry, &rz, &rw,
&speed, &steer, &w1, &w2, &w3, &w4 &speed, &steer, &w1, &w2, &w3, &w4,
)==14) &nitro, &zipper
)==16)
{ {
btQuaternion q(rx, ry, rz, rw); btQuaternion q(rx, ry, rz, rw);
btVector3 xyz(x, y, z); btVector3 xyz(x, y, z);
PhysicInfo pi = {0}; PhysicInfo pi = {0};
KartReplayEvent kre = {0};
pi.m_speed = speed; pi.m_speed = speed;
pi.m_steer = steer; pi.m_steer = steer;
pi.m_suspension_length[0] = w1; pi.m_suspension_length[0] = w1;
pi.m_suspension_length[1] = w2; pi.m_suspension_length[1] = w2;
pi.m_suspension_length[2] = w3; pi.m_suspension_length[2] = w3;
pi.m_suspension_length[3] = w4; pi.m_suspension_length[3] = w4;
m_ghost_karts[m_ghost_karts.size()-1].addTransform(time, kre.m_on_nitro = (bool)nitro;
btTransform(q, xyz), pi); kre.m_on_zipper = (bool)zipper;
m_ghost_karts[m_ghost_karts.size()-1].addReplayEvent(time,
btTransform(q, xyz), pi, kre);
} }
else else
{ {
@ -204,31 +209,5 @@ void ReplayPlay::readKartData(FILE *fd, char *next_line)
Log::warn("Replay", "Ignored."); Log::warn("Replay", "Ignored.");
} }
} // for i } // for i
fgets(s, 1023, fd);
unsigned int num_events;
if(sscanf(s,"events: %u",&num_events)!=1)
Log::warn("Replay", "Number of events not found in replay file "
"for kart %d.", m_ghost_karts.size()-1);
for(unsigned int i=0; i<num_events; i++)
{
fgets(s, 1023, fd);
KartReplayEvent kre;
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);
}
else
{
// Invalid record found
// ---------------------
Log::warn("Replay", "Can't read replay event line %d:", i);
Log::warn("Replay", "%s", s);
Log::warn("Replay", "Ignored.");
}
} // for i < events
} // readKartData } // readKartData

View File

@ -24,6 +24,7 @@
#include "modes/world.hpp" #include "modes/world.hpp"
#include "physics/btKart.hpp" #include "physics/btKart.hpp"
#include "race/race_manager.hpp" #include "race/race_manager.hpp"
#include "tracks/terrain_info.hpp"
#include "tracks/track.hpp" #include "tracks/track.hpp"
#include <algorithm> #include <algorithm>
@ -45,6 +46,7 @@ ReplayRecorder::~ReplayRecorder()
{ {
m_transform_events.clear(); m_transform_events.clear();
m_physic_info.clear(); m_physic_info.clear();
m_kart_replay_event.clear();
} // ~Replay } // ~Replay
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -55,9 +57,9 @@ void ReplayRecorder::init()
{ {
m_transform_events.clear(); m_transform_events.clear();
m_physic_info.clear(); m_physic_info.clear();
m_kart_replay_event.clear();
m_transform_events.resize(race_manager->getNumberOfKarts()); m_transform_events.resize(race_manager->getNumberOfKarts());
m_physic_info.resize(race_manager->getNumberOfKarts()); m_physic_info.resize(race_manager->getNumberOfKarts());
m_skid_control.resize(race_manager->getNumberOfKarts());
m_kart_replay_event.resize(race_manager->getNumberOfKarts()); m_kart_replay_event.resize(race_manager->getNumberOfKarts());
unsigned int max_frames = (unsigned int)( stk_config->m_replay_max_time unsigned int max_frames = (unsigned int)( stk_config->m_replay_max_time
/ stk_config->m_replay_dt); / stk_config->m_replay_dt);
@ -65,8 +67,7 @@ void ReplayRecorder::init()
{ {
m_transform_events[i].resize(max_frames); m_transform_events[i].resize(max_frames);
m_physic_info[i].resize(max_frames); m_physic_info[i].resize(max_frames);
// Rather arbitraritly sized, it will be added with push_back m_kart_replay_event[i].resize(max_frames);
m_kart_replay_event[i].reserve(500);
} }
m_count_transforms.clear(); m_count_transforms.clear();
m_count_transforms.resize(race_manager->getNumberOfKarts(), 0); m_count_transforms.resize(race_manager->getNumberOfKarts(), 0);
@ -103,40 +104,22 @@ void ReplayRecorder::update(float dt)
for(unsigned int i=0; i<num_karts; i++) for(unsigned int i=0; i<num_karts; i++)
{ {
const AbstractKart *kart = world->getKart(i); const AbstractKart *kart = world->getKart(i);
// Check if skidding state has changed. If so, store this
if(kart->getControls().m_skid != m_skid_control[i])
{
KartReplayEvent kre;
kre.m_time = World::getWorld()->getTime();
if(kart->getControls().m_skid==KartControl::SC_LEFT)
kre.m_type = KartReplayEvent::KRE_SKID_LEFT;
else if(kart->getControls().m_skid==KartControl::SC_RIGHT)
kre.m_type = KartReplayEvent::KRE_SKID_RIGHT;
else
kre.m_type = KartReplayEvent::KRE_NONE;
m_kart_replay_event[i].push_back(kre);
if(m_skid_control[i]!=KartControl::SC_NONE)
m_skid_control[i] = KartControl::SC_NONE;
else
m_skid_control[i] = kart->getControls().m_skid;
}
#ifdef DEBUG #ifdef DEBUG
m_count ++; m_count++;
#endif #endif
if(time - m_last_saved_time[i]<stk_config->m_replay_dt) if (time - m_last_saved_time[i] < stk_config->m_replay_dt)
{ {
#ifdef DEBUG #ifdef DEBUG
m_count_skipped_time ++; m_count_skipped_time++;
#endif #endif
continue; continue;
} }
m_last_saved_time[i] = time; m_last_saved_time[i] = time;
m_count_transforms[i]++; m_count_transforms[i]++;
if(m_count_transforms[i]>=m_transform_events[i].size()) if (m_count_transforms[i] >= m_transform_events[i].size())
{ {
// Only print this message once. // Only print this message once.
if(m_count_transforms[i]==m_transform_events[i].size()) if (m_count_transforms[i] == m_transform_events[i].size())
{ {
char buffer[100]; char buffer[100];
sprintf(buffer, "Can't store more events for kart %s.", sprintf(buffer, "Can't store more events for kart %s.",
@ -147,6 +130,8 @@ void ReplayRecorder::update(float dt)
} }
TransformEvent *p = &(m_transform_events[i][m_count_transforms[i]-1]); TransformEvent *p = &(m_transform_events[i][m_count_transforms[i]-1]);
PhysicInfo *q = &(m_physic_info[i][m_count_transforms[i]-1]); PhysicInfo *q = &(m_physic_info[i][m_count_transforms[i]-1]);
KartReplayEvent *r = &(m_kart_replay_event[i][m_count_transforms[i]-1]);
p->m_time = World::getWorld()->getTime(); p->m_time = World::getWorld()->getTime();
p->m_transform.setOrigin(kart->getXYZ()); p->m_transform.setOrigin(kart->getXYZ());
p->m_transform.setRotation(kart->getVisualRotation()); p->m_transform.setRotation(kart->getVisualRotation());
@ -164,6 +149,28 @@ void ReplayRecorder::update(float dt)
->getWheelInfo(j).m_raycastInfo.m_suspensionLength; ->getWheelInfo(j).m_raycastInfo.m_suspensionLength;
} }
} }
bool nitro = false;
bool zipper = false;
const KartControl kc = kart->getControls();
const Material* m = kart->getTerrainInfo()->getMaterial();
if (kc.m_nitro && kart->isOnGround() &&
kart->isOnMinNitroTime() > 0.0f && kart->getEnergy() > 0.0f)
{
nitro = true;
}
if (m)
{
if (m->isZipper() && kart->isOnGround())
zipper = true;
}
if (kc.m_fire &&
kart->getPowerup()->getType() == PowerupManager::POWERUP_ZIPPER)
{
zipper = true;
}
r->m_on_nitro = nitro;
r->m_on_zipper = zipper;
} // for i } // for i
} // update } // update
@ -177,7 +184,7 @@ void ReplayRecorder::Save()
m_count, 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)
{ {
Log::error("ReplayRecorder", "Can't open '%s' for writing - can't save replay data.", Log::error("ReplayRecorder", "Can't open '%s' for writing - can't save replay data.",
getReplayFilename().c_str()); getReplayFilename().c_str());
@ -195,18 +202,19 @@ void ReplayRecorder::Save()
unsigned int max_frames = (unsigned int)( stk_config->m_replay_max_time unsigned int max_frames = (unsigned int)( stk_config->m_replay_max_time
/ stk_config->m_replay_dt ); / stk_config->m_replay_dt );
for(unsigned int k=0; k<num_karts; k++) for (unsigned int k = 0; k < num_karts; k++)
{ {
fprintf(fd, "model: %s\n", world->getKart(k)->getIdent().c_str()); fprintf(fd, "model: %s\n", world->getKart(k)->getIdent().c_str());
fprintf(fd, "size: %d\n", m_count_transforms[k]); fprintf(fd, "size: %d\n", m_count_transforms[k]);
unsigned int num_transforms = std::min(max_frames, unsigned int num_transforms = std::min(max_frames,
m_count_transforms[k]); m_count_transforms[k]);
for(unsigned int i=0; i<num_transforms; i++) for (unsigned int i = 0; i < num_transforms; i++)
{ {
const TransformEvent *p = &(m_transform_events[k][i]); const TransformEvent *p = &(m_transform_events[k][i]);
const PhysicInfo *q = &(m_physic_info[k][i]); const PhysicInfo *q = &(m_physic_info[k][i]);
fprintf(fd, "%f %f %f %f %f %f %f %f %f %f %f %f %f %f\n", const KartReplayEvent *r = &(m_kart_replay_event[k][i]);
fprintf(fd, "%f %f %f %f %f %f %f %f %f %f %f %f %f %f %d %d\n",
p->m_time, p->m_time,
p->m_transform.getOrigin().getX(), p->m_transform.getOrigin().getX(),
p->m_transform.getOrigin().getY(), p->m_transform.getOrigin().getY(),
@ -220,15 +228,11 @@ void ReplayRecorder::Save()
q->m_suspension_length[0], q->m_suspension_length[0],
q->m_suspension_length[1], q->m_suspension_length[1],
q->m_suspension_length[2], q->m_suspension_length[2],
q->m_suspension_length[3] q->m_suspension_length[3],
(int)r->m_on_nitro,
(int)r->m_on_zipper
); );
} // for i } // for i
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++)
{
const KartReplayEvent *p=&(m_kart_replay_event[k][i]);
fprintf(fd, "%f %d\n", p->m_time, p->m_type);
}
} }
fclose(fd); fclose(fd);
} // Save } // Save

View File

@ -34,20 +34,18 @@ private:
/** A separate vector of Replay Events for all transforms. */ /** A separate vector of Replay Events for all transforms. */
std::vector< std::vector<TransformEvent> > m_transform_events; std::vector< std::vector<TransformEvent> > m_transform_events;
/** A separate vector of Replay Events for all transforms. */ /** A separate vector of Replay Events for all physic info. */
std::vector< std::vector<PhysicInfo> > m_physic_info; std::vector< std::vector<PhysicInfo> > m_physic_info;
/** A separate vector of Replay Events for all other events. */
std::vector< std::vector<KartReplayEvent> > m_kart_replay_event;
/** Time at which a transform was saved for the last time. */ /** Time at which a transform was saved for the last time. */
std::vector<float> m_last_saved_time; std::vector<float> m_last_saved_time;
/** Counts the number of transform events for each kart. */ /** Counts the number of transform events for each kart. */
std::vector<unsigned int> m_count_transforms; std::vector<unsigned int> m_count_transforms;
/** Stores the last skid state. */
std::vector<KartControl::SkidControl> m_skid_control;
std::vector< std::vector<KartReplayEvent> > m_kart_replay_event;
/** Static pointer to the one instance of the replay object. */ /** Static pointer to the one instance of the replay object. */
static ReplayRecorder *m_replay_recorder; static ReplayRecorder *m_replay_recorder;