From 14b9794c260de5cf695e34052f9ffb686d6caf27 Mon Sep 17 00:00:00 2001 From: Sacha Date: Wed, 13 Feb 2013 04:54:47 +1000 Subject: [PATCH 1/2] Move PPSSPP window init out of here because native is meant to be generic. --- base/QtMain.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/base/QtMain.cpp b/base/QtMain.cpp index c9a74a3e40..eeb61dd059 100644 --- a/base/QtMain.cpp +++ b/base/QtMain.cpp @@ -13,9 +13,6 @@ #ifdef __SYMBIAN32__ #include #endif -#if defined(Q_WS_X11) && !defined(USING_GLES2) -#include "mainwindow.h" -#endif #include "QtMain.h" void LaunchBrowser(const char *url) @@ -81,10 +78,7 @@ int main(int argc, char *argv[]) NativeInit(argc, (const char **)argv, "./", "/tmp", "BADCOFFEE"); #endif -#if defined(Q_WS_X11) && !defined(USING_GLES2) - MainWindow mainWindow; - mainWindow.show(); -#else +#if !defined(Q_WS_X11) || defined(USING_GLES2) MainUI w(dpi_scale); w.resize(pixel_xres, pixel_yres); #ifdef USING_GLES2 From 0bb312c92a6561b9d929f09257e27eee1f1e29a0 Mon Sep 17 00:00:00 2001 From: Sacha Date: Wed, 13 Feb 2013 05:11:56 +1000 Subject: [PATCH 2/2] Now that only mobile platforms use this code path, remove the desktop support --- base/QtMain.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/base/QtMain.cpp b/base/QtMain.cpp index eeb61dd059..c2aca1cad5 100644 --- a/base/QtMain.cpp +++ b/base/QtMain.cpp @@ -57,16 +57,11 @@ int main(int argc, char *argv[]) QT_TRAP_THROWING(dynamic_cast(CEikonEnv::Static()->AppUi())->SetOrientationL(CAknAppUi::EAppUiOrientationLandscape)); #endif QSize res = QApplication::desktop()->screenGeometry().size(); -#ifdef USING_GLES2 if (res.width() < res.height()) res.transpose(); pixel_xres = res.width(); pixel_yres = res.height(); -#else - // Set resolution to half of the monitor on desktop systems - pixel_xres = res.width() / 2; - pixel_yres = res.height() / 2; -#endif + float dpi_scale = CalculateDPIScale(); dp_xres = (int)(pixel_xres * dpi_scale); dp_yres = (int)(pixel_yres * dpi_scale); net::Init(); @@ -78,14 +73,10 @@ int main(int argc, char *argv[]) NativeInit(argc, (const char **)argv, "./", "/tmp", "BADCOFFEE"); #endif -#if !defined(Q_WS_X11) || defined(USING_GLES2) +#if defined(USING_GLES2) MainUI w(dpi_scale); w.resize(pixel_xres, pixel_yres); -#ifdef USING_GLES2 w.showFullScreen(); -#else - w.show(); -#endif #endif MainAudio *audio = new MainAudio();