. Make 2x the default
  - But refuse double-sizing the window unless the screen is large enough.
This commit is contained in:
tomch 2013-03-07 23:23:26 +00:00
parent 8c98cf004e
commit a511e5c234
4 changed files with 36 additions and 14 deletions

View File

@ -21,6 +21,13 @@ Next release:
------------- -------------
TBC TBC
1.22.1 - 7 Mar 2013
--------------------
Changes:
. Make 2x the default
- But refuse double-sizing the window unless the screen is large enough.
1.22.0 - 1 Jan 2013 1.22.0 - 1 Jan 2013
-------------------- --------------------
Changes: Changes:

View File

@ -253,8 +253,8 @@ DISK_ICON ICON "DISK.ICO"
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,22,0,0 FILEVERSION 1,22,1,0
PRODUCTVERSION 1,22,0,0 PRODUCTVERSION 1,22,1,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -272,12 +272,12 @@ BEGIN
VALUE "Comments", "http://applewin.berlios.de" VALUE "Comments", "http://applewin.berlios.de"
VALUE "CompanyName", "AppleWin" VALUE "CompanyName", "AppleWin"
VALUE "FileDescription", "Apple //e Emulator for Windows" VALUE "FileDescription", "Apple //e Emulator for Windows"
VALUE "FileVersion", "1, 22, 0, 0" VALUE "FileVersion", "1, 22, 1, 0"
VALUE "InternalName", "APPLEWIN" VALUE "InternalName", "APPLEWIN"
VALUE "LegalCopyright", " 1994-2013 Michael O'Brien, Oliver Schmidt, Tom Charlesworth, Michael Pohoreski, Nick Westgate, Linards Ticmanis" VALUE "LegalCopyright", " 1994-2013 Michael O'Brien, Oliver Schmidt, Tom Charlesworth, Michael Pohoreski, Nick Westgate, Linards Ticmanis"
VALUE "OriginalFilename", "APPLEWIN.EXE" VALUE "OriginalFilename", "APPLEWIN.EXE"
VALUE "ProductName", "Apple //e Emulator" VALUE "ProductName", "Apple //e Emulator"
VALUE "ProductVersion", "1, 22, 0, 0" VALUE "ProductVersion", "1, 22, 1, 0"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View File

@ -43,10 +43,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define MAGICX 5 // 3D border between Apple window & Emulator's RHS buttons #define MAGICX 5 // 3D border between Apple window & Emulator's RHS buttons
#define MAGICY 5 // 3D border between Apple window & Title bar #define MAGICY 5 // 3D border between Apple window & Title bar
static int g_nViewportCX = FRAMEBUFFER_W; static const int kDEFAULT_VIEWPORT_SCALE = 2;
static int g_nViewportCY = FRAMEBUFFER_H; static int g_nViewportCX = FRAMEBUFFER_W * kDEFAULT_VIEWPORT_SCALE;
static int g_nViewportScale = 1; static int g_nViewportCY = FRAMEBUFFER_H * kDEFAULT_VIEWPORT_SCALE;
static int g_nOldViewportScale = 1; static int g_nViewportScale = kDEFAULT_VIEWPORT_SCALE;
static int g_nOldViewportScale = kDEFAULT_VIEWPORT_SCALE;
static int g_nMaxViewportScale = kDEFAULT_VIEWPORT_SCALE;
#define BUTTONX (g_nViewportCX + VIEWPORTX*2) #define BUTTONX (g_nViewportCX + VIEWPORTX*2)
#define BUTTONY 0 #define BUTTONY 0
@ -1856,11 +1858,16 @@ int GetViewportScale(void)
return g_nViewportScale; return g_nViewportScale;
} }
void SetViewportScale(int nNewScale) int SetViewportScale(int nNewScale)
{ {
if (nNewScale > g_nMaxViewportScale)
nNewScale = g_nMaxViewportScale;
g_nViewportScale = nNewScale; g_nViewportScale = nNewScale;
g_nViewportCX = g_nViewportScale * FRAMEBUFFER_W; g_nViewportCX = g_nViewportScale * FRAMEBUFFER_W;
g_nViewportCY = g_nViewportScale * FRAMEBUFFER_H; g_nViewportCY = g_nViewportScale * FRAMEBUFFER_H;
return nNewScale;
} }
static void SetupTooltipControls(void) static void SetupTooltipControls(void)
@ -1900,7 +1907,7 @@ static void FrameResizeWindow(int nNewScale)
int nOldWidth, nOldHeight; int nOldWidth, nOldHeight;
GetWidthHeight(nOldWidth, nOldHeight); GetWidthHeight(nOldWidth, nOldHeight);
SetViewportScale(nNewScale); nNewScale = SetViewportScale(nNewScale);
GetWindowRect(g_hFrameWindow, &framerect); GetWindowRect(g_hFrameWindow, &framerect);
int nXPos = framerect.left; int nXPos = framerect.left;
@ -1951,10 +1958,18 @@ void FrameCreateWindow(void)
int nWidth, nHeight; int nWidth, nHeight;
GetWidthHeight(nWidth, nHeight); GetWidthHeight(nWidth, nHeight);
// If screen is too small for 2x, then revert to 1x
if (g_nViewportScale == 2 && (nWidth > GetSystemMetrics(SM_CXSCREEN) || nHeight > GetSystemMetrics(SM_CYSCREEN)))
{
g_nMaxViewportScale = 1;
SetViewportScale(1);
GetWidthHeight(nWidth, nHeight);
}
// Restore Window X Position // Restore Window X Position
int nXPos = -1; int nXPos = -1;
{ {
int nXScreen = GetSystemMetrics(SM_CXSCREEN) - nWidth; const int nXScreen = GetSystemMetrics(SM_CXSCREEN) - nWidth;
if (RegLoadValue(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_WINDOW_X_POS), 1, (DWORD*)&nXPos)) if (RegLoadValue(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_WINDOW_X_POS), 1, (DWORD*)&nXPos))
{ {
@ -1969,7 +1984,7 @@ void FrameCreateWindow(void)
// Restore Window Y Position // Restore Window Y Position
int nYPos = -1; int nYPos = -1;
{ {
int nYScreen = GetSystemMetrics(SM_CYSCREEN) - nHeight; const int nYScreen = GetSystemMetrics(SM_CYSCREEN) - nHeight;
if (RegLoadValue(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_WINDOW_Y_POS), 1, (DWORD*)&nYPos)) if (RegLoadValue(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_WINDOW_Y_POS), 1, (DWORD*)&nYPos))
{ {
@ -1977,7 +1992,7 @@ void FrameCreateWindow(void)
nYPos = -1; // Not fully visible, so default to centre position nYPos = -1; // Not fully visible, so default to centre position
} }
if ((nYPos == -1) && g_bMultiMon) if ((nYPos == -1) && !g_bMultiMon)
nYPos = nYScreen / 2; nYPos = nYScreen / 2;
} }

View File

@ -43,7 +43,7 @@
void FrameReleaseVideoDC (); void FrameReleaseVideoDC ();
void FrameSetCursorPosByMousePos(); void FrameSetCursorPosByMousePos();
int GetViewportScale(void); int GetViewportScale(void);
void SetViewportScale(int nNewScale); int SetViewportScale(int nNewScale);
void GetViewportCXCY(int& nViewportCX, int& nViewportCY); void GetViewportCXCY(int& nViewportCX, int& nViewportCY);
LRESULT CALLBACK FrameWndProc ( LRESULT CALLBACK FrameWndProc (