| 818 | } |
| 819 | |
| 820 | static void FillSavegameDesc(bool save) |
| 821 | { |
| 822 | uint8 i; |
| 823 | |
| 824 | for (i = 0; i < 5; i++) { |
| 825 | char *desc = g_savegameDesc[i]; |
| 826 | char *filename; |
| 827 | uint8 fileId; |
| 828 | |
| 829 | *desc = '\0'; |
| 830 | |
| 831 | if (s_savegameIndexBase - i < 0) continue; |
| 832 | |
| 833 | if (s_savegameIndexBase - i == s_savegameCountOnDisk) { |
| 834 | if (!save) continue; |
| 835 | |
| 836 | strncpy(desc, String_Get_ByIndex(STR_EMPTY_SLOT_), 50); |
| 837 | continue; |
| 838 | } |
| 839 | |
| 840 | filename = GenerateSavegameFilename(s_savegameIndexBase - i); |
| 841 | |
| 842 | fileId = ChunkFile_Open_Personal(filename); |
| 843 | if (fileId == FILE_INVALID) continue; |
| 844 | ChunkFile_Read(fileId, HTOBE32(CC_NAME), desc, 50); |
| 845 | ChunkFile_Close(fileId); |
| 846 | continue; |
| 847 | } |
| 848 | } |
| 849 | |
| 850 | |
| 851 | /** |
no test coverage detected