Skip to content

Commit

Permalink
Merge pull request #603 from a740g/linux-fixes
Browse files Browse the repository at this point in the history
FreeType update & #595 fix
  • Loading branch information
a740g authored Jan 26, 2025
2 parents cae4a85 + f1210c5 commit 3965c5e
Show file tree
Hide file tree
Showing 420 changed files with 3,418 additions and 3,786 deletions.
8 changes: 5 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,9 +25,10 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
7 changes: 0 additions & 7 deletions internal/c/libqb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,6 @@ extern "C" int QB64_Resizable() {

int32 sub_gl_called = 0;

#define QB64_EVENT_CLOSE 1
#define QB64_EVENT_KEY 2
#define QB64_EVENT_RELATIVE_MOUSE_MOVEMENT 3
#define QB64_EVENT_FILE_DROP 4
#define QB64_EVENT_KEY_PAUSE 1000

static int32 image_qbicon16_handle;
static int32 image_qbicon32_handle;

Expand Down Expand Up @@ -31136,7 +31130,6 @@ extern "C" void qb64_os_event_linux(XEvent *event, Display *display, int *qb64_o
break;
}
}
return;
}
#endif

Expand Down
13 changes: 13 additions & 0 deletions internal/c/libqb/include/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,22 @@
#define INCLUDE_LIBQB_EVENT_H

#include <stddef.h>
#include <stdint.h>

#define QB64_EVENT_CLOSE 1
#define QB64_EVENT_KEY 2
#define QB64_EVENT_RELATIVE_MOUSE_MOVEMENT 3
#define QB64_EVENT_FILE_DROP 4

void error(int32_t error_number);

#ifdef __cplusplus
void evnt(uint32_t linenumber, uint32_t inclinenumber = 0, const char *incfilename = NULL);
extern "C" int qb64_custom_event(int event, int v1, int v2, int v3, int v4, int v5, int v6, int v7, int v8, void *p1, void *p2);
#else
void evnt(uint32_t linenumber, uint32_t inclinenumber, const char *incfilename);
int qb64_custom_event(int event, int v1, int v2, int v3, int v4, int v5, int v6, int v7, int v8, void *p1, void *p2);
#endif

extern uint32_t new_error;
extern uint32_t qbevent;
Expand Down
7 changes: 1 addition & 6 deletions internal/c/parts/core/freeglut/freeglut_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,9 @@
#endif

// QB64-PE: custom code begin
#include "../../../libqb/include/event.h"
#include "../../../libqb/include/keyhandler.h"

#define QB64_EVENT_CLOSE 1
#define QB64_EVENT_KEY 2
#define QB64_EVENT_RELATIVE_MOUSE_MOVEMENT 3
#define QB64_EVENT_FILE_DROP 4

int qb64_custom_event(int event, int v1, int v2, int v3, int v4, int v5, int v6, int v7, int v8, void *p1, void *p2);
#if TARGET_HOST_POSIX_X11
void qb64_os_event_linux(XEvent *event, Display *display, int *qb64_os_event_info);
#else
Expand Down
34 changes: 5 additions & 29 deletions internal/c/parts/video/font/freetype/adler32.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

#include "zutil.h"

#ifndef Z_FREETYPE
local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
#endif

#define BASE 65521U /* largest prime smaller than 65536 */
#define NMAX 5552
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
Expand Down Expand Up @@ -62,11 +58,7 @@ local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
#endif

/* ========================================================================= */
uLong ZEXPORT adler32_z(
uLong adler,
const Bytef *buf,
z_size_t len)
{
uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) {
unsigned long sum2;
unsigned n;

Expand Down Expand Up @@ -133,22 +125,14 @@ uLong ZEXPORT adler32_z(
}

/* ========================================================================= */
uLong ZEXPORT adler32(
uLong adler,
const Bytef *buf,
uInt len)
{
uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len) {
return adler32_z(adler, buf, len);
}

#ifndef Z_FREETYPE

/* ========================================================================= */
local uLong adler32_combine_(
uLong adler1,
uLong adler2,
z_off64_t len2)
{
local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2) {
unsigned long sum1;
unsigned long sum2;
unsigned rem;
Expand All @@ -173,19 +157,11 @@ local uLong adler32_combine_(
}

/* ========================================================================= */
uLong ZEXPORT adler32_combine(
uLong adler1,
uLong adler2,
z_off_t len2)
{
uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, z_off_t len2) {
return adler32_combine_(adler1, adler2, len2);
}

uLong ZEXPORT adler32_combine64(
uLong adler1,
uLong adler2,
z_off64_t len2)
{
uLong ZEXPORT adler32_combine64(uLong adler1, uLong adler2, z_off64_t len2) {
return adler32_combine_(adler1, adler2, len2);
}

Expand Down
2 changes: 1 addition & 1 deletion internal/c/parts/video/font/freetype/afblue.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* Auto-fitter data for blue strings (body).
*
* Copyright (C) 2013-2023 by
* Copyright (C) 2013-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
Expand Down
2 changes: 1 addition & 1 deletion internal/c/parts/video/font/freetype/afblue.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* Auto-fitter data for blue strings (specification).
*
* Copyright (C) 2013-2023 by
* Copyright (C) 2013-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
Expand Down
2 changes: 1 addition & 1 deletion internal/c/parts/video/font/freetype/afcjk.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Auto-fitter hinting routines for CJK writing system (body).
*
* Copyright (C) 2006-2023 by
* Copyright (C) 2006-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
Expand Down
4 changes: 2 additions & 2 deletions internal/c/parts/video/font/freetype/afcjk.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Auto-fitter hinting routines for CJK writing system (specification).
*
* Copyright (C) 2006-2023 by
* Copyright (C) 2006-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
Expand Down Expand Up @@ -84,7 +84,7 @@ FT_BEGIN_HEADER
/* used for horizontal metrics too for CJK */
FT_Bool control_overshoot;
FT_UInt blue_count;
AF_CJKBlueRec blues[AF_BLUE_STRINGSET_MAX];
AF_CJKBlueRec blues[AF_BLUE_STRINGSET_MAX_LEN];

FT_Fixed org_scale;
FT_Pos org_delta;
Expand Down
2 changes: 1 addition & 1 deletion internal/c/parts/video/font/freetype/afcover.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Auto-fitter coverages (specification only).
*
* Copyright (C) 2013-2023 by
* Copyright (C) 2013-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
Expand Down
2 changes: 1 addition & 1 deletion internal/c/parts/video/font/freetype/afdummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Auto-fitter dummy routines to be used if no hinting should be
* performed (body).
*
* Copyright (C) 2003-2023 by
* Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
Expand Down
2 changes: 1 addition & 1 deletion internal/c/parts/video/font/freetype/afdummy.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Auto-fitter dummy routines to be used if no hinting should be
* performed (specification).
*
* Copyright (C) 2003-2023 by
* Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
Expand Down
2 changes: 1 addition & 1 deletion internal/c/parts/video/font/freetype/aferrors.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Autofitter error codes (specification only).
*
* Copyright (C) 2005-2023 by
* Copyright (C) 2005-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
Expand Down
2 changes: 1 addition & 1 deletion internal/c/parts/video/font/freetype/afglobal.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Auto-fitter routines to compute global hinting values (body).
*
* Copyright (C) 2003-2023 by
* Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
Expand Down
2 changes: 1 addition & 1 deletion internal/c/parts/video/font/freetype/afglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Auto-fitter routines to compute global hinting values
* (specification).
*
* Copyright (C) 2003-2023 by
* Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
Expand Down
18 changes: 9 additions & 9 deletions internal/c/parts/video/font/freetype/afhints.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Auto-fitter hinting routines (body).
*
* Copyright (C) 2003-2023 by
* Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
Expand Down Expand Up @@ -979,8 +979,8 @@
/* compute coordinates & Bezier flags, next and prev */
{
FT_Vector* vec = outline->points;
char* tag = outline->tags;
FT_Short endpoint = outline->contours[0];
FT_Byte* tag = outline->tags;
FT_UShort endpoint = outline->contours[0];
AF_Point end = points + endpoint;
AF_Point prev = end;
FT_Int contour_index = 0;
Expand Down Expand Up @@ -1046,16 +1046,16 @@

/* set up the contours array */
{
AF_Point* contour = hints->contours;
AF_Point* contour_limit = contour + hints->num_contours;
short* end = outline->contours;
short idx = 0;
AF_Point* contour = hints->contours;
AF_Point* contour_limit = contour + hints->num_contours;
FT_UShort* end = outline->contours;
FT_Int idx = 0;


for ( ; contour < contour_limit; contour++, end++ )
{
contour[0] = points + idx;
idx = (short)( end[0] + 1 );
idx = *end + 1;
}
}

Expand Down Expand Up @@ -1292,7 +1292,7 @@
AF_Point point = hints->points;
AF_Point limit = point + hints->num_points;
FT_Vector* vec = outline->points;
char* tag = outline->tags;
FT_Byte* tag = outline->tags;


for ( ; point < limit; point++, vec++, tag++ )
Expand Down
2 changes: 1 addition & 1 deletion internal/c/parts/video/font/freetype/afhints.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Auto-fitter hinting routines (specification).
*
* Copyright (C) 2003-2023 by
* Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
Expand Down
2 changes: 1 addition & 1 deletion internal/c/parts/video/font/freetype/afindic.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Auto-fitter hinting routines for Indic writing system (body).
*
* Copyright (C) 2007-2023 by
* Copyright (C) 2007-2024 by
* Rahul Bhalerao <[email protected]>, <[email protected]>.
*
* This file is part of the FreeType project, and may only be used,
Expand Down
2 changes: 1 addition & 1 deletion internal/c/parts/video/font/freetype/afindic.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Auto-fitter hinting routines for Indic writing system
* (specification).
*
* Copyright (C) 2007-2023 by
* Copyright (C) 2007-2024 by
* Rahul Bhalerao <[email protected]>, <[email protected]>.
*
* This file is part of the FreeType project, and may only be used,
Expand Down
9 changes: 4 additions & 5 deletions internal/c/parts/video/font/freetype/aflatin.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Auto-fitter hinting routines for latin writing system (body).
*
* Copyright (C) 2003-2023 by
* Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
Expand Down Expand Up @@ -981,7 +981,7 @@
/* `ref' and `shoot' values of two blue zones must not overlap */

FT_UInt i;
AF_LatinBlue blue_sorted[AF_BLUE_STRINGSET_MAX_LEN + 2];
AF_LatinBlue blue_sorted[AF_BLUE_STRINGSET_MAX_LEN];


for ( i = 0; i < axis->blue_count; i++ )
Expand Down Expand Up @@ -1263,10 +1263,9 @@
max_height = FT_MAX( max_height, -Axis->blues[nn].descender );
}

dist = FT_ABS( FT_MulFix( max_height, new_scale - scale ) );
dist &= ~127;
dist = FT_MulFix( max_height, new_scale - scale );

if ( dist == 0 )
if ( -128 < dist && dist < 128 )
{
FT_TRACE5(( "af_latin_metrics_scale_dim:"
" x height alignment (style `%s'):\n",
Expand Down
4 changes: 2 additions & 2 deletions internal/c/parts/video/font/freetype/aflatin.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Auto-fitter hinting routines for latin writing system
* (specification).
*
* Copyright (C) 2003-2023 by
* Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
Expand Down Expand Up @@ -98,7 +98,7 @@ FT_BEGIN_HEADER

/* ignored for horizontal metrics */
FT_UInt blue_count;
AF_LatinBlueRec blues[AF_BLUE_STRINGSET_MAX];
AF_LatinBlueRec blues[AF_BLUE_STRINGSET_MAX_LEN];

FT_Fixed org_scale;
FT_Pos org_delta;
Expand Down
2 changes: 1 addition & 1 deletion internal/c/parts/video/font/freetype/afloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Auto-fitter glyph loading routines (body).
*
* Copyright (C) 2003-2023 by
* Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
Expand Down
2 changes: 1 addition & 1 deletion internal/c/parts/video/font/freetype/afloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Auto-fitter glyph loading routines (specification).
*
* Copyright (C) 2003-2023 by
* Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
Expand Down
Loading

0 comments on commit 3965c5e

Please sign in to comment.