From 84f1165776740262a48c6201aa53281b80e22809 Mon Sep 17 00:00:00 2001 From: Matthew Kilgore Date: Sun, 4 Sep 2022 14:47:40 -0400 Subject: [PATCH 1/4] Fix _MOUSEMOVE when window is resized `sub__mousemove` is trying to use `x_scale`, `y_scale`, `x_offset`, and `y_offset` to calculate where the mouse should be in the event the window coordinates are different from the screen coordinates. Unfortunately, all four of those variables are actually never set in the program. The real scale values and offsets (in the event of letterboxing) are stored in `environment_2d__` values. This change switches `sub__mousemove` to simply use the correct values when calculating the mouse position. Because `x_scale` and `y_scale` are not used anywhere else I just removed them completely. I wanted to remove `x_offset` and `y_offset` as well but there are a few spots that make use of it. It must be a bug, since they are never assigned values other than zero, but I'm not sure if the correct fix for the other locations is to use the `environment_2d__` value or do nothing, so I'm leaving them for now and we can address them later. --- internal/c/libqb.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/c/libqb.cpp b/internal/c/libqb.cpp index 761d05f73..0aeb8dfcc 100644 --- a/internal/c/libqb.cpp +++ b/internal/c/libqb.cpp @@ -6605,7 +6605,6 @@ int32 selectfont(int32 f, img_struct *im) { int32 nmodes = 0; int32 anymode = 0; -float x_scale = 1, y_scale = 1; int32 x_offset = 0, y_offset = 0; int32 x_limit = 0, y_limit = 0; @@ -23959,17 +23958,20 @@ void sub__mousemove(float x, float y) { if (y2 > sy - 1) goto error; } + // x2,y2 are pixel co-ordinates // adjust for fullscreen position as necessary: - x2 *= x_scale; - y2 *= y_scale; - x2 += x_offset; - y2 += y_offset; + x2 *= environment_2d__screen_x_scale; + y2 *= environment_2d__screen_y_scale; + x2 += environment_2d__screen_x1; + y2 += environment_2d__screen_y1; + while (!window_exists) { Sleep(100); } glutWarpPointer(x2, y2); return; + error: error(5); #endif From 443838485eee00a2260c8608dd08255b13834900 Mon Sep 17 00:00:00 2001 From: Matthew Kilgore Date: Sun, 11 Sep 2022 11:50:16 -0400 Subject: [PATCH 2/4] Version 3.2.0 --- source/global/version.bas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/global/version.bas b/source/global/version.bas index 93c1c23e3..bd865c258 100644 --- a/source/global/version.bas +++ b/source/global/version.bas @@ -1,9 +1,9 @@ DIM SHARED Version AS STRING DIM SHARED IsCiVersion AS _BYTE -Version$ = "3.1.0" -$VERSIONINFO:FileVersion#=3,1,0,0 -$VERSIONINFO:ProductVersion#=3,1,0,0 +Version$ = "3.2.0" +$VERSIONINFO:FileVersion#=3,2,0,0 +$VERSIONINFO:ProductVersion#=3,2,0,0 ' If ./internal/version.txt exist, then this is some kind of CI build with a label If _FILEEXISTS("internal/version.txt") THEN From 4c8dbec69c1cbbeca75b2ea914d09dde32696a19 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 11 Sep 2022 17:00:19 +0000 Subject: [PATCH 3/4] Automatic update of ./internal/source --- internal/source/icon.rc | 8 ++++---- internal/source/main.txt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/source/icon.rc b/internal/source/icon.rc index 303bbf67a..b986f7e3f 100644 --- a/internal/source/icon.rc +++ b/internal/source/icon.rc @@ -5,8 +5,8 @@ CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "qb64pe.manifest" 1 VERSIONINFO -FILEVERSION 3,1,0,0 -PRODUCTVERSION 3,1,0,0 +FILEVERSION 3,2,0,0 +PRODUCTVERSION 3,2,0,0 BEGIN BLOCK "StringFileInfo" BEGIN @@ -14,13 +14,13 @@ BEGIN BEGIN VALUE "CompanyName","QB64 Phoenix Edition\0" VALUE "FileDescription","QB64 IDE and Compiler\0" - VALUE "FileVersion","3,1,0,0\0" + VALUE "FileVersion","3,2,0,0\0" VALUE "InternalName","qb64pe.bas\0" VALUE "LegalCopyright","MIT\0" VALUE "LegalTrademarks","\0" VALUE "OriginalFilename","qb64pe.exe\0" VALUE "ProductName","QB64-PE\0" - VALUE "ProductVersion","3,1,0,0\0" + VALUE "ProductVersion","3,2,0,0\0" VALUE "Comments","QB64 is a modern extended BASIC programming language that retains QB4.5/QBasic compatibility and compiles native binaries for Windows, Linux and macOS.\0" VALUE "Web","\0" END diff --git a/internal/source/main.txt b/internal/source/main.txt index 9d6e386b9..3b5bfd60f 100644 --- a/internal/source/main.txt +++ b/internal/source/main.txt @@ -7,7 +7,7 @@ if(!qbevent)break;evnt(24,1,"version.bas");}while(r); do{ if(!qbevent)break;evnt(24,2,"version.bas");}while(r); do{ -qbs_set(__STRING_VERSION,qbs_new_txt_len("3.1.0",5)); +qbs_set(__STRING_VERSION,qbs_new_txt_len("3.2.0",5)); qbs_cleanup(qbs_tmp_base,0); if(!qbevent)break;evnt(24,4,"version.bas");}while(r); S_4:; From bd5e08e0a556f77a06dc59f807b4c497c3edf8d4 Mon Sep 17 00:00:00 2001 From: Zachary Spriggs Date: Tue, 13 Sep 2022 17:31:02 -0400 Subject: [PATCH 4/4] Fix errorlevel check Since errorlevel wasn't enclosed in percents, it wasn't catching the 64 bit choice. Added percents around it and now it is allowing a 64 bit choice. --- setup_win.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_win.bat b/setup_win.bat index bfceebb03..cb31d5d2c 100644 --- a/setup_win.bat +++ b/setup_win.bat @@ -15,7 +15,7 @@ goto downloadfinished :download64choice choice /C 12 /M "Do you prefer to download 1)32-bit QB64-PE or 2)64-bit QB64-PE" -if errorlevel == 1 goto download32 +if %errorlevel% == 1 goto download32 set MINGW=mingw64.exe :downloadfinished