REPLAY Class Reference

#include <replay.h>

Collaboration diagram for REPLAY:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void BuildFuncMem (FUNCTION_MEMORY *&fmem, int &fnm)
 REPLAY ()
 ~REPLAY ()
void Clear ()
void Start ()
void AddRecord (string newdofunction, float newval, int newstate)
void IncrementFrame ()
void Stop ()
float Recording ()
bool PlayStart (string replayname)
bool PlayStart (string replayname, bool ngc)
void PlayStop ()
float Playing ()
int GetNumFuncs ()
FUNCTION_MEMORY GetFunc (int idx)
int GetFuncIdx (string funcname)
void PlayIncrement ()
double GetTime ()
CARSTATELoadState ()
void Jump (double newtime)
int Get_FuncChars ()
int Get_CharState ()
int Get_CharFuncnum ()
int Get_FuncNetControl ()
int Get_FuncStateInfo ()
int Get_FuncNoop ()
int Get_FuncPacketArray ()
void WriteHeader (FILE *rf, FUNCTION_MEMORY *fmem, int fnm, int carnumber)
void WritePackets (FILE *rf, REPLAY_PACKET *pak, int pnum, CARSTATE *smem, int snum)
bool GhostCar ()
string ReplayCar ()
int ReplayPaint ()

Public Attributes

CARSTATE curstate

Private Member Functions

void PlayProcessFrame ()
void WriteCarState ()
void RememberCarState ()
CARSTATEGetNextState (double until)
REPLAY_PACKETGetNextPacket (double until)

Private Attributes

int num_packets
REPLAY_PACKET packet [MAX_PACKETS]
FUNCTION_MEMORYfuncmem
int fnum
bool replay
FILE * rf
double timeindex
bool playing
int cur_packet
float playend
CARSTATE state_mem [MAX_STATES]
int num_states
CARSTATE loadstate
bool state_to_load
int cur_state
bool ghostcar
string replaycar
int replaypaint

Detailed Description

Definition at line 139 of file replay.h.


Constructor & Destructor Documentation

REPLAY::REPLAY  ) 
 

Definition at line 27 of file replay.cpp.

References cur_packet, cur_state, funcmem, ghostcar, MAX_STATES, NULL, num_packets, num_states, playing, replay, state_mem, state_to_load, and timeindex.

REPLAY::~REPLAY  ) 
 

Definition at line 55 of file replay.cpp.

References funcmem, and NULL.


Member Function Documentation

void REPLAY::AddRecord string  newdofunction,
float  newval,
int  newstate
 

Definition at line 78 of file replay.cpp.

References FUNCTION_MEMORY::active, fnum, funcmem, FUNCTION_MEMORY::held, MAX_PACKETS, FUNCTION_MEMORY::newval, num_packets, replay, and timeindex.

void REPLAY::BuildFuncMem FUNCTION_MEMORY *&  fmem,
int &  fnm
 

Definition at line 349 of file replay.cpp.

References SETTINGS::GetFullDataPath(), NULL, settings, UTILITY::sGetLine(), and utility.

Referenced by MULTIPLAY::Connect(), MULTIPLAY::Host(), and Start().

void REPLAY::Clear  ) 
 

Definition at line 61 of file replay.cpp.

References CARSTATE::funcmem, funcmem, NULL, num_states, and state_mem.

Referenced by IncrementFrame(), and Start().

int REPLAY::Get_CharFuncnum  )  [inline]
 

Definition at line 201 of file replay.h.

References CHAR_FUNCNUM.

int REPLAY::Get_CharState  )  [inline]
 

Definition at line 200 of file replay.h.

References CHAR_STATE.

int REPLAY::Get_FuncChars  )  [inline]
 

Definition at line 199 of file replay.h.

References FUNCTION_CHARS.

int REPLAY::Get_FuncNetControl  )  [inline]
 

Definition at line 202 of file replay.h.

References FUNCTION_NETCONTROL.

Referenced by MULTIPLAY::ExchangeWorldInfo(), NET::IsEqualToPacket(), and NET::WriteToPacket().

int REPLAY::Get_FuncNoop  )  [inline]
 

Definition at line 204 of file replay.h.

References FUNCTION_NOOP.

Referenced by MULTIPLAY::SendPacketArray().

int REPLAY::Get_FuncPacketArray  )  [inline]
 

Definition at line 205 of file replay.h.

References FUNCTION_PACKET_ARRAY.

Referenced by MULTIPLAY::ReceivePacketArray(), and MULTIPLAY::SendPacketArray().

int REPLAY::Get_FuncStateInfo  )  [inline]
 

Definition at line 203 of file replay.h.

References FUNCTION_STATEINFO.

Referenced by MULTIPLAY::ProcessPacket(), MULTIPLAY::ReadState(), and MULTIPLAY::ReceiveState().

FUNCTION_MEMORY REPLAY::GetFunc int  idx  ) 
 

Definition at line 689 of file replay.cpp.

References funcmem.

Referenced by VAMOSWORLD::ProcessControls().

int REPLAY::GetFuncIdx string  funcname  ) 
 

Definition at line 694 of file replay.cpp.

References funcmem.

REPLAY_PACKET * REPLAY::GetNextPacket double  until  )  [private]
 

Definition at line 981 of file replay.cpp.

References cur_packet, NULL, num_packets, and packet.

CARSTATE * REPLAY::GetNextState double  until  )  [private]
 

Definition at line 968 of file replay.cpp.

References cur_state, DBG_REPLAY, NULL, num_states, state_mem, and timeindex.

int REPLAY::GetNumFuncs  ) 
 

Definition at line 557 of file replay.cpp.

References fnum.

Referenced by VAMOSWORLD::ProcessControls().

double REPLAY::GetTime  ) 
 

Definition at line 713 of file replay.cpp.

References playing, replay, and timeindex.

bool REPLAY::GhostCar  )  [inline]
 

Definition at line 211 of file replay.h.

References ghostcar.

Referenced by VAMOSWORLD::PhysUpdate(), VAMOSWORLD::ProcessControls(), and VAMOSWORLD::steer_commit().

void REPLAY::IncrementFrame  ) 
 

Definition at line 131 of file replay.cpp.

References CHAR_FUNCNUM, CHAR_STATE, REPLAY_PACKET::chardata, Clear(), fnum, funcmem, MAX_PACKETS, FUNCTION_MEMORY::newval, NULL, num_packets, packet, PlayIncrement(), playing, replay, Stop(), timeindex, and REPLAY_PACKET::val.

void REPLAY::Jump double  newtime  ) 
 

Definition at line 923 of file replay.cpp.

References cur_packet, cur_state, FrameTime(), num_packets, num_states, packet, Playing(), STATE_FREQUENCY, state_mem, and timeindex.

CARSTATE * REPLAY::LoadState  ) 
 

Definition at line 915 of file replay.cpp.

References loadstate, NULL, and state_to_load.

void REPLAY::PlayIncrement  ) 
 

Definition at line 562 of file replay.cpp.

References cur_packet, FrameTime(), num_packets, PlayProcessFrame(), PlayStop(), and timeindex.

Referenced by IncrementFrame().

float REPLAY::Playing  ) 
 

Definition at line 549 of file replay.cpp.

References playend, playing, and timeindex.

Referenced by VAMOSWORLD::DrawHUD(), Jump(), PlayStop(), VAMOSWORLD::ProcessControls(), and VAMOSWORLD::steer_commit().

void REPLAY::PlayProcessFrame  )  [private]
 

Definition at line 576 of file replay.cpp.

References cur_packet, DBG_REPLAY, fnum, FrameTime(), funcmem, packet, and timeindex.

Referenced by PlayIncrement().

bool REPLAY::PlayStart string  replayname,
bool  ngc
 

Definition at line 397 of file replay.cpp.

References FUNCTION_MEMORY::active, cur_packet, cur_state, UTILITY::FileExists(), fnum, FUNCTION_MEMORY::func_name, funcmem, FUNCTION_CHARS, GAMESTATE::GetGameMode(), GAMESTATE::GetGameState(), SETTINGS::GetSettingsDir(), ghostcar, FUNCTION_MEMORY::held, LoadWorld(), MODE_TIMETRIAL, NULL, FUNCTION_MEMORY::oldval, replay, REPLAY_VERSION, replaycar, replaypaint, TIMER::Reset(), rf, GAMESTATE::SetCarName(), GAMESTATE::SetCarPaint(), GAMESTATE::SetGameState(), settings, GAMESTATE::SetTrackName(), state, STATE_INITIALMENU, STATE_PLAYING, STATE_STAGING, Stop(), timer, and utility.

bool REPLAY::PlayStart string  replayname  ) 
 

Definition at line 392 of file replay.cpp.

void REPLAY::PlayStop  ) 
 

Definition at line 531 of file replay.cpp.

References funcmem, NULL, playing, Playing(), rf, and state_to_load.

Referenced by PlayIncrement(), and Start().

float REPLAY::Recording  ) 
 

Definition at line 381 of file replay.cpp.

References MAX_PACKETS, num_packets, and replay.

Referenced by VAMOSWORLD::DrawHUD(), and Quit().

void REPLAY::RememberCarState  )  [private]
 

Definition at line 760 of file replay.cpp.

References CARSTATE::CopyFrom(), curstate, MAX_STATES, num_states, and state_mem.

string REPLAY::ReplayCar  )  [inline]
 

Definition at line 212 of file replay.h.

References replaycar.

int REPLAY::ReplayPaint  )  [inline]
 

Definition at line 213 of file replay.h.

References replaypaint.

void REPLAY::Start  ) 
 

Definition at line 244 of file replay.cpp.

References BuildFuncMem(), Clear(), fnum, funcmem, GAMESTATE::GetGameMode(), GAMESTATE::GetGameState(), MODE_TIMETRIAL, num_packets, playing, PlayStop(), replay, TIMER::Reset(), ResetWorld(), GAMESTATE::SetGameState(), state, STATE_PLAYING, STATE_STAGING, Stop(), and timer.

Referenced by VGUI::Gui::ProcessAction().

void REPLAY::Stop  ) 
 

Definition at line 272 of file replay.cpp.

References fnum, funcmem, SETTINGS::GetSettingsDir(), NULL, num_packets, num_states, packet, replay, rf, settings, state_mem, WriteHeader(), and WritePackets().

Referenced by IncrementFrame(), PlayStart(), Quit(), and Start().

void REPLAY::WriteCarState  )  [private]
 

void REPLAY::WriteHeader FILE *  rf,
FUNCTION_MEMORY fmem,
int  fnm,
int  carnumber
 

Definition at line 298 of file replay.cpp.

References FUNCTION_CHARS, GAMESTATE::GetCarName(), GAMESTATE::GetCarPaint(), GAMESTATE::GetTrackName(), REPLAY_VERSION, and state.

Referenced by MULTIPLAY::Disconnect(), and Stop().

void REPLAY::WritePackets FILE *  rf,
REPLAY_PACKET pak,
int  pnum,
CARSTATE smem,
int  snum
 

Definition at line 330 of file replay.cpp.

References FUNCTION_STATEINFO, and CARSTATE::WriteToFile().

Referenced by MULTIPLAY::Disconnect(), and Stop().


Member Data Documentation

int REPLAY::cur_packet [private]
 

Definition at line 150 of file replay.h.

Referenced by GetNextPacket(), Jump(), PlayIncrement(), PlayProcessFrame(), PlayStart(), and REPLAY().

int REPLAY::cur_state [private]
 

Definition at line 160 of file replay.h.

Referenced by GetNextState(), Jump(), PlayStart(), and REPLAY().

CARSTATE REPLAY::curstate
 

Definition at line 192 of file replay.h.

Referenced by RememberCarState().

int REPLAY::fnum [private]
 

Definition at line 145 of file replay.h.

Referenced by AddRecord(), GetNumFuncs(), IncrementFrame(), PlayProcessFrame(), PlayStart(), Start(), and Stop().

FUNCTION_MEMORY* REPLAY::funcmem [private]
 

Definition at line 144 of file replay.h.

Referenced by AddRecord(), Clear(), GetFunc(), GetFuncIdx(), IncrementFrame(), PlayProcessFrame(), PlayStart(), PlayStop(), REPLAY(), Start(), Stop(), and ~REPLAY().

bool REPLAY::ghostcar [private]
 

Definition at line 165 of file replay.h.

Referenced by GhostCar(), PlayStart(), and REPLAY().

CARSTATE REPLAY::loadstate [private]
 

Definition at line 158 of file replay.h.

Referenced by LoadState().

int REPLAY::num_packets [private]
 

Definition at line 142 of file replay.h.

Referenced by AddRecord(), GetNextPacket(), IncrementFrame(), Jump(), PlayIncrement(), Recording(), REPLAY(), Start(), and Stop().

int REPLAY::num_states [private]
 

Definition at line 157 of file replay.h.

Referenced by Clear(), GetNextState(), Jump(), RememberCarState(), REPLAY(), and Stop().

REPLAY_PACKET REPLAY::packet[MAX_PACKETS] [private]
 

Definition at line 143 of file replay.h.

Referenced by GetNextPacket(), IncrementFrame(), Jump(), PlayProcessFrame(), and Stop().

float REPLAY::playend [private]
 

Definition at line 152 of file replay.h.

Referenced by Playing().

bool REPLAY::playing [private]
 

Definition at line 149 of file replay.h.

Referenced by GetTime(), IncrementFrame(), Playing(), PlayStop(), REPLAY(), and Start().

bool REPLAY::replay [private]
 

Definition at line 146 of file replay.h.

Referenced by AddRecord(), GetTime(), IncrementFrame(), PlayStart(), Recording(), REPLAY(), Start(), and Stop().

string REPLAY::replaycar [private]
 

Definition at line 167 of file replay.h.

Referenced by PlayStart(), and ReplayCar().

int REPLAY::replaypaint [private]
 

Definition at line 168 of file replay.h.

Referenced by PlayStart(), and ReplayPaint().

FILE* REPLAY::rf [private]
 

Definition at line 147 of file replay.h.

Referenced by PlayStart(), PlayStop(), and Stop().

CARSTATE REPLAY::state_mem[MAX_STATES] [private]
 

Definition at line 156 of file replay.h.

Referenced by Clear(), GetNextState(), Jump(), RememberCarState(), REPLAY(), and Stop().

bool REPLAY::state_to_load [private]
 

Definition at line 159 of file replay.h.

Referenced by LoadState(), PlayStop(), and REPLAY().

double REPLAY::timeindex [private]
 

Definition at line 148 of file replay.h.

Referenced by AddRecord(), GetNextState(), GetTime(), IncrementFrame(), Jump(), PlayIncrement(), Playing(), PlayProcessFrame(), and REPLAY().


The documentation for this class was generated from the following files:
Generated on Thu Oct 19 04:12:23 2006 by  doxygen 1.4.6