mc2: 0x0053B6A0
| 134 | |
| 135 | //mc2: 0x0053B6A0 |
| 136 | bool Settings::load_settings() { |
| 137 | FileHandler::FuncTable *fileFuncs = glo_679810; |
| 138 | |
| 139 | glo_679810 = &glo_679884; |
| 140 | |
| 141 | FileHandler* file = glo_860220->vir_1C("userdata\\options.cfg", "", 0, 1); |
| 142 | if (file == nullptr) { |
| 143 | file = glo_860220->vir_1C("userdata\\default.cfg", "", 0, 1); |
| 144 | } |
| 145 | |
| 146 | glo_679810 = fileFuncs; |
| 147 | if (file == nullptr) { |
| 148 | return false; |
| 149 | } |
| 150 | |
| 151 | unk_616420 option("options", file); |
| 152 | char buffer[256]; |
| 153 | if (option.sub_6154D0("AudioDriver:", 1)) { |
| 154 | if (option.sub_47C920(buffer, 0xFF) >= 0) { |
| 155 | buffer[255] = '\0'; |
| 156 | set_audio_driver(buffer); |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | if (option.sub_6154D0("ScreenWidth:", 1)) { |
| 161 | set_screen_width(option.read_integer()); |
| 162 | } |
| 163 | |
| 164 | if (option.sub_6154D0("ScreenHeight:", 1)) { |
| 165 | set_screen_height(option.read_integer()); |
| 166 | } |
| 167 | |
| 168 | if (option.sub_6154D0("ScreenDepth:", 1)) { |
| 169 | set_screen_depth(option.read_integer()); |
| 170 | } |
| 171 | |
| 172 | if (option.sub_6154D0("DrawDistance:", 1)) { |
| 173 | set_draw_distance(option.read_integer()); |
| 174 | } |
| 175 | |
| 176 | if (option.sub_6154D0("EnvironmentMapping:", 1)) { |
| 177 | set_environment_mapping(option.read_integer()); |
| 178 | } |
| 179 | |
| 180 | if (option.sub_6154D0("Reflections:", 1)) { |
| 181 | set_reflections(option.read_integer()); |
| 182 | } |
| 183 | |
| 184 | if (option.sub_6154D0("Shadows:", 1)) { |
| 185 | set_shadows(option.read_integer()); |
| 186 | } |
| 187 | |
| 188 | if (option.sub_6154D0("FullScreenEffects:", 1)) { |
| 189 | set_fullscreen_effects(option.read_integer()); |
| 190 | } |
| 191 | |
| 192 | if (option.sub_6154D0("Language:", 1)) { |
| 193 | if (option.sub_47C920(buffer, 0xFF) >= 0) { |
nothing calls this directly
no test coverage detected