mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-23 16:19:44 +00:00
Integrate stretching options into display layout editor.
This commit is contained in:
parent
0c2efa6d44
commit
e4271fe1bc
@ -384,14 +384,6 @@ static int DefaultInternalResolution() {
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool DefaultPartialStretch() {
|
||||
#ifdef BLACKBERRY
|
||||
return pixel_xres < 1.3 * pixel_yres;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool DefaultTimerHack() {
|
||||
// Has been in use on Symbian since v0.7. Preferred option.
|
||||
#ifdef __SYMBIAN32__
|
||||
@ -465,9 +457,7 @@ static ConfigSetting graphicsSettings[] = {
|
||||
#endif
|
||||
|
||||
// TODO: Replace these settings with a list of options
|
||||
ConfigSetting("PartialStretch", &g_Config.bPartialStretch, &DefaultPartialStretch, true, true),
|
||||
ConfigSetting("StretchToDisplay", &g_Config.bStretchToDisplay, false, true, true),
|
||||
ConfigSetting("SmallDisplayZoom", &g_Config.iSmallDisplayZoom, 0, true, true),
|
||||
ConfigSetting("SmallDisplayZoom", &g_Config.iSmallDisplayZoom, 2, true, true),
|
||||
ConfigSetting("SmallDisplayOffsetX", &g_Config.fSmallDisplayOffsetX, 0.5f, true, true),
|
||||
ConfigSetting("SmallDisplayOffsetY", &g_Config.fSmallDisplayOffsetY, 0.5f, true, true),
|
||||
ConfigSetting("SmallDisplayCustomZoom", &g_Config.fSmallDisplayCustomZoom, 8.0f, true, true),
|
||||
|
@ -144,9 +144,7 @@ public:
|
||||
int iRenderingMode; // 0 = non-buffered rendering 1 = buffered rendering 2 = Read Framebuffer to memory (CPU) 3 = Read Framebuffer to memory (GPU)
|
||||
int iTexFiltering; // 1 = off , 2 = nearest , 3 = linear , 4 = linear(CG)
|
||||
int iBufFilter; // 1 = linear, 2 = nearest
|
||||
bool bPartialStretch;
|
||||
bool bStretchToDisplay;
|
||||
int iSmallDisplayZoom; // Used to fit display into screen 0 = auto, anything higher is used to set's integer zoom of psp resolution and allows manual editing
|
||||
int iSmallDisplayZoom; // Used to fit display into screen 0 = stretch, 1 = partial stretch, 2 = auto, anything higher is used to set's integer zoom of psp resolution and allows manual editing
|
||||
float fSmallDisplayOffsetX; // Along with Y it goes from 0.0 to 1.0, XY (0.5, 0.5) = center of the screen
|
||||
float fSmallDisplayOffsetY;
|
||||
float fSmallDisplayCustomZoom; //This is actually used for zoom, both in and out.
|
||||
|
@ -36,11 +36,11 @@ void CenterDisplayOutputRect(float *x, float *y, float *w, float *h, float origW
|
||||
|
||||
bool rotated = rotation == ROTATION_LOCKED_VERTICAL || rotation == ROTATION_LOCKED_VERTICAL180;
|
||||
|
||||
if (g_Config.bStretchToDisplay) {
|
||||
if (g_Config.iSmallDisplayZoom == 0) {
|
||||
outW = frameW;
|
||||
outH = frameH;
|
||||
} else {
|
||||
if (g_Config.iSmallDisplayZoom != 0) {
|
||||
if (g_Config.iSmallDisplayZoom > 2) {
|
||||
float offsetX = (g_Config.fSmallDisplayOffsetX - 0.5f) * 2.0f * frameW;
|
||||
float offsetY = (g_Config.fSmallDisplayOffsetY - 0.5f) * 2.0f * frameH;
|
||||
// Have to invert Y for GL
|
||||
@ -83,12 +83,14 @@ void CenterDisplayOutputRect(float *x, float *y, float *w, float *h, float origW
|
||||
outW = frameW;
|
||||
outH = frameW / origRatio;
|
||||
// Stretch a little bit
|
||||
if (!rotated && g_Config.bPartialStretch)
|
||||
if (!rotated && g_Config.iSmallDisplayZoom == 1)
|
||||
outH = (frameH + outH) / 2.0f; // (408 + 720) / 2 = 564
|
||||
} else {
|
||||
// Image is taller than frame. Center horizontally.
|
||||
outW = frameH * origRatio;
|
||||
outH = frameH;
|
||||
if (rotated && g_Config.iSmallDisplayZoom == 1)
|
||||
outW = (frameH + outH) / 2.0f; // (408 + 720) / 2 = 564
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,6 +89,20 @@ void MainWindow::updateMenus()
|
||||
}
|
||||
}
|
||||
|
||||
foreach(QAction * action, displayLayoutGroup->actions()) {
|
||||
if (g_Config.iSmallDisplayZoom == action->data().toInt()) {
|
||||
if (g_Config.iSmallDisplayZoom > 2) {
|
||||
g_Config.fSmallDisplayCustomZoom = (float)((g_Config.iSmallDisplayZoom - 2) * 8);
|
||||
}
|
||||
|
||||
if (gpu)
|
||||
gpu->Resized();
|
||||
|
||||
action->setChecked(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int defaultLevel = LogManager::GetInstance()->GetLogLevel(LogTypes::COMMON);
|
||||
foreach(QAction * action, defaultLogGroup->actions()) {
|
||||
if (defaultLevel == action->data().toInt()) {
|
||||
@ -334,13 +348,6 @@ void MainWindow::memviewTexAct()
|
||||
memoryTexWindow->show();
|
||||
}
|
||||
|
||||
void MainWindow::stretchAct()
|
||||
{
|
||||
g_Config.bStretchToDisplay = !g_Config.bStretchToDisplay;
|
||||
if (gpu)
|
||||
gpu->Resized();
|
||||
}
|
||||
|
||||
void MainWindow::raiseTopMost()
|
||||
{
|
||||
|
||||
@ -539,8 +546,10 @@ void MainWindow::createMenus()
|
||||
QList<int>() << 1 << 2 << 3 << 4,
|
||||
QList<int>() << Qt::CTRL + Qt::Key_1 << Qt::CTRL + Qt::Key_2 << Qt::CTRL + Qt::Key_3 << Qt::CTRL + Qt::Key_4);
|
||||
|
||||
videoMenu->add(new MenuAction(this, SLOT(stretchAct()), QT_TR_NOOP("&Stretch to Display")))
|
||||
->addEventChecked(&g_Config.bStretchToDisplay);
|
||||
MenuTree* displayLayoutMenu = new MenuTree(this, videoMenu, QT_TR_NOOP("&Display Layout Options"));
|
||||
displayLayoutGroup = new MenuActionGroup(this, displayLayoutMenu, SLOT(displayLayoutGroup_triggered(QAction *)),
|
||||
QStringList() << "Stretched" << "Partialy stretched" << "Auto Scaling" << "1x" << "2x" << "3x" << "4x" << "5x" << "6x" << "7x" << "8x" << "9x" << "10x",
|
||||
QList<int>() << 0 << 1 << 2 << 3 << 4 << 5 << 6 << 7 << 8 << 9 << 10 << 11 << 12);
|
||||
videoMenu->addSeparator();
|
||||
videoMenu->add(new MenuAction(this, SLOT(transformAct()), QT_TR_NOOP("&Hardware Transform"), Qt::Key_F6))
|
||||
->addEventChecked(&g_Config.bHardwareTransform);
|
||||
|
@ -100,7 +100,7 @@ private slots:
|
||||
|
||||
void screenGroup_triggered(QAction *action) { SetZoom(action->data().toInt()); }
|
||||
|
||||
void stretchAct();
|
||||
void displayLayoutGroup_triggered(QAction *action) { g_Config.iSmallDisplayZoom = action->data().toInt(); }
|
||||
void transformAct() { g_Config.bHardwareTransform = !g_Config.bHardwareTransform; }
|
||||
void vertexCacheAct() { g_Config.bVertexCache = !g_Config.bVertexCache; }
|
||||
void frameskipAct() { g_Config.iFrameSkip = !g_Config.iFrameSkip; }
|
||||
@ -154,7 +154,7 @@ private:
|
||||
Debugger_MemoryTex *memoryTexWindow;
|
||||
Debugger_DisplayList *displaylistWindow;
|
||||
|
||||
QActionGroup *anisotropicGroup, *screenGroup,
|
||||
QActionGroup *anisotropicGroup, *screenGroup, *displayLayoutGroup,
|
||||
*defaultLogGroup, *g3dLogGroup, *hleLogGroup;
|
||||
};
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "gfx_es2/draw_buffer.h"
|
||||
#include "i18n/i18n.h"
|
||||
#include "ui/ui_context.h"
|
||||
#include "ui/view.h"
|
||||
#include "ui_atlas.h"
|
||||
|
||||
#include "DisplayLayoutScreen.h"
|
||||
@ -70,7 +71,7 @@ bool DisplayLayoutScreen::touch(const TouchInput &touch) {
|
||||
using namespace UI;
|
||||
|
||||
int mode = mode_->GetSelection();
|
||||
if (g_Config.iSmallDisplayZoom == 0) { mode = -1; }
|
||||
if (g_Config.iSmallDisplayZoom == 2) { mode = -1; }
|
||||
|
||||
const Bounds &screen_bounds = screenManager()->getUIContext()->GetBounds();
|
||||
|
||||
@ -140,8 +141,8 @@ UI::EventReturn DisplayLayoutScreen::OnCenter(UI::EventParams &e) {
|
||||
};
|
||||
|
||||
UI::EventReturn DisplayLayoutScreen::OnZoomChange(UI::EventParams &e) {
|
||||
if (g_Config.iSmallDisplayZoom > 0) {
|
||||
g_Config.fSmallDisplayCustomZoom = (float)(g_Config.iSmallDisplayZoom * 8);
|
||||
if (g_Config.iSmallDisplayZoom > 2) {
|
||||
g_Config.fSmallDisplayCustomZoom = (float)((g_Config.iSmallDisplayZoom - 2) * 8);
|
||||
} else {
|
||||
const Bounds &bounds = screenManager()->getUIContext()->GetBounds();
|
||||
float autoBound = bounds.w / 480.0f * 8.0f;
|
||||
@ -158,10 +159,6 @@ void DisplayLayoutScreen::dialogFinished(const Screen *dialog, DialogResult resu
|
||||
}
|
||||
|
||||
void DisplayLayoutScreen::CreateViews() {
|
||||
if (g_Config.bStretchToDisplay) {
|
||||
// Shouldn't even be able to get here as the way into this dialog should be closed.
|
||||
return;
|
||||
}
|
||||
const Bounds &bounds = screenManager()->getUIContext()->GetBounds();
|
||||
|
||||
local_dp_xres = bounds.w;
|
||||
@ -171,6 +168,7 @@ void DisplayLayoutScreen::CreateViews() {
|
||||
|
||||
I18NCategory *di = GetI18NCategory("Dialog");
|
||||
I18NCategory *gr = GetI18NCategory("Graphics");
|
||||
I18NCategory *cw = GetI18NCategory("CwCheats");
|
||||
|
||||
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
|
||||
@ -193,55 +191,83 @@ void DisplayLayoutScreen::CreateViews() {
|
||||
horizontalBoundaryR->AddTab("", bottomBoundary);
|
||||
|
||||
Choice *back = new Choice(di->T("Back"), "", false, new AnchorLayoutParams(leftColumnWidth, WRAP_CONTENT, 10, NONE, NONE, 10));
|
||||
static const char *zoomLevels[] = { "Auto", "1x", "2x", "3x", "4x", "5x", "6x", "7x", "8x", "9x", "10x" };
|
||||
zoom_ = new PopupMultiChoice(&g_Config.iSmallDisplayZoom, gr->T("Zoom settings"), zoomLevels, 0, ARRAY_SIZE(zoomLevels), gr->GetName(), screenManager(), new AnchorLayoutParams(300, WRAP_CONTENT, local_dp_xres / 2 - 150, NONE, NONE, 10));
|
||||
static const char *zoomLevels[] = { "Full Stretch", "Partial Stretch", "Auto Scaling", "1x", "2x", "3x", "4x", "5x", "6x", "7x", "8x", "9x", "10x" };
|
||||
zoom_ = new PopupMultiChoice(&g_Config.iSmallDisplayZoom, cw->T("Options"), zoomLevels, 0, ARRAY_SIZE(zoomLevels), gr->GetName(), screenManager(), new AnchorLayoutParams(400, WRAP_CONTENT, local_dp_xres / 2 - 200, NONE, NONE, 10));
|
||||
zoom_->OnChoice.Handle(this, &DisplayLayoutScreen::OnZoomChange);
|
||||
|
||||
static const char *displayRotation[] = { "Landscape", "Portrait", "Landscape Reversed", "Portrait Reversed" };
|
||||
rotation_ = new PopupMultiChoice(&g_Config.iInternalScreenRotation, gr->T("Rotation"), displayRotation, 1, ARRAY_SIZE(displayRotation), gr->GetName(), screenManager(), new AnchorLayoutParams(400, WRAP_CONTENT, local_dp_xres / 2 - 200, NONE, NONE, local_dp_yres - 64));
|
||||
rotation_->SetEnabledPtr(&displayRotEnable_);
|
||||
displayRotEnable_ = (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE);
|
||||
|
||||
bool bRotated = false;
|
||||
if (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE && (g_Config.iInternalScreenRotation == ROTATION_LOCKED_VERTICAL || g_Config.iInternalScreenRotation == ROTATION_LOCKED_VERTICAL180)) { bRotated = true; }
|
||||
mode_ = new ChoiceStrip(ORIENT_VERTICAL, new AnchorLayoutParams(leftColumnWidth, WRAP_CONTENT, 10, NONE, NONE, 158 + 64 + 10));
|
||||
if (g_Config.iSmallDisplayZoom == 0) {
|
||||
mode_->AddChoice(gr->T("Active (Auto)"));
|
||||
float autoBound = local_dp_yres / 270.0f * 8.0f;
|
||||
// Case of screen rotated ~ only works with buffered rendering
|
||||
if (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE && (g_Config.iInternalScreenRotation == ROTATION_LOCKED_VERTICAL || g_Config.iInternalScreenRotation == ROTATION_LOCKED_VERTICAL180)) {
|
||||
autoBound = local_dp_yres / 480.0f * 8.0f;
|
||||
} else { // Without rotation in common cases like 1080p we cut off 2 pixels of height, this reflects other cases
|
||||
float resCommonWidescreen = autoBound - floor(autoBound);
|
||||
if (resCommonWidescreen != 0.0f) {
|
||||
float ratio = local_dp_xres / local_dp_yres;
|
||||
if (ratio < orgRatio) {
|
||||
autoBound = local_dp_xres / 480.0f * 8.0f;
|
||||
} else {
|
||||
autoBound = local_dp_yres / 272.0f * 8.0f;
|
||||
if (g_Config.iSmallDisplayZoom > 1) {
|
||||
if (g_Config.iSmallDisplayZoom == 2) {
|
||||
mode_->AddChoice(gr->T("Auto Scaling"));
|
||||
mode_->ReplaceLayoutParams(new AnchorLayoutParams(0, 0, local_dp_xres / 2.0f - 70.0f, NONE, NONE, local_dp_yres / 2.0f + 32.0f));
|
||||
float autoBound = local_dp_yres / 270.0f * 8.0f;
|
||||
// Case of screen rotated ~ only works with buffered rendering
|
||||
if (bRotated) {
|
||||
autoBound = local_dp_yres / 480.0f * 8.0f;
|
||||
}
|
||||
else { // Without rotation in common cases like 1080p we cut off 2 pixels of height, this reflects other cases
|
||||
float resCommonWidescreen = autoBound - floor(autoBound);
|
||||
if (resCommonWidescreen != 0.0f) {
|
||||
float ratio = local_dp_xres / local_dp_yres;
|
||||
if (ratio < orgRatio) {
|
||||
autoBound = local_dp_xres / 480.0f * 8.0f;
|
||||
}
|
||||
else {
|
||||
autoBound = local_dp_yres / 272.0f * 8.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
g_Config.fSmallDisplayCustomZoom = autoBound;
|
||||
g_Config.fSmallDisplayOffsetX = 0.5f;
|
||||
g_Config.fSmallDisplayOffsetY = 0.5f;
|
||||
} else {
|
||||
Choice *center = new Choice(di->T("Center"), "", false, new AnchorLayoutParams(leftColumnWidth, WRAP_CONTENT, 10, NONE, NONE, 74));
|
||||
center->OnClick.Handle(this, &DisplayLayoutScreen::OnCenter);
|
||||
root_->Add(center);
|
||||
mode_->AddChoice(di->T("Move"));
|
||||
mode_->AddChoice(di->T("Resize"));
|
||||
mode_->SetSelection(0);
|
||||
}
|
||||
g_Config.fSmallDisplayCustomZoom = autoBound;
|
||||
g_Config.fSmallDisplayOffsetX = 0.5f;
|
||||
g_Config.fSmallDisplayOffsetY = 0.5f;
|
||||
displayRepresentation_ = new DragDropDisplay(g_Config.fSmallDisplayOffsetX, g_Config.fSmallDisplayOffsetY, I_PSP_DISPLAY, g_Config.fSmallDisplayCustomZoom);
|
||||
displayRepresentation_->SetVisibility(V_VISIBLE);
|
||||
} else {
|
||||
Choice *center = new Choice(di->T("Center"), "", false, new AnchorLayoutParams(leftColumnWidth, WRAP_CONTENT, 10, NONE, NONE, 84));
|
||||
center->OnClick.Handle(this, &DisplayLayoutScreen::OnCenter);
|
||||
root_->Add(center);
|
||||
mode_->AddChoice(di->T("Move"));
|
||||
mode_->AddChoice(di->T("Resize"));
|
||||
mode_->SetSelection(0);
|
||||
mode_->AddChoice(gr->T("Stretching"));
|
||||
mode_->ReplaceLayoutParams(new AnchorLayoutParams(0, 0, local_dp_xres / 2.0f - 70.0f, NONE, NONE, local_dp_yres / 2.0f + 32.0f));
|
||||
displayRepresentation_ = new DragDropDisplay(g_Config.fSmallDisplayOffsetX, g_Config.fSmallDisplayOffsetY, I_PSP_DISPLAY, g_Config.fSmallDisplayCustomZoom);
|
||||
displayRepresentation_->SetVisibility(V_INVISIBLE);
|
||||
float width = local_dp_xres / 2.0f;
|
||||
float height = local_dp_yres / 2.0f;
|
||||
if (g_Config.iSmallDisplayZoom == 0) { // Stretched
|
||||
Choice *stretched = new Choice("", "", false, new AnchorLayoutParams(width, height, width - width / 2.0f, NONE, NONE, height - height / 2.0f));
|
||||
root_->Add(stretched);
|
||||
} else { // Partially stretched
|
||||
float origRatio = !bRotated ? 480.0f / 272.0f : 272.0f / 480.0f;
|
||||
float frameRatio = width / height;
|
||||
if (origRatio > frameRatio) {
|
||||
height = width / origRatio;
|
||||
if (!bRotated && g_Config.iSmallDisplayZoom == 1) { height = (272.0f + height) / 2.0f; }
|
||||
} else {
|
||||
width = height * origRatio;
|
||||
if (bRotated && g_Config.iSmallDisplayZoom == 1) { width = (272.0f + height) / 2.0f; }
|
||||
}
|
||||
Choice *stretched = new Choice("", "", false, new AnchorLayoutParams(width, height, local_dp_xres / 2.0f - width / 2.0f, NONE, NONE, local_dp_yres / 2.0f - height / 2.0f));
|
||||
root_->Add(stretched);
|
||||
}
|
||||
}
|
||||
if (bRotated) {
|
||||
displayRepresentation_->SetAngle(90.0f);
|
||||
}
|
||||
|
||||
|
||||
back->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
|
||||
root_->Add(displayRepresentation_);
|
||||
root_->Add(mode_);
|
||||
root_->Add(zoom_);
|
||||
root_->Add(rotation_);
|
||||
root_->Add(back);
|
||||
|
||||
displayRepresentation_ = new DragDropDisplay(g_Config.fSmallDisplayOffsetX, g_Config.fSmallDisplayOffsetY, I_PSP_DISPLAY, g_Config.fSmallDisplayCustomZoom);
|
||||
if (g_Config.iRenderingMode != FB_NON_BUFFERED_MODE && (g_Config.iInternalScreenRotation == ROTATION_LOCKED_VERTICAL || g_Config.iInternalScreenRotation == ROTATION_LOCKED_VERTICAL180)) {
|
||||
displayRepresentation_->SetAngle(90.0f);
|
||||
}
|
||||
root_->Add(displayRepresentation_);
|
||||
}
|
||||
|
@ -27,7 +27,6 @@ class DragDropDisplay;
|
||||
class DisplayLayoutScreen : public UIDialogScreenWithBackground {
|
||||
public:
|
||||
DisplayLayoutScreen();
|
||||
|
||||
virtual void CreateViews() override;
|
||||
virtual bool touch(const TouchInput &touch) override;
|
||||
virtual void dialogFinished(const Screen *dialog, DialogResult result) override;
|
||||
@ -36,7 +35,7 @@ public:
|
||||
protected:
|
||||
virtual UI::EventReturn OnCenter(UI::EventParams &e);
|
||||
virtual UI::EventReturn OnZoomChange(UI::EventParams &e);
|
||||
|
||||
|
||||
private:
|
||||
DragDropDisplay *picked_;
|
||||
DragDropDisplay *displayRepresentation_;
|
||||
|
@ -166,15 +166,9 @@ void GameSettingsScreen::CreateViews() {
|
||||
#if !defined(MOBILE_DEVICE)
|
||||
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")));
|
||||
|
||||
// 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")));
|
||||
|
||||
#ifdef ANDROID
|
||||
// Hide Immersive Mode on pre-kitkat Android
|
||||
|
@ -81,9 +81,10 @@ namespace MainWindow {
|
||||
SUBMENU_FILE_SAVESTATE_SLOT = 6,
|
||||
|
||||
// Emulation submenus
|
||||
SUBMENU_DISPLAY_ROTATION = 8,
|
||||
SUBMENU_DISPLAY_ROTATION = 5,
|
||||
|
||||
// Game Settings submenus
|
||||
SUBMENU_DISPLAY_LAYOUT = 7,
|
||||
SUBMENU_CUSTOM_SHADERS = 10,
|
||||
SUBMENU_RENDERING_RESOLUTION = 11,
|
||||
SUBMENU_WINDOW_SIZE = 12,
|
||||
@ -268,7 +269,11 @@ namespace MainWindow {
|
||||
TranslateMenuItem(menu, ID_OPTIONS_IGNOREWINKEY);
|
||||
TranslateMenuItem(menu, ID_OPTIONS_MORE_SETTINGS);
|
||||
TranslateMenuItem(menu, ID_OPTIONS_CONTROLS);
|
||||
TranslateMenuItem(menu, ID_OPTIONS_STRETCHDISPLAY);
|
||||
TranslateSubMenu(menu, "Display Layout Options", MENU_OPTIONS, SUBMENU_DISPLAY_LAYOUT);
|
||||
TranslateMenuItem(menu, ID_OPTIONS_STRETCH);
|
||||
TranslateMenuItem(menu, ID_OPTIONS_PARTIAL_STRETCH);
|
||||
TranslateMenuItem(menu, ID_OPTIONS_DISPLAY_AUTO);
|
||||
// Skip display multipliers x1-x10
|
||||
TranslateMenuItem(menu, ID_OPTIONS_FULLSCREEN, L"\tAlt+Return, F11");
|
||||
TranslateMenuItem(menu, ID_OPTIONS_VSYNC);
|
||||
TranslateSubMenu(menu, "Postprocessing Shader", MENU_OPTIONS, SUBMENU_CUSTOM_SHADERS);
|
||||
@ -481,6 +486,13 @@ namespace MainWindow {
|
||||
g_Config.bEnableCheats = cheats;
|
||||
}
|
||||
|
||||
static void setDisplayOptions(int options) {
|
||||
g_Config.iSmallDisplayZoom = options;
|
||||
if (g_Config.iSmallDisplayZoom > 2) {
|
||||
g_Config.fSmallDisplayCustomZoom = (float)((g_Config.iSmallDisplayZoom - 2) * 8);
|
||||
}
|
||||
NativeMessageReceived("gpu resized", "");
|
||||
}
|
||||
|
||||
void MainWindowMenu_Process(HWND hWnd, WPARAM wParam) {
|
||||
std::string fn;
|
||||
@ -711,10 +723,20 @@ namespace MainWindow {
|
||||
osm.ShowOnOff(gr->T("Hardware Transform"), g_Config.bHardwareTransform);
|
||||
break;
|
||||
|
||||
case ID_OPTIONS_STRETCHDISPLAY:
|
||||
g_Config.bStretchToDisplay = !g_Config.bStretchToDisplay;
|
||||
NativeMessageReceived("gpu resized", "");
|
||||
break;
|
||||
case ID_OPTIONS_STRETCH: setDisplayOptions(0); break;
|
||||
case ID_OPTIONS_PARTIAL_STRETCH: setDisplayOptions(1); break;
|
||||
case ID_OPTIONS_DISPLAY_AUTO: setDisplayOptions(2); break;
|
||||
case ID_OPTIONS_DISPLAY_1: setDisplayOptions(3); break;
|
||||
case ID_OPTIONS_DISPLAY_2: setDisplayOptions(4); break;
|
||||
case ID_OPTIONS_DISPLAY_3: setDisplayOptions(5); break;
|
||||
case ID_OPTIONS_DISPLAY_4: setDisplayOptions(6); break;
|
||||
case ID_OPTIONS_DISPLAY_5: setDisplayOptions(7); break;
|
||||
case ID_OPTIONS_DISPLAY_6: setDisplayOptions(8); break;
|
||||
case ID_OPTIONS_DISPLAY_7: setDisplayOptions(9); break;
|
||||
case ID_OPTIONS_DISPLAY_8: setDisplayOptions(10); break;
|
||||
case ID_OPTIONS_DISPLAY_9: setDisplayOptions(11); break;
|
||||
case ID_OPTIONS_DISPLAY_10: setDisplayOptions(12); break;
|
||||
|
||||
|
||||
case ID_OPTIONS_FRAMESKIP_0: setFrameSkipping(FRAMESKIP_OFF); break;
|
||||
case ID_OPTIONS_FRAMESKIP_1: setFrameSkipping(FRAMESKIP_1); break;
|
||||
@ -936,7 +958,6 @@ namespace MainWindow {
|
||||
CHECKITEM(ID_DEBUG_IGNOREILLEGALREADS, g_Config.bIgnoreBadMemAccess);
|
||||
CHECKITEM(ID_DEBUG_SHOWDEBUGSTATISTICS, g_Config.bShowDebugStats);
|
||||
CHECKITEM(ID_OPTIONS_HARDWARETRANSFORM, g_Config.bHardwareTransform);
|
||||
CHECKITEM(ID_OPTIONS_STRETCHDISPLAY, g_Config.bStretchToDisplay);
|
||||
CHECKITEM(ID_DEBUG_RUNONLOAD, g_Config.bAutoRun);
|
||||
CHECKITEM(ID_OPTIONS_VERTEXCACHE, g_Config.bVertexCache);
|
||||
CHECKITEM(ID_OPTIONS_SHOWFPS, g_Config.iShowFPSCounter);
|
||||
@ -966,6 +987,31 @@ namespace MainWindow {
|
||||
CheckMenuItem(menu, displayrotationitems[i], MF_BYCOMMAND | ((i + 1) == g_Config.iInternalScreenRotation ? MF_CHECKED : MF_UNCHECKED));
|
||||
}
|
||||
|
||||
static const int displaylayoutitems[] = {
|
||||
ID_OPTIONS_STRETCH,
|
||||
ID_OPTIONS_PARTIAL_STRETCH,
|
||||
ID_OPTIONS_DISPLAY_AUTO,
|
||||
ID_OPTIONS_DISPLAY_1,
|
||||
ID_OPTIONS_DISPLAY_2,
|
||||
ID_OPTIONS_DISPLAY_3,
|
||||
ID_OPTIONS_DISPLAY_4,
|
||||
ID_OPTIONS_DISPLAY_5,
|
||||
ID_OPTIONS_DISPLAY_6,
|
||||
ID_OPTIONS_DISPLAY_7,
|
||||
ID_OPTIONS_DISPLAY_8,
|
||||
ID_OPTIONS_DISPLAY_9,
|
||||
ID_OPTIONS_DISPLAY_10
|
||||
};
|
||||
if (g_Config.iSmallDisplayZoom < 0)
|
||||
g_Config.iSmallDisplayZoom = 0;
|
||||
|
||||
else if (g_Config.iSmallDisplayZoom > 12)
|
||||
g_Config.iSmallDisplayZoom = 12;
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(displaylayoutitems); i++) {
|
||||
CheckMenuItem(menu, displaylayoutitems[i], MF_BYCOMMAND | (i == g_Config.iSmallDisplayZoom ? MF_CHECKED : MF_UNCHECKED));
|
||||
}
|
||||
|
||||
// Disable Vertex Cache when HW T&L is disabled.
|
||||
if (!g_Config.bHardwareTransform) {
|
||||
EnableMenuItem(menu, ID_OPTIONS_VERTEXCACHE, MF_GRAYED);
|
||||
|
@ -451,7 +451,22 @@ BEGIN
|
||||
MENUITEM "Control Mapping...", ID_OPTIONS_CONTROLS
|
||||
MENUITEM "Language...", ID_OPTIONS_LANGUAGE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Stretch to Display", ID_OPTIONS_STRETCHDISPLAY
|
||||
POPUP "Display Layout Options"
|
||||
BEGIN
|
||||
MENUITEM "Full stretch", ID_OPTIONS_STRETCH
|
||||
MENUITEM "Partial stretch", ID_OPTIONS_PARTIAL_STRETCH
|
||||
MENUITEM "Auto scaling", ID_OPTIONS_DISPLAY_AUTO
|
||||
MENUITEM "1x", ID_OPTIONS_DISPLAY_1
|
||||
MENUITEM "2x", ID_OPTIONS_DISPLAY_2
|
||||
MENUITEM "3x", ID_OPTIONS_DISPLAY_3
|
||||
MENUITEM "4x", ID_OPTIONS_DISPLAY_4
|
||||
MENUITEM "5x", ID_OPTIONS_DISPLAY_5
|
||||
MENUITEM "6x", ID_OPTIONS_DISPLAY_6
|
||||
MENUITEM "7x", ID_OPTIONS_DISPLAY_7
|
||||
MENUITEM "8x", ID_OPTIONS_DISPLAY_8
|
||||
MENUITEM "9x", ID_OPTIONS_DISPLAY_9
|
||||
MENUITEM "10x", ID_OPTIONS_DISPLAY_10
|
||||
END
|
||||
MENUITEM "Fullscreen", ID_OPTIONS_FULLSCREEN
|
||||
MENUITEM "VSync", ID_OPTIONS_VSYNC
|
||||
MENUITEM "Postprocessing Shader", ID_OPTIONS_FXAA
|
||||
|
@ -208,7 +208,6 @@
|
||||
#define ID_DEBUG_DUMPNEXTFRAME 40040
|
||||
#define ID_OPTIONS_VERTEXCACHE 40041
|
||||
#define ID_OPTIONS_SHOWFPS 40042
|
||||
#define ID_OPTIONS_STRETCHDISPLAY 40043
|
||||
#define ID_OPTIONS_FRAMESKIP 40044
|
||||
#define IDC_MEMCHECK 40045
|
||||
#define ID_FILE_MEMSTICK 40046
|
||||
@ -323,6 +322,19 @@
|
||||
#define ID_EMULATION_ROTATION_V 40157
|
||||
#define ID_EMULATION_ROTATION_H_R 40158
|
||||
#define ID_EMULATION_ROTATION_V_R 40159
|
||||
#define ID_OPTIONS_STRETCH 40160
|
||||
#define ID_OPTIONS_PARTIAL_STRETCH 40161
|
||||
#define ID_OPTIONS_DISPLAY_AUTO 40162
|
||||
#define ID_OPTIONS_DISPLAY_1 40163
|
||||
#define ID_OPTIONS_DISPLAY_2 40164
|
||||
#define ID_OPTIONS_DISPLAY_3 40165
|
||||
#define ID_OPTIONS_DISPLAY_4 40166
|
||||
#define ID_OPTIONS_DISPLAY_5 40167
|
||||
#define ID_OPTIONS_DISPLAY_6 40168
|
||||
#define ID_OPTIONS_DISPLAY_7 40169
|
||||
#define ID_OPTIONS_DISPLAY_8 40170
|
||||
#define ID_OPTIONS_DISPLAY_9 40171
|
||||
#define ID_OPTIONS_DISPLAY_10 40172
|
||||
|
||||
// Dummy option to let the buffered rendering hotkey cycle through all the options.
|
||||
#define ID_OPTIONS_BUFFEREDRENDERINGDUMMY 40500
|
||||
|
Loading…
Reference in New Issue
Block a user