Add Display layout editor to use for example on tablets, but also includes automatic screen cropping for 16:9 cases(default).

//Rebased & removed atlas stuff which was added with #8096
//squashed with some improvements
This commit is contained in:
LunaMoo 2015-10-24 14:40:29 +02:00 committed by Luna
parent 8b2da19a55
commit ae1cf1d85d
19 changed files with 476 additions and 33 deletions

View file

@ -33,6 +33,7 @@
#include "UI/MiscScreens.h"
#include "UI/ControlMappingScreen.h"
#include "UI/DevScreens.h"
#include "UI/DisplayLayoutScreen.h"
#include "UI/SavedataScreen.h"
#include "UI/TouchControlLayoutScreen.h"
#include "UI/TouchControlVisibilityScreen.h"
@ -163,8 +164,12 @@ void GameSettingsScreen::CreateViews() {
graphicsSettings->Add(new CheckBox(&g_Config.bFullScreen, gr->T("FullScreen")))->OnClick.Handle(this, &GameSettingsScreen::OnFullscreenChange);
#endif
graphicsSettings->Add(new CheckBox(&g_Config.bStretchToDisplay, gr->T("Stretch to Display")));
// Small Display: To avoid overlapping touch controls on large tablets. Better control over this will be coming later.
graphicsSettings->Add(new CheckBox(&g_Config.bSmallDisplay, gr->T("Small Display")));
// Display Layout Editor: To avoid overlapping touch controls on large tablets, meet geeky demands for integer zoom/unstretched image etc.
displayEditor_ = graphicsSettings->Add(new Choice(gr->T("Display layout editor")));
displayEditor_->OnClick.Handle(this, &GameSettingsScreen::OnDisplayLayoutEditor);
displayEditor_->SetDisabledPtr(&g_Config.bStretchToDisplay);
if (pixel_xres < pixel_yres * 1.3) // Smaller than 4:3
graphicsSettings->Add(new CheckBox(&g_Config.bPartialStretch, gr->T("Partial Vertical Stretch")));
@ -774,6 +779,11 @@ UI::EventReturn GameSettingsScreen::OnFullscreenChange(UI::EventParams &e) {
return UI::EVENT_DONE;
}
UI::EventReturn GameSettingsScreen::OnDisplayLayoutEditor(UI::EventParams &e) {
screenManager()->push(new DisplayLayoutScreen()); //TouchControlLayoutScreen());//
return UI::EVENT_DONE;
};
UI::EventReturn GameSettingsScreen::OnResolutionChange(UI::EventParams &e) {
if (gpu) {
gpu->Resized();