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

Method ReadHashString

neo/framework/DemoFile.cpp:216–245  ·  view source on GitHub ↗

================ idDemoFile::ReadHashString ================ */

Source from the content-addressed store, hash-verified

214================
215*/
216const char *idDemoFile::ReadHashString() {
217 int index;
218
219 if ( log && fLog ) {
220 const char *text = va( "%s > Reading hash string\n", logStr.c_str() );
221 fLog->Write( text, strlen( text ) );
222 }
223
224 ReadInt( index );
225
226 if ( index == -1 ) {
227 // read a new string for the table
228 idStr *str = new idStr;
229
230 idStr data;
231 ReadString( data );
232 *str = data;
233
234 demoStrings.Append( str );
235
236 return *str;
237 }
238
239 if ( index < -1 || index >= demoStrings.Num() ) {
240 Close();
241 common->Error( "demo hash index out of range" );
242 }
243
244 return demoStrings[index]->c_str();
245}
246
247/*
248================

Callers 8

ProcessDemoCommandMethod · 0.80
ReadRenderLightMethod · 0.80
ReadRenderEntityMethod · 0.80
ReadFromDemoMethod · 0.80
ReadFromDemoFileMethod · 0.80
ProcessDemoCommandMethod · 0.80
ReadFromDemoFileMethod · 0.80
ReadFromDemoFileMethod · 0.80

Calls 7

vaFunction · 0.85
ReadStringFunction · 0.85
c_strMethod · 0.45
WriteMethod · 0.45
AppendMethod · 0.45
NumMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected