]> Shamusworld >> Repos - virtualjaguar/commitdiff
Fix for bad window position when coming out of full screen
authorShamus Hammons <jlhamm@acm.org>
Sat, 13 Oct 2012 21:45:47 +0000 (16:45 -0500)
committerShamus Hammons <jlhamm@acm.org>
Sat, 13 Oct 2012 21:45:47 +0000 (16:45 -0500)
src/gui/mainwin.cpp
src/gui/mainwin.h
src/jaguar.h
src/tom.cpp
src/tom.h

index cfd3ab9b1a1c90120c9a653a6d5b2542d5e735b5..ec3961cf84dd5ac0f262a3be14561a309cb9880f 100644 (file)
@@ -809,8 +809,18 @@ void MainWin::FrameAdvance(void)
 
 void MainWin::SetFullScreen(bool state/*= true*/)
 {
+#if 0
+       QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint();
+       QSize size = settings.value("size", QSize(400, 400)).toSize();
+       resize(size);
+       move(pos);
+       settings.setValue("pos", pos());
+       settings.setValue("size", size());
+#endif
        if (state)
        {
+               mainWinPosition = pos();
+//             mainWinSize = size();
                menuBar()->hide();
                statusBar()->hide();
                showFullScreen();
@@ -832,6 +842,7 @@ void MainWin::SetFullScreen(bool state/*= true*/)
                statusBar()->show();
                showNormal();
                ResizeMainWindow();
+               move(mainWinPosition);
        }
 
        // For some reason, this doesn't work: If the emu is paused, toggling from
@@ -882,11 +893,11 @@ void MainWin::ResizeMainWindow(void)
 void MainWin::ReadSettings(void)
 {
        QSettings settings("Underground Software", "Virtual Jaguar");
-       QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint();
+       mainWinPosition = settings.value("pos", QPoint(200, 200)).toPoint();
        QSize size = settings.value("size", QSize(400, 400)).toSize();
        resize(size);
-       move(pos);
-       pos = settings.value("cartLoadPos", QPoint(200, 200)).toPoint();
+       move(mainWinPosition);
+       QPoint pos = settings.value("cartLoadPos", QPoint(200, 200)).toPoint();
        filePickWin->move(pos);
 
        zoomLevel = settings.value("zoom", 2).toInt();
index 8d51e190ffa68d9b1ce9b3ee5f5c8d3cae2a9f56..fe88892d21b69147c76180f45b540a49387f1a81 100644 (file)
@@ -90,6 +90,8 @@ class MainWin: public QMainWindow
        public:
                bool plzDontKillMyComputer;
        private:
+               QPoint mainWinPosition;
+//             QSize mainWinSize;
                QMenu * fileMenu;
                QMenu * helpMenu;
                QMenu * debugMenu;
index c0cc1b36db605923398b891f87a8bd4bc60e99c9..8cd1988f4da0c3143db8703cc65e8e736bd0ed64 100644 (file)
@@ -20,8 +20,6 @@ void JaguarWriteLong(uint32 offset, uint32 data, uint32 who = UNKNOWN);
 bool JaguarInterruptHandlerIsValid(uint32 i);
 void JaguarDasm(uint32 offset, uint32 qt);
 
-void JaguarExecute(uint32 * backbuffer, bool render);
-//For testing the new system...
 void JaguarExecuteNew(void);
 
 // Exports from JAGUAR.CPP
@@ -43,14 +41,6 @@ extern bool jaguarCartInserted;
 #define ASSERT_LINE            1
 #define CLEAR_LINE             0
 
-// Video stuff (should go in tom.h?)
-
-// NB: This virtual width is for PWIDTH = 4
-//#define VIRTUAL_SCREEN_WIDTH            320
-#define VIRTUAL_SCREEN_WIDTH            340
-#define VIRTUAL_SCREEN_HEIGHT_NTSC      240
-#define VIRTUAL_SCREEN_HEIGHT_PAL       256
-
 //Temp debug stuff (will go away soon, so don't depend on these)
 
 void DumpMainMemory(void);
index c9d0f3f04b1574784217a5fef3c0cb30ad08ffe1..96f6ce99a044472610578e66c90b0a02ce586035 100644 (file)
 //#define RIGHT_VISIBLE_HC             (1488 - 32)
 // Split the difference? (Seems to be OK for the most part...)
 
-// (-8 +8)*4 is for opening up the display by 16 pixels (may go to 20). Need to change VIRTUAL_SCREEN_WIDTH to match this as well (went from 320 to 336; this is 4 HCs per one of those pixels). <-- actually, not true. This is only place referenced.
+// (-10 +10)*4 is for opening up the display by 16 pixels (may go to 20). Need to change VIRTUAL_SCREEN_WIDTH to match this as well (went from 320 to 340; this is 4 HCs per one of those pixels).
 #define LEFT_VISIBLE_HC                        (208 - 16 - (10 * 4))
 //#define RIGHT_VISIBLE_HC             (1488 - 16 + (10 * 4))
 #define RIGHT_VISIBLE_HC               (LEFT_VISIBLE_HC + (VIRTUAL_SCREEN_WIDTH * 4))
index 0fb1f2e5e234682788c3044b5072457a1c158103..8b95a75aaab3f04f84ef9e7948b8e557ebf7d085 100644 (file)
--- a/src/tom.h
+++ b/src/tom.h
 #define VIDEO_MODE_16BPP_DIRECT 2
 #define VIDEO_MODE_16BPP_RGB   3
 
+// Virtual screen size stuff
+
+// NB: This virtual width is for PWIDTH = 4
+//#define VIRTUAL_SCREEN_WIDTH            320
+#define VIRTUAL_SCREEN_WIDTH            340
+#define VIRTUAL_SCREEN_HEIGHT_NTSC      240
+#define VIRTUAL_SCREEN_HEIGHT_PAL       256
+
 // 68000 Interrupt bit positions (enabled at $F000E0)
 
 enum { IRQ_VIDEO = 0, IRQ_GPU, IRQ_OPFLAG, IRQ_TIMER, IRQ_DSP };