MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / Restore

Method Restore

neo/d3xp/script/Script_Interpreter.cpp:110–158  ·  view source on GitHub ↗

================ idInterpreter::Restore ================ */

Source from the content-addressed store, hash-verified

108================
109*/
110void idInterpreter::Restore( idRestoreGame *savefile ) {
111 int i;
112 idStr funcname;
113 int func_index;
114
115 savefile->ReadInt( callStackDepth );
116 for( i = 0; i < callStackDepth; i++ ) {
117 savefile->ReadInt( callStack[i].s );
118
119 savefile->ReadInt( func_index );
120 if ( func_index >= 0 ) {
121 callStack[i].f = gameLocal.program.GetFunction( func_index );
122 } else {
123 callStack[i].f = NULL;
124 }
125
126 savefile->ReadInt( callStack[i].stackbase );
127 }
128 savefile->ReadInt( maxStackDepth );
129
130 savefile->ReadInt( localstackUsed );
131 savefile->Read( &localstack, localstackUsed );
132
133 savefile->ReadInt( localstackBase );
134 savefile->ReadInt( maxLocalstackUsed );
135
136 savefile->ReadInt( func_index );
137 if ( func_index >= 0 ) {
138 currentFunction = gameLocal.program.GetFunction( func_index );
139 } else {
140 currentFunction = NULL;
141 }
142 savefile->ReadInt( instructionPointer );
143
144 savefile->ReadInt( popParms );
145
146 savefile->ReadString( funcname );
147 if ( funcname.Length() ) {
148 multiFrameEvent = idEventDef::FindEvent( funcname );
149 }
150
151 savefile->ReadObject( reinterpret_cast<idClass *&>( eventEntity ) );
152 savefile->ReadObject( reinterpret_cast<idClass *&>( thread ) );
153
154 savefile->ReadBool( doneProcessing );
155 savefile->ReadBool( threadDying );
156 savefile->ReadBool( terminateOnExit );
157 savefile->ReadBool( debug );
158}
159
160/*
161================

Callers

nothing calls this directly

Calls 7

ReadIntMethod · 0.45
GetFunctionMethod · 0.45
ReadMethod · 0.45
ReadStringMethod · 0.45
LengthMethod · 0.45
ReadObjectMethod · 0.45
ReadBoolMethod · 0.45

Tested by

no test coverage detected