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

Method OpenForWriting

neo/framework/DemoFile.cpp:157–179  ·  view source on GitHub ↗

================ idDemoFile::OpenForWriting ================ */

Source from the content-addressed store, hash-verified

155================
156*/
157bool idDemoFile::OpenForWriting( const char *fileName ) {
158 Close();
159
160 f = fileSystem->OpenFileWrite( fileName );
161 if ( f == NULL ) {
162 return false;
163 }
164
165 if ( com_logDemos.GetBool() ) {
166 fLog = fileSystem->OpenFileWrite( "demowrite.log" );
167 }
168
169 writing = true;
170
171 f->Write(DEMO_MAGIC, sizeof(DEMO_MAGIC));
172 f->WriteInt( com_compressDemos.GetInteger() );
173 f->Flush();
174
175 compressor = AllocCompressor( com_compressDemos.GetInteger() );
176 compressor->Init( f, true, 8 );
177
178 return true;
179}
180
181/*
182================

Callers 2

CompressDemoFileMethod · 0.80

Calls 7

OpenFileWriteMethod · 0.80
GetIntegerMethod · 0.80
GetBoolMethod · 0.45
WriteMethod · 0.45
WriteIntMethod · 0.45
FlushMethod · 0.45
InitMethod · 0.45

Tested by

no test coverage detected