| 383 | } |
| 384 | |
| 385 | void DemoWriteHeader() { |
| 386 | char szsig[10]; |
| 387 | strcpy(szsig, D3_DEMO_SIG_NEW); |
| 388 | ASSERT(Demo_flags == DF_RECORDING); |
| 389 | |
| 390 | // Start off with the signature |
| 391 | cf_WriteString(Demo_cfp, (const char *)szsig); |
| 392 | // Next is the version |
| 393 | cf_WriteShort(Demo_cfp, GAMESAVE_VERSION); |
| 394 | // Write the mission filename |
| 395 | if (Current_mission.filename && (stricmp("d3_2.mn3", Current_mission.filename) == 0)) { |
| 396 | cf_WriteString(Demo_cfp, "d3.mn3"); |
| 397 | } else { |
| 398 | cf_WriteString(Demo_cfp, Current_mission.filename ? Current_mission.filename : ""); |
| 399 | } |
| 400 | |
| 401 | // Level number |
| 402 | cf_WriteInt(Demo_cfp, Current_mission.cur_level); |
| 403 | // Gametime |
| 404 | cf_WriteFloat(Demo_cfp, Gametime); |
| 405 | |
| 406 | // Frame count |
| 407 | cf_WriteInt(Demo_cfp, FrameCount); |
| 408 | |
| 409 | // Now store the world state (borrowing save game code) |
| 410 | |
| 411 | // Load translation tables |
| 412 | SGSXlateTables(Demo_cfp); |
| 413 | |
| 414 | // save out room information. |
| 415 | SGSRooms(Demo_cfp); |
| 416 | |
| 417 | // save out triggers |
| 418 | SGSTriggers(Demo_cfp); |
| 419 | |
| 420 | // save out object information. |
| 421 | SGSObjects(Demo_cfp); |
| 422 | |
| 423 | // players |
| 424 | SGSPlayers(Demo_cfp); |
| 425 | |
| 426 | // save out viseffects |
| 427 | SGSVisEffects(Demo_cfp); |
| 428 | |
| 429 | // save out spew |
| 430 | SGSSpew(Demo_cfp); |
| 431 | |
| 432 | Osiris_SaveSystemState(Demo_cfp); |
| 433 | |
| 434 | cf_WriteShort(Demo_cfp, Player_num); |
| 435 | } |
| 436 | |
| 437 | void DemoStartNewFrame() { |
| 438 | if (Demo_flags != DF_RECORDING) { |
no test coverage detected