Commit Graph
4139 Commits
Author SHA1 Message Date
Eugene Sandulenko 4095eff93f GRAPHICS: MACGUI: Fix crash on Unicode font fallback
It is a regression from the recent Unicode font caching.
Do not store fonts that were not loaded (nullptr). Otherwise,
nullptr will be returned on a subsequent call.
2025-04-26 15:02:39 +02:00
Eugene Sandulenko 1cc5b7ea24 JANITORIAL: Formatting fixes 2025-04-26 15:02:39 +02:00
Miro Kropacek 212dd1655f Revert "BACKENDS: ATARI: Remove move16 code"
This reverts commit 0f85939bc5.

Embarrassingly, my benchmark code was broken. move16 very much does
help, both in VRAM<->TT RAM and TT RAM<->TT RAM copying.
2025-04-25 23:27:19 +02:00
Łukasz Lenkiewicz 071dba2dc4 GRAPHICS: Restore missing condition for default unicode font 2025-04-25 19:53:22 +08:00
Łukasz Lenkiewicz 59289df98e GRAPHICS: Fix TTF font caching 2025-04-25 19:53:22 +08:00
dasbidyendu 3c8be58fbc JANITORIAL: Fix comment indentation 2025-04-25 18:32:49 +08:00
dasbidyendu 6b7e566818 JANITORIAL: Cleaned up mactext-canvas 2025-04-25 18:32:49 +08:00
dasbidyendu aec6e60066 JANITORIAL: Remove excessive vertical whitespaces
Remove unnecessary vertical whitespaces from code.
2025-04-25 18:32:49 +08:00
dasbidyendu da1b772ca9 MACGUI: Null pointer and empty chunks tests in mactext , change cursor restoration issue in getmaxwidth.
- Check for null pointer before handling any operations in getChunkNum function.
- Check for empty chunks to avoid extra operations.
- avoid signed/unsigned issue in chunk position.
- avoid possible overflow in cursor restoration logic
2025-04-25 18:32:49 +08:00
dasbidyendu 65d49792e4 MACGUI: Improve chunk handling and add inline documentation in mactext-canvas.cpp
Added some checks to make sure The line continuations are not empty before adding them to the current line's word continuation to ensure consistency.

Also added some comments on previous code.

Made sure to append the chunks if it is within bounds.

Added the newChunk as a pointer to the current chunk.
2025-04-25 18:32:49 +08:00
Miro Kropacek e53fc61ceb BACKENDS: ATARI: Move g_unalignedPitch check into OSystem::engineInit() 2025-04-20 21:33:15 +02:00
Miro Kropacek 82ae054d0a JANITORIAL: Partially revert commit 24dcacfe
That one was a bit heavy-handed: enums really shouldn't be passed as
const references.

Revert changes of:

- Common::CodePage
- Common::EventType
- Common::Keycode
- Common::Language
- Common::Platform

Additionally change ProjectDescription::setLanguage and
ProjectDescription::getLanguage in engines/mtropolis/runtime.{cpp,h} as
those used a Common::Language reference, too.
2025-04-20 21:33:15 +02:00
D G Turner c160631a5d GRAPHICS: MACGUI: Fix Signed vs. Unsigned Comparison GCC Compiler Warnings 2025-04-19 13:56:26 +01:00
Scott Percival 1f99b81cf2 GRAPHICS: MACGUI: Fix getMouseChar and getMouseWord 2025-04-19 18:22:48 +08:00
Scott Percival c79f84e787 GRAPHICS: MACGUI: Move scrollbar support into MacText 2025-04-19 18:22:48 +08:00
sluicebox 8fdfa39723 GRAPHICS: Remove redundant palette size check. PVS-Studio V547 2025-04-15 01:26:15 -07:00
Miro Kropacek 24dcacfe69 JANITORIAL: Add missing references to const function parameters
Applied to all 'const Common::' and 'const Graphics::' instances.
2025-04-13 02:20:09 +03:00
Matthew Jimenez 1b58e6dd90 GRAPHICS: Add method to check empty for Palette 2025-04-12 15:47:17 +03:00
Matthew Jimenez 77ee5a9007 IMAGE: Get palette class by reference on image decoders 2025-04-12 15:47:17 +03:00
Chance.H 159168cb70 FREESCAPE: Fix for #15486 TINYGL: triangles always override zbuffer from lines 2025-04-01 12:27:29 +02:00
Filippos Karapetis 4e7752b923 GRAPHICS: Use C++ 11 range-based for loops 2025-03-27 13:47:57 +08:00
unknown c2f4ec7fce TINYGL: Fix off by one access error
The TGL_TRIANLE_FAN was looping past the valid array size due to the way the
loop is written, relying on i and i+1 to draw the fan. Reducing iteration to
cnt - 1 fixes the access violation and the triangle fan draws properly.
2025-03-25 05:50:36 +01:00
unknown 2cb01134be TINYGL: Fix TGL_TRIANGLE_FAN iteration
Triangle fans need to use a vertex from the previous triangle to create the next
one. The original TGL code does this properly but it was edited at some time and
the iteration changed to move on to the next triangle rather than using the previous
vertex, causing the triangle fan to skip a triangle and render a weird rays thing.
2025-03-25 05:50:36 +01:00
Scott Percival 1d3c6271b2 GRAPHICS: Move Mac gamma curve to header 2025-03-25 12:17:34 +08:00
rinevard 1e763a8afe GRAPHICS: MACGUI: Adding getLineHeight() to MacTextWindow 2025-03-18 13:32:56 +08:00
Eugene Sandulenko 968f594531 GRAPHICS: MACGUI: Truly use cached fonts in MacFontManager
This fixes text in trektech
2025-03-15 11:11:59 +08:00
cmd05 00f2abf93b GRAPHICS: MACGUI: Fix color palette used in nine-patch bitmap for disabling border 2025-03-11 15:36:51 +01:00
Paul Gilbert f5f37f4446 GRAPHICS: Make ManagedSurface fillRect rect const 2025-03-09 16:14:45 -07:00
Matthew Jimenez b940265816 IMAGE: Use palette class in Cinepak decoder.
The Cinepak decoder had an unweighted euclidean color distance calculation for palette matching. This was moved and rewritten to a color distance method on the palette class.
2025-03-05 13:37:01 +02:00
Cameron Cawley 9d871d2ff6 GRAPHICS: Removed deprecated ManagedSurface constructors 2025-03-03 18:13:02 +02:00
Eugene Sandulenko 3000f88043 GRAPHICS: MACGUI: Take DPI into account when dealing with Windows fonts
The original patch courtecy of IRC user grib. The original comment:

Try to coordinate using windows bitmap fonts in the MacFontManager needs to consider
pixels, points, and DPI

Font sizes are usually described in terms of "point" sizes, and rendered
as a number of pixels.

Windows fonts and Macintosh fonts used different DPI (dots per inch).

Bitmap fonts on Mac mostly used 72 dpi, so 72-point font would be about 72 pixels high.

Windows bitmap fonts mostly assumed 96 dpi, so a 72-point font would be 96 pixels high.

director:trektech loads a Windows bitmap font file that is nominally 12 point at 96 dpi. It is 14 pixels high.
2025-03-02 00:25:33 +01:00
Eugene Sandulenko ab68b92df5 GRAPHICS: FONTS: Load DPI information from WinFonts 2025-03-02 00:25:33 +01:00
Matthew Jimenez 4a01560a44 IMAGE: Replace palette byte arrays with Palette class 2025-02-27 00:04:00 +02:00
Matthew Jimenez 1e99ce9d43 GRAPHICS: Use constexpr for palette constants 2025-02-26 11:11:43 +02:00
Eugene Sandulenko 80b6699485 GRAPHICS: MACGUI: Moved windows cached fonts earlier in MacFontManager
Since we cache windows an mac fonts, this ensures that we check both caches
before attempting to generate substitutes, whuch affects greatly
performance in Windows Director games
2025-02-26 00:02:22 +01:00
Le Philousophe e301905875 GRAPHICS: OPENGL: Fix shader version check discrepancy
We required version 110 for OpenGL backend shaders while we only checked
for version 100, although this version is not expected to work without
proper ARB extension support.
Increase minimum supported version to 1.10 which matches OpenGL 2.0
2025-02-19 18:49:22 +01:00
Scott Percival 2d58f99fd6 DIRECTOR: Overhaul TextCastMember
Include new properties/aliases introduced in D5, fixes crashes related
to incorrect casting to MacText.
2025-02-04 15:24:17 +01:00
Le Philousophe 859a8e06ad GRAPHICS: Also enable NEON codepath if compiler builds with NEON enabled
This will allow to build with NEON on platforms using an old compiler
but with NEON enabled for all translation units.
2025-02-01 18:06:56 +01:00
Cameron Cawley 80804c06c4 GRAPHICS: MACGUI: Use LiberationSans instead of FreeSans as a fallback 2025-01-26 15:44:10 +02:00
Le Philousophe 3b62b557d4 GRAPHICS: Remove obsolete and unused primitives 2025-01-24 12:11:17 +01:00
Le Philousophe 2a37e2b808 GRAPHICS: MACGUI: Implement drawing primitives
This makes the code comply with the latest API changes.
The drawing calls now need to be optimized for the complex shapes.
2025-01-24 12:11:17 +01:00
Le Philousophe 58ade5240e GRAPHICS: Add missing drawing primitives
This allows to draw polygon and ellipses directly on the surfaces.
2025-01-24 12:11:17 +01:00
Le Philousophe ec06b9db8d GRAPHICS: MACGUI: Don't check if top menu is enabled in popup menus
Popup menus don't have a top menu and _activeItem is always -1.
2025-01-11 13:02:00 +01:00
Le Philousophe 6be1a9a890 GRAPHICS: MACGUI: Initialize the active menu callback 2025-01-11 12:43:41 +01:00
Torbjörn Andersson c64c763fd2 GRAPHICS: MACGUI: Don't expand disabled submenus 2025-01-08 20:00:45 +02:00
Torbjörn Andersson f489b45282 GRAPHICS: MACGUI: Draw submenu arrow correctly on disabled menu items 2025-01-08 20:00:45 +02:00
Torbjörn Andersson 67da94f031 GRAPHICS: MACGUI: Disable keyboard shortcuts for disabled menus 2025-01-08 20:00:45 +02:00
Torbjörn Andersson 796719cd05 GRAPHICS: MACGUI: Allow menus in the menu bar to be drawn disabled
Disabled menus can still be opened. Menu items in disabled menus will
look and act as if they were individually disabled. Enabling the menu
will restore it to its pre-disabled state.
2025-01-08 20:00:45 +02:00
Cameron Cawley e03b609cdc GRAPHICS: Remove masks from ManagedSurface::transBlitFrom 2025-01-08 19:29:46 +02:00
Cameron Cawley cd77a78f5f GRAPHICS: Fix potential bug in drawThickLine2 2025-01-06 17:03:03 +02:00