29 #include "../../idlib/precompiled.h"
32 #include "../Game_local.h"
107 #ifdef ID_DEBUG_MEMORY
142 ( obj->*cls->
Save )(
this );
234 len = strlen(
string );
296 for ( i = 0; i <
num; i++ ) {
334 gameLocal.
DPrintf(
"idSaveGame::WriteObject - WriteObject FindIndex failed\n" );
367 for( i = 0; i <
num; i++ ) {
467 name = model->
Name();
487 gameLocal.
Error(
"idSaveGame::WriteUserInterface: ui failed to write properly\n" );
735 memset( tmp, 0,
sizeof( tmp ) );
745 if ( clipModel !=
NULL ) {
747 clipModel->
Save(
this );
814 Error(
"idRestoreGame::CreateObjects: Unknown class '%s'", classname.
c_str() );
818 #ifdef ID_DEBUG_MEMORY
844 if (
objects[ i ]->IsType( idEntity::Type ) ) {
851 #ifdef ID_DEBUG_MEMORY
882 va_start( argptr, fmt );
905 ( obj->*cls->
Restore )(
this );
950 file->
Read( &value,
sizeof( value ) );
959 file->
Read( &value,
sizeof( value ) );
990 Error(
"idRestoreGame::ReadString: invalid length" );
993 string.Fill(
' ', len );
1039 file->
Read( &bounds,
sizeof( bounds ) );
1040 LittleRevBytes( &bounds,
sizeof(
float),
sizeof(bounds)/
sizeof(
float) );
1053 for ( i = 0; i <
num; i++ ) {
1074 file->
Read( &angles,
sizeof( angles ) );
1087 if ( ( index < 0 ) || ( index >=
objects.
Num() ) ) {
1088 Error(
"idRestoreGame::ReadObject: invalid object index" );
1119 for( i = 0; i <
num; i++ ) {
1122 dict->
Set( key, value );
1256 Error(
"idSaveGame::ReadUserInterface: ui failed to read properly\n" );
1520 bool restoreClipModel;
1523 if ( restoreClipModel ) {
void ReadContactInfo(contactInfo_t &contactInfo)
void WriteBuildNumber(const int value)
virtual int WriteVec6(const idVec6 &vec)
void ReadSignedChar(signed char &value)
virtual int ReadShort(short &value)
void WriteTrace(const trace_t &trace)
GLsizei const GLfloat * value
void WriteString(const char *string)
void WriteGameState_f(const idCmdArgs &args)
virtual int virtual int ReadInt(int &value)
void ReadSoundCommands(void)
void ReadSoundShader(const idSoundShader *&shader)
virtual const idSoundShader * FindSound(const char *name, bool makeDefault=true)=0
virtual void StateChanged(int time, bool redraw=false)=0
void ReadParticle(const idDeclParticle *&particle)
static idTypeInfo * GetType(int num)
void ReadVec2(idVec2 &vec)
const int MAX_GLOBAL_SHADER_PARMS
void ReadMaterial(const idMaterial *&material)
void WriteObject(const idClass *obj)
virtual int ReadVec4(idVec4 &vec)
idList< const idClass * > objects
traceModelVert_t verts[MAX_TRACEMODEL_VERTS]
const idStr & GetKey(void) const
void SetNum(int newnum, bool resize=true)
void ReadDict(idDict *dict)
void WriteSkin(const idDeclSkin *skin)
void void void void void Error(const char *fmt,...) const id_attribute((format(printf
void WriteModel(const idRenderModel *model)
void Write(const void *buffer, int len)
void WriteVec4(const idVec4 &vec)
const idMaterial * referenceShader
void ReadWinding(idWinding &winding)
void ReadFX(const idDeclFX *&fx)
int suppressShadowInViewID
const char * GetName(void) const
void ReadJoint(jointHandle_t &value)
void ReadBool(bool &value)
void WriteStaticObject(const idClass &obj)
virtual const char * Name() const =0
void ReadTraceModel(idTraceModel &trace)
virtual int Index(void) const =0
void ReadBuildNumber(void)
GLuint GLuint GLsizei GLenum type
traceModelEdge_t edges[MAX_TRACEMODEL_EDGES+1]
virtual const idMaterial * FindMaterial(const char *name, bool makeDefault=true)=0
void Set(const char *key, const char *value)
virtual int WriteVec4(const idVec4 &vec)
idUserInterfaceManager * uiManager
virtual int WriteVec2(const idVec2 &vec)
void WriteClipModel(const class idClipModel *clipModel)
void ReadUsercmd(usercmd_t &usercmd)
virtual const char * GetName(void)
void ReadModel(idRenderModel *&model)
deferredEntityCallback_t callback
void WriteVec3(const idVec3 &vec)
void ReadRenderEntity(renderEntity_t &renderEntity)
const idMaterial * customShader
void ReadVec6(idVec6 &vec)
idSoundWorld * gameSoundWorld
void WriteSoundShader(const idSoundShader *shader)
void WriteMaterial(const idMaterial *material)
const int MAX_ENTITY_SHADER_PARMS
void CallSave_r(const idTypeInfo *cls, const idClass *obj)
void(idClass::* Restore)(idRestoreGame *savefile)
void WriteJoint(const jointHandle_t value)
void WriteBool(const bool value)
virtual idUserInterface * FindGui(const char *qpath, bool autoLoad=false, bool needUnique=false, bool forceUnique=false)=0
int suppressLightInViewID
float shaderParms[MAX_ENTITY_SHADER_PARMS]
void WriteUsercmd(const usercmd_t &usercmd)
void WriteSignedChar(const signed char value)
#define MAX_TRACEMODEL_POLYS
virtual void WriteToSaveGame(idFile *savefile)=0
void(idClass::* Save)(idSaveGame *savefile) const
int suppressShadowInLightID
void ReadTrace(trace_t &trace)
bool noDynamicInteractions
void WriteShort(const short value)
virtual int WriteInt(const int value)
int GetNumPoints(void) const
void WriteWinding(const idWinding &winding)
GLubyte GLubyte GLubyte GLubyte w
void ReadFloat(float &value)
idStr & StripFileExtension(void)
virtual bool ReadFromSaveGame(idFile *savefile)=0
static void RestoreTraceModels(idRestoreGame *savefile)
idSoundEmitter * referenceSound
void ReadRenderLight(renderLight_t &renderLight)
void void Read(void *buffer, int len)
void WriteFloat(const float value)
virtual int ReadVec2(idVec2 &vec)
void LittleRevBytes(void *bp, int elsize, int elcount)
const idDeclSkin * customSkin
void void DPrintf(const char *fmt,...) const id_attribute((format(printf
int edges[MAX_TRACEMODEL_POLYEDGES]
virtual idRenderModel * FindModel(const char *modelName)=0
void ReadModelDef(const idDeclModelDef *&modelDef)
virtual const idDecl * FindType(declType_t type, const char *name, bool makeDefault=true)=0
virtual int ReadVec3(idVec3 &vec)
void WriteVec6(const idVec6 &vec)
const int MAX_RENDERENTITY_GUI
static idTypeInfo * GetClass(const char *name)
static void SaveTraceModels(idSaveGame *savefile)
virtual const char * Name() const =0
virtual int Read(void *buffer, int len)
void Save(idSaveGame *savefile) const
void ReadVec4(idVec4 &vec)
void ReadUserInterface(idUserInterface *&ui)
const idStr & GetValue(void) const
float shaderParms[MAX_GLOBAL_SHADER_PARMS]
void DeleteContents(bool clear)
const idSoundShader * shader
void CallRestore_r(const idTypeInfo *cls, idClass *obj)
void WriteObjectList(void)
void ReadRefSound(refSound_t &refSound)
void WriteRenderEntity(const renderEntity_t &renderEntity)
void Error(const char *fmt,...) id_attribute((format(printf
void ReadBounds(idBounds &bounds)
virtual int ReadBool(bool &value)
idSaveGame(idFile *savefile)
void WriteInt(const int value)
virtual void Present(void)
void WriteRenderView(const renderView_t &view)
idDeclManager * declManager
void WriteMat3(const idMat3 &mat)
void ReadMat3(idMat3 &mat)
void WriteDict(const idDict *dict)
#define MAX_TRACEMODEL_EDGES
void ReadStaticObject(idClass &obj)
void ReadClipModel(idClipModel *&clipModel)
int Append(const type &obj)
idRenderModelManager * renderModelManager
idRenderModel * prelightModel
void WriteAngles(const idAngles &angles)
void InitTypeVariables(const void *typePtr, const char *typeName, int value)
int AddUnique(const type &obj)
idList< idClass * > objects
virtual int WriteShort(const short value)
bool RemoveIndex(int index)
void ReadShort(short &value)
virtual int WriteFloat(const float value)
virtual bool IsUniqued() const =0
virtual bool WriteToSaveGame(idFile *savefile) const =0
void WriteRefSound(const refSound_t &refSound)
void WriteFX(const idDeclFX *fx)
virtual int Write(const void *buffer, int len)
virtual idSoundEmitter * EmitterForIndex(int index)=0
void WriteTraceModel(const idTraceModel &trace)
void ReadRenderView(renderView_t &view)
void WriteVec2(const idVec2 &vec)
void WriteByte(const byte value)
void ReadVec3(idVec3 &vec)
class idSoundEmitter * referenceSound
int suppressSurfaceInViewID
int vsprintf(idStr &string, const char *fmt, va_list argptr)
void WriteContactInfo(const contactInfo_t &contactInfo)
class idUserInterface * gui[MAX_RENDERENTITY_GUI]
const char * c_str(void) const
traceModelPoly_t polys[MAX_TRACEMODEL_POLYS]
void RestoreObjects(void)
virtual int WriteMat3(const idMat3 &mat)
void ReadAngles(idAngles &angles)
int FindIndex(const type &obj) const
void WriteBounds(const idBounds &bounds)
const idKeyValue * GetKeyVal(int index) const
virtual int ReadVec6(idVec6 &vec)
void AddObject(const idClass *obj)
#define MAX_TRACEMODEL_VERTS
void WriteSoundCommands(void)
virtual const idDeclSkin * FindSkin(const char *name, bool makeDefault=true)=0
void WriteModelDef(const class idDeclModelDef *modelDef)
virtual void ReadFromSaveGame(idFile *savefile)=0
virtual int ReadMat3(idMat3 &mat)
virtual int ReadFloat(float &value)
#define MAX_TRACEMODEL_POLYEDGES
char * va(const char *fmt,...)
virtual int WriteBool(const bool value)
idSoundEmitter * referenceSound
const idMaterial * shader
idRestoreGame(idFile *savefile)
void WriteParticle(const idDeclParticle *particle)
void Restore(idRestoreGame *savefile)
int GetNumKeyVals(void) const
float shaderParms[MAX_ENTITY_SHADER_PARMS]
void ReadString(idStr &string)
void WriteRenderLight(const renderLight_t &renderLight)
struct renderView_s * remoteRenderView
virtual int WriteVec3(const idVec3 &vec)
void WriteUserInterface(const idUserInterface *ui, bool unique)
void ReadSkin(const idDeclSkin *&skin)
void ReadByte(byte &value)
void ReadObject(idClass *&obj)
idClass *(* CreateInstance)(void)
virtual void StopAllSounds(void)=0