1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-01 09:10:37 +00:00

Merge pull request #152 from SpriggsySpriggs/development [ci-skip]

Fix bug with DPI, _Width, and _Height (Windows) and bring back _ConsoleFont
This commit is contained in:
Fellippe Heitor 2021-03-24 01:28:06 -03:00 committed by GitHub
commit 5dfcc536d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18464,6 +18464,20 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
//Creating/destroying an image surface:
int32 func__newimage(int32 x,int32 y,int32 bpp,int32 passed){
#ifdef QB64_WINDOWS && WINVER >= 0x0600 //this block is not compatible with XP
static bool j;
if(j != 1){
FARPROC dpiaware;
HMODULE user32 = LoadLibrary(TEXT("user32.dll"));
if(user32 != NULL){
dpiaware = GetProcAddress(user32, "SetProcessDPIAware");
if(NULL != dpiaware){
(dpiaware) ();
j = 1;
}
}
}
#endif
static int32 i;
if (new_error) return 0;
if (x<=0||y<=0){error(5); return 0;}
@ -18824,7 +18838,7 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
if (new_error) return 0;
#ifdef QB64_WINDOWS
if (read_page->console||i==console_image){
if (i==console_image){
SECURITY_ATTRIBUTES SecAttribs = {sizeof(SECURITY_ATTRIBUTES), 0, 1};
HANDLE cl_conout = CreateFileA("CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, & SecAttribs, OPEN_EXISTING, 0, 0);
CONSOLE_SCREEN_BUFFER_INFO cl_bufinfo;
@ -18853,7 +18867,7 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
if (new_error) return 0;
#ifdef QB64_WINDOWS
if (read_page->console||i==console_image){
if (i==console_image){
SECURITY_ATTRIBUTES SecAttribs = {sizeof(SECURITY_ATTRIBUTES), 0, 1};
HANDLE cl_conout = CreateFileA("CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, & SecAttribs, OPEN_EXISTING, 0, 0);
CONSOLE_SCREEN_BUFFER_INFO cl_bufinfo;
@ -29833,8 +29847,7 @@ void sub__numlock(int32 options){
}
void sub__consolefont(qbs* FontName, int FontSize){
/*
#ifdef QB64_WINDOWS
#ifdef QB64_WINDOWS && WINVER >= 0x0600 //this block is not compatible with XP
SECURITY_ATTRIBUTES SecAttribs = {sizeof(SECURITY_ATTRIBUTES), 0, 1};
HANDLE cl_conout = CreateFileA("CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, & SecAttribs, OPEN_EXISTING, 0, 0);
static int OneTimePause;
@ -29856,7 +29869,6 @@ void sub__consolefont(qbs* FontName, int FontSize){
SetCurrentConsoleFontEx(cl_conout, NULL, &info);
#endif
*/
}