MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / SaveGame_LoadFile

Function SaveGame_LoadFile

src/load.c:131–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131bool SaveGame_LoadFile(char *filename)
132{
133 FILE *fp;
134 bool res;
135
136 Sound_Output_Feedback(0xFFFE);
137
138 Game_Init();
139
140 fp = fopendatadir(SEARCHDIR_PERSONAL_DATA_DIR, filename, "rb");
141 if (fp == NULL) {
142 Error("Failed to open file '%s' for reading.\n", filename);
143 return false;
144 }
145
146 Sprites_LoadTiles();
147
148 g_validateStrictIfZero++;
149 res = Load_Main(fp);
150 g_validateStrictIfZero--;
151
152 fclose(fp);
153
154 if (!res) {
155 Error("Error while loading savegame '%s'.\n", filename);
156 return false;
157 }
158
159 if (g_gameMode != GM_RESTART) Game_Prepare();
160
161 return true;
162}
163
164/**
165 * In case the current house is Mercenary, another palette is loaded.

Callers 1

Calls 7

Sound_Output_FeedbackFunction · 0.85
Game_InitFunction · 0.85
fopendatadirFunction · 0.85
Sprites_LoadTilesFunction · 0.85
Load_MainFunction · 0.85
Game_PrepareFunction · 0.85
ErrorFunction · 0.50

Tested by

no test coverage detected