Commit Graph
3972 Commits
Author SHA1 Message Date
polyesterswing 9626012752 MACGUI: Fill in the upper-left and upper-right corners with black 2024-03-04 19:16:22 +01:00
polyesterswing a6b0d088c2 Revert "GRAPHICS: MACGUI: Fix green borders in upper right and upper left corners of Mac menu bar"
This reverts commit 49ae002d6b.

The changes in this commit prevents windows in macventure from
displaying
2024-03-04 19:16:22 +01:00
Torbjörn Andersson 5117adc24c GRAPHICS: MACGUI: Give loaded fonts their correct ID
When loading other fonts than the system ones, they would get ID -1, not
the one from their resource ID. Even if you later registered the font
name, the old font entries would still be wrong. Another possibility
would be to update _fontRegistry when registering fonts, but sev was ok
with this way so let's go with it for now.

It does not consider the possibility of ID collisions the way
registerFontName() does, but apparently there shouldn't be much risk of
that.
2024-03-03 19:49:00 +01:00
Christian Kündig 7aa72a1633 EMSCRIPTEN: OPENGL: Disable GLAD 2024-02-27 17:07:13 +01:00
Christian Kündig 65bdafa0a0 EMSCRIPTEN: OPENGL: Disable OPENGL_DEBUG on Emscripten
863988f was causing a 10x increase in frame times regressing GRIM from 55fps to 3-5 fps.
2024-02-27 17:07:13 +01:00
Miro Kropacek f41a678ba1 GRAPHICS: ATARI: Utilize dlmalloc
- every malloc is now aligned on 16 bytes

- no need for the hidden pointers

- ct60_vmalloc() is called only once, the rest is handled
  by dlmalloc (SV XBIOS' vmalloc is pretty fragile)
2024-02-24 03:54:54 +01:00
Torbjörn Andersson a1c8db3201 JANITORIAL: Clean up some whitespace and double semicolons 2024-01-29 19:32:00 +01:00
Kaloyan Chehlarski be67cf827b GRAPHICS: Prevent segfault in ManagedSurface
The create() overload of ManagedSurface that creates a
new, owned surface, previously assumed that the
_innerSurface was owned before the call was made. Thus,
when switching between sub-surface and owning surface
modes, a segfault would occur when attempting to free
the pixel data of the inner surface, which is not actually
owned by the ManagedSurface. This commit makes sure
that when free() is called, the inner surface no longer
has an active pointer to its old pixel data.
2024-01-28 02:06:05 +01:00
Le Philousophe 42fa87acea GRAPHICS: OPENGL: Don't try to use GLAD aliasing for shaders
Aliasing doesn't cover all the functions we use.
In addition, old GLSL 1.00 doesn't support the #version stance.
2024-01-27 09:44:39 +01:00
Scott Percival 0562ff567c GRAPHICS: MACGUI: Move paragraph end marker when merging rows
Fixes issue where removing an empty line with backspace would remove the
previous empty line also.
2024-01-20 23:14:52 +01:00
Scott Percival 95b47042f0 GRAPHICS: MACGUI: Stop MacTextCanvas::chopChunk from removing last chunk
There needs to be at least one chunk per line of text, or else many
basic text operations will cause a crash.
2024-01-20 23:14:52 +01:00
Scott Percival b9003c145f GRAPHICS: MACGUI: Fix fgcolor conversion in MacText 2024-01-20 23:14:52 +01:00
Scott Percival 2f16bf2e9f GRAPHICS: MACGUI: Remove pseudotransparency workaround in MacText
Needed in order to e.g. print white text on a black background in
Director.

This reverts 457b09cb4e
2024-01-20 23:14:52 +01:00
Cameron Cawley f3fbd2477c GRAPHICS: Allow specifying separate xdpi and ydpi values in loadTTFFont 2024-01-08 23:41:50 +01:00
elasota 9e374ec4ca GRAPHICS: Use target pragmas instead of compiler flags to prevent ODR problems. 2024-01-08 23:37:39 +01:00
Cameron Cawley 19dfebf7be GRAPHICS: Rename variables in PM scaler to avoid clashing with system headers 2024-01-08 02:56:30 +01:00
Eugene Sandulenko ed4ec96b44 GRAPHICS: MACGUI: Fix links with Unicode characters
If there are unicode characters in the link, it was leading to
wrong length calculation.

Example of such link:

  ![Menü-Symbol](menu.png \"Menü-Symbol\"){w=10em}

The problem is that for simplicity, we are working with UTF8 in
Markdown, but still with U32String in MacTextCanvas. This led to
the string length be calculated for UTF8, which is a multibyte
encoding. As a result, we were overshooting the link parsing
and reading texts as numbers.

This is kind of a hacky solution: we convert text to U32 before
caluclating the string length
2024-01-07 00:39:25 +01:00
Eugene Sandulenko 7361c0f2fa GRAPHICS: MACGUI: Made readHex() more robust
This fixes crashes in Markdown with malformed translations
2024-01-05 01:04:08 +01:00
Eugene Sandulenko df3ee65585 GRAPHICS: MACGUI: Added mre debug output 2023-12-30 22:17:18 +01:00
Eugene Sandulenko 3051af3732 GRAPHICS: MACGUI: Switched debug output to 'macgui' debug channel in MacFontManager 2023-12-30 01:05:26 +01:00
Cameron Cawley f3486a162d GRAPHICS: Add fast paths for scaleBlit when dstW == srcW 2023-12-29 18:00:54 +02:00
Le Philousophe 03a53b1a1e OPENGL: Fix GLSL version parsing
Some old GLES2 implementation did have a different version prefix.
Be more relax like almost everyone and look for the first digit to start
parsing.
2023-12-28 09:31:31 +01:00
Eugene Sandulenko b0a624df76 GRAPHICS: MACGUI: More debug output to MacFontManager 2023-12-26 21:28:28 +01:00
Cameron Cawley 6522c6e11d GRAPHICS: Make the Graphics::PixelFormat constructors constexpr 2023-12-26 20:23:59 +01:00
Cameron Cawley 5b1b14ad80 COMMON: Mark more symbols as const 2023-12-26 20:23:59 +01:00
Le Philousophe 226de788c8 GRAPHICS: Make API use the Path class 2023-12-24 13:19:25 +01:00
Le Philousophe 802c91554f COMMON: Make extrapath a Path object 2023-12-24 13:19:25 +01:00
Torbjörn Andersson d4c9c7208f GRAPHICS: MACGUI: Avoid recursion in Mac menu event processing
When moving the mouse through the menu bar, over a part that's not
occupied by menu items, the Mac menu class will start calling
processEvent() recursively. This is bad for two reasons: During the
recursion (which can easily reach a depth of dozens or even hundreds of
calls) there is no delay, so it will use 100% CPU. And once the
recursion unwinds, all the delays will come at once.

This moves the call to eventLoop() to after the first event has been
fully processed. Hopefully that will have approximately the same desired
effect, without any of the bad side effects.
2023-12-16 21:14:59 +01:00
Le Philousophe 306ca933d4 OPENGL: Use GLAD version when available and check functions before use
When GLAD fails to parse version, glGetError is null and raises a
SIGSEGV.
Current version of GLAD has a bug while parsing extensions so there is a
workaround here which should disappear when it's fixed.
2023-12-14 18:37:23 +01:00
elasota e1fc76c372 GRAPHICS: Fix negation of unsigned integer warning 2023-12-11 23:07:20 +02:00
elasota 9e13093610 GRAPHICS: Fix empty controlled statement warning 2023-12-11 23:07:20 +02:00
Matthew Duggan 0b4aa788ff GRAPHICS: Correct cleanup loop on BDF load failure
Identified by xcode analysis, the cleanup code would have crashed before as it
was using the wrong loop variable.
2023-12-10 10:04:30 +11:00
Eugene Sandulenko b7fd4cb8af GRAPHICS: Fix crash while trying fonts-cjk.dat 2023-12-09 15:33:16 +01:00
Matthew Duggan 0f795b481d GRAPHICS: MACGUI: Only set system palette if screen is CLUT8
This is needed to allow use of macgui components while 16-bit graphic games are
running, eg to display help screens.
2023-12-09 13:53:01 +11:00
Scott Percival 2c8d493984 GRAPHICS: MACGUI: Pass through key events even if window not editable
Active MacWindows should always be passed EVENT_KEYDOWN events by MacWindowManager.
Previously it would only do so if the mouse was in the vicinity.

Fixes text input on the savegame screen of Team Xtreme: Operation
Weather Disaster.
2023-12-02 02:47:40 +01:00
Scott Percival 7f5c07a738 MACGUI: Deactivate _lockedWidget when Window is removed
Fixes using the quit widget on the save screen of Team Xtreme: Operation
Weather Disaster.
2023-12-02 02:47:40 +01:00
AndywinXp 49ae002d6b GRAPHICS: MACGUI: Fix green borders in upper right and upper left corners of Mac menu bar
It probably went unnoticed until now because the menu bar is
mostly used for black and white games, and in those instances
the green color is converted to black.

Tested with Indy3, Loom, The Apartment, Spaceship Warlock,
and several WAGE games.
2023-12-01 21:08:04 +01:00
Eugene Sandulenko 63c8367ace GRAPHICS: MACGUI: Indicate presence of a table in debug output in MacTextCanvas 2023-11-25 19:46:40 -08:00
Eugene Sandulenko 92b03145a2 GRAPHICS: MACGUI: Disable MacText with tables resizing
The problem is more complex than it appears, so, disabling this
before the release, because the current code is removing
tables on resize
2023-11-24 19:48:24 +01:00
Eugene Sandulenko 446908f458 GRAPHICS: MACGUI: Fix crash on reshuffling text after table in Markdown
Array::insert_at() is calling destructor for old data, whuch was freeing
the _table pointer that we are copying to new element which led to
use-after-free.

This moves MacTextLine cleanup to MacTextCanvas.
2023-11-23 00:13:33 +01:00
Eugene Sandulenko 0e18527d36 GRAPHICS: Use fonts-cjk.dat for loading path 2023-11-20 20:59:17 +01:00
Torbjörn Andersson b2568e05ce GRAPHICS: MACGUI: Attempt to fix threading issues
The menuTimerHandler() function is called from a timer, which means that
anything that it touches could potentially cause threading issues. I
suspect this is what's been causing the screen to go black for me a few
times, but it's not something I can reproduce at will. Add a mutex to
try and fix this.
2023-11-18 18:49:55 +01:00
AndywinXp 2efd9ab70a GRAPHICS: MACGUI: Add kWMModeForceMacBorder mode
This allows for having the Mac desktop arc even during Win95 mode.
2023-11-18 18:47:39 +01:00
Torbjörn Andersson 53d149b45b GRAPHICS: Make Mac font rendering more like the original
By applying italics before outline, not after, and slanting italics
characters from the bottom up instead of top down, I now get pixel
perfect rendering for my experimental About dialogs for Loom and Indiana
Jones and the Last Crusade.
2023-11-18 18:47:39 +01:00
Torbjörn Andersson 16ac86cdeb GRAPHICS: Calculate bitmapOffset correctly. Again.
Add, don't set, the extra bitmap offset for italics to keep glyphs from
overlapping in memory.
2023-11-18 18:47:39 +01:00
Torbjörn Andersson d63ad4c2e3 GRAPHICS: MACGUI: Don't filter keypresses in processMenuShortCut()
This is already done in keyEvent(), which is the only place where
processMenuShortCut() is called. This allows using Alt-<key> as
shortcut, which is consistent with how the Mac emulators I've tried does
it.
2023-11-18 18:47:39 +01:00
Torbjörn Andersson 0e76018a10 GRAPHICS: MACGUI: Handle menu shortcuts even when menus are hidden 2023-11-18 18:47:39 +01:00
Torbjörn Andersson 1b3e863801 GRAPHICS: MACGUI: Consider menu item font when calculating menu width
Mac Loom and Last Crusade use bold for their "About" menu item, and that
made the menu too narrow.
2023-11-18 18:47:39 +01:00
Eugene Sandulenko ff0abf2b69 GRAPHICS: MACGUI: Fix crashes when dealing with empty MacTexts 2023-11-16 00:23:09 +01:00
Kaloyan Chehlarski 654879f507 GRAPHICS: Fix Multiply blending in NEON path
This fixes the color bleeding issues that previously happened
when using Multiply blending (e.g. Out of Order intro)
2023-11-14 12:05:27 +02:00