================ idDemoFile::OpenForWriting ================ */
| 155 | ================ |
| 156 | */ |
| 157 | bool 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 | ================ |
no test coverage detected