| 1875 | |
| 1876 | extern void RunGameFromEditor(); |
| 1877 | |
| 1878 | void CMainFrame::OnFilePlayin640x480() { |
| 1879 | // Returns true if there are out of data files |
| 1880 | int count = AreScriptsOutofDate(); |
| 1881 | if (count > 0) { |
| 1882 | if (OutrageMessageBox(MBOX_YESNO, "There were %d scripts that couldn't be compiled, continue?", count) != IDYES) |
| 1883 | return; |
| 1884 | } |
| 1885 | |
| 1886 | renderer_type sr_save; |
| 1887 | bool keypad_was_visible = D3EditState.keypad_visible; |
| 1888 | DWORD cbar_was_visible = (m_wndToolBar.GetStyle() & WS_VISIBLE); |
| 1889 | DWORD status_was_visible = (m_wndStatusBar.GetStyle() & WS_VISIBLE); |
| 1890 | |
| 1891 | // Shutdown view system |
| 1892 | m_ViewActivated = FALSE; |
| 1893 | ((CEditorView *)GetActiveView())->DeactivateView(); |
| 1894 | if (m_FloatingKeypadDialog) |
| 1895 | m_FloatingKeypadDialog->Deactivate(); |
| 1896 | CKeypadDialog::Deactivate(); |
| 1897 | delete Desktop_surf; |
| 1898 | |
| 1899 | // hide keypad if it's visible |
| 1900 | if (keypad_was_visible) |
| 1901 | OnViewKeypadToggle(); |
| 1902 | if (cbar_was_visible) |
| 1903 | ShowControlBar(&m_wndToolBar, FALSE, FALSE); |
| 1904 | if (status_was_visible) |
| 1905 | ShowControlBar(&m_wndStatusBar, FALSE, FALSE); |
| 1906 | |
| 1907 | SetFunctionMode(EDITOR_GAME_MODE); |
| 1908 | |
| 1909 | sr_save = Renderer_type; |
| 1910 | |
| 1911 | // if we have selected the windowed toggle, assert this. |
| 1912 | if (D3EditState.game_render_mode == GM_WINDOWED) |
| 1913 | PROGRAM(windowed) = 1; |
| 1914 | else |
| 1915 | PROGRAM(windowed) = 0; |
| 1916 | |
| 1917 | RunGameFromEditor(); |
| 1918 | PROGRAM(windowed) = 1; |
| 1919 | |
| 1920 | Renderer_type = sr_save; |
| 1921 | |
| 1922 | // hide keypad if it's visible |
| 1923 | if (status_was_visible) |
| 1924 | ShowControlBar(&m_wndStatusBar, TRUE, FALSE); |
| 1925 | if (cbar_was_visible) |
| 1926 | ShowControlBar(&m_wndToolBar, TRUE, FALSE); |
| 1927 | if (keypad_was_visible) |
| 1928 | OnViewKeypadToggle(); |
| 1929 | |
| 1930 | // Restore view system |
| 1931 | Desktop_surf = new grSurface(0, 0, 0, SURFTYPE_VIDEOSCREEN, 0); |
| 1932 | if (m_FloatingKeypadDialog) |
| 1933 | m_FloatingKeypadDialog->Activate(); |
| 1934 | CKeypadDialog::Activate(); |
nothing calls this directly
no test coverage detected