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

Function GameOptions_Save

src/config.c:134–151  ·  view source on GitHub ↗

* Saves the game options. */

Source from the content-addressed store, hash-verified

132 * Saves the game options.
133 */
134void GameOptions_Save(void)
135{
136 uint8 index;
137
138 index = File_Open_Personal("OPTIONS.CFG", FILE_MODE_WRITE);
139
140 if (index == FILE_INVALID) return;
141
142 File_Write_LE16(index, g_gameConfig.music);
143 File_Write_LE16(index, g_gameConfig.sounds);
144 File_Write_LE16(index, g_gameConfig.gameSpeed);
145 File_Write_LE16(index, g_gameConfig.hints);
146 File_Write_LE16(index, g_gameConfig.autoScroll);
147
148 File_Close(index);
149
150 if (g_gameConfig.music == 0) Music_Play(0);
151}

Callers 1

GUI_Widget_Options_ClickFunction · 0.85

Calls 3

File_Write_LE16Function · 0.85
File_CloseFunction · 0.85
Music_PlayFunction · 0.85

Tested by

no test coverage detected