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

Function GameOptions_Load

src/config.c:112–129  ·  view source on GitHub ↗

* Loads the game options. * * @return True if loading is successful. */

Source from the content-addressed store, hash-verified

110 * @return True if loading is successful.
111 */
112bool GameOptions_Load(void)
113{
114 uint8 index;
115
116 index = File_Open_Personal("OPTIONS.CFG", FILE_MODE_READ);
117
118 if (index == FILE_INVALID) return false;
119
120 g_gameConfig.music = File_Read_LE16(index);
121 g_gameConfig.sounds = File_Read_LE16(index);
122 g_gameConfig.gameSpeed = File_Read_LE16(index);
123 g_gameConfig.hints = File_Read_LE16(index);
124 g_gameConfig.autoScroll = File_Read_LE16(index);
125
126 File_Close(index);
127
128 return true;
129}
130
131/**
132 * Saves the game options.

Callers 1

GameLoop_MainFunction · 0.85

Calls 2

File_Read_LE16Function · 0.85
File_CloseFunction · 0.85

Tested by

no test coverage detected