TODO: MTS: unused in project This function restarts all game systems
| 2143 | // TODO: MTS: unused in project |
| 2144 | // This function restarts all game systems |
| 2145 | void RestartD3() { |
| 2146 | ddio_init_info io_info; |
| 2147 | |
| 2148 | if (!Init_systems_init) |
| 2149 | return; |
| 2150 | |
| 2151 | mprintf(0, "Restarting D3...\n"); |
| 2152 | |
| 2153 | if (!FindArg("-windowed")) { |
| 2154 | if (Dedicated_server) { |
| 2155 | ddio_MouseMode(MOUSE_STANDARD_MODE); |
| 2156 | } else { |
| 2157 | ddio_MouseMode(MOUSE_EXCLUSIVE_MODE); |
| 2158 | } |
| 2159 | } |
| 2160 | |
| 2161 | // startup io |
| 2162 | io_info.obj = Descent; |
| 2163 | io_info.key_emulation = true; //(bool)(FindArg("-slowkey")!=0); |
| 2164 | io_info.joy_emulation = (bool)((FindArg("-alternatejoy") == 0) && (FindArg("-directinput") == 0)); |
| 2165 | if (!ddio_Init(&io_info)) { |
| 2166 | Error("I/O initialization failed."); |
| 2167 | } |
| 2168 | |
| 2169 | // startup screen. |
| 2170 | ddvid_Init(Descent, App_ddvid_subsystem); |
| 2171 | ddio_KeyFlush(); |
| 2172 | SetScreenMode(Init_old_screen_mode); |
| 2173 | SetUICallback(Init_old_ui_callback); |
| 2174 | if (Init_ui_cursor_visible) |
| 2175 | ui_ShowCursor(); |
| 2176 | |
| 2177 | // startup game systems |
| 2178 | InitControls(); |
| 2179 | LoadControlConfig(&Init_old_pilot); |
| 2180 | |
| 2181 | // resume game sounds and time as needed |
| 2182 | if (GetFunctionMode() == GAME_MODE) { |
| 2183 | if (!(Game_mode & GM_MULTI)) { |
| 2184 | if (!Init_was_game_paused) { |
| 2185 | ResumeGame(); |
| 2186 | } else { |
| 2187 | D3MusicResume(); |
| 2188 | } |
| 2189 | } |
| 2190 | } else { |
| 2191 | Sound_system.ResumeSounds(); |
| 2192 | D3MusicResume(); |
| 2193 | } |
| 2194 | |
| 2195 | // resume controller if it was active before alt-tabbing out. |
| 2196 | if (Init_old_control_mode) { |
| 2197 | ResumeControls(); |
| 2198 | } |
| 2199 | |
| 2200 | // Restart Force Feedback |
| 2201 | ForceRestart(); |
| 2202 |
nothing calls this directly
no test coverage detected