| 709 | } |
| 710 | |
| 711 | static void SG_WriteComment(qboolean qbAutosave, const char *psMapName) |
| 712 | { |
| 713 | ojk::SavedGameHelper saved_game( |
| 714 | &ojk::SavedGame::get_instance()); |
| 715 | |
| 716 | char sComment[iSG_COMMENT_SIZE]; |
| 717 | |
| 718 | if ( qbAutosave || !*saveGameComment) |
| 719 | { |
| 720 | Com_sprintf( sComment, sizeof(sComment), "---> %s", psMapName ); |
| 721 | } |
| 722 | else |
| 723 | { |
| 724 | Q_strncpyz(sComment,saveGameComment, sizeof(sComment)); |
| 725 | } |
| 726 | |
| 727 | saved_game.write_chunk( |
| 728 | INT_ID('C', 'O', 'M', 'M'), |
| 729 | sComment); |
| 730 | |
| 731 | // Add Date/Time/Map stamp |
| 732 | unsigned int timestamp = SG_UnixTimestamp (time (NULL)); |
| 733 | |
| 734 | saved_game.write_chunk<uint32_t>( |
| 735 | INT_ID('C', 'M', 'T', 'M'), |
| 736 | timestamp); |
| 737 | |
| 738 | Com_DPrintf("Saving: current (%s)\n", sComment); |
| 739 | } |
| 740 | |
| 741 | static time_t SG_GetTime ( unsigned int timestamp ) |
| 742 | { |
no test coverage detected