Make Fullscreen checkbox instant.

This commit is contained in:
The Dax 2013-10-13 13:24:49 -04:00
parent 78b48f75f7
commit 3d8b68e88e
5 changed files with 17 additions and 1 deletions

View File

@ -45,6 +45,7 @@ public:
virtual void InitSound(PMixer *mixer) = 0;
virtual void UpdateSound() {}
virtual void UpdateScreen() {}
virtual void GoFullscreen(bool) {}
virtual void ShutdownSound() = 0;
virtual void PollControllers(InputState &input_state) {}

View File

@ -136,7 +136,7 @@ void GameSettingsScreen::CreateViews() {
// graphicsSettings->Add(new CheckBox(&g_Config.bTrueColor, gs->T("True Color")));
#ifdef _WIN32
graphicsSettings->Add(new CheckBox(&g_Config.bVSync, gs->T("VSync")));
graphicsSettings->Add(new CheckBox(&g_Config.bFullScreen, gs->T("FullScreen")));
graphicsSettings->Add(new CheckBox(&g_Config.bFullScreen, gs->T("FullScreen")))->OnClick.Handle(this, &GameSettingsScreen::OnFullscreenChange);
#endif
graphicsSettings->Add(new ItemHeader(gs->T("Antialiasing and postprocessing")));
@ -305,6 +305,11 @@ UI::EventReturn GameSettingsScreen::OnRenderingMode(UI::EventParams &e) {
return UI::EVENT_DONE;
}
UI::EventReturn GameSettingsScreen::OnFullscreenChange(UI::EventParams &e) {
host->GoFullscreen(g_Config.bFullScreen);
return UI::EVENT_DONE;
}
UI::EventReturn GameSettingsScreen::OnResolutionChange(UI::EventParams &e) {
if (gpu) {
gpu->Resized();

View File

@ -63,6 +63,7 @@ private:
UI::EventReturn OnChangeNickname(UI::EventParams &e);
UI::EventReturn OnClearRecents(UI::EventParams &e);
UI::EventReturn OnRenderingMode(UI::EventParams &e);
UI::EventReturn OnFullscreenChange(UI::EventParams &e);
UI::EventReturn OnResolutionChange(UI::EventParams &e);
UI::EventReturn OnRestoreDefaultSettings(UI::EventParams &e);

View File

@ -369,3 +369,10 @@ bool WindowsHost::CreateDesktopShortcut(std::string argumentPath, std::string ga
delete [] pathbuf;
return false;
}
void WindowsHost::GoFullscreen(bool viewFullscreen) {
if (viewFullscreen)
MainWindow::_ViewFullScreen(MainWindow::GetHWND());
else
MainWindow::_ViewNormal(MainWindow::GetHWND());
}

View File

@ -66,6 +66,8 @@ public:
virtual bool CanCreateShortcut() {return false;} // Turn on when fixed
virtual bool CreateDesktopShortcut(std::string argumentPath, std::string title);
virtual void GoFullscreen(bool);
bool InputBoxGetString(char *title, const char *defaultValue, char *outValue, size_t outlength);
bool InputBoxGetWString(const wchar_t *title, const std::wstring &defaultvalue, std::wstring &outvalue);
std::shared_ptr<KeyboardDevice> keyboard;