Commit graph

4120 commits

Author SHA1 Message Date
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
Torbjörn Andersson
904235ca4d GRAPHICS: Fix SurfacePrimitives::drawHLine()
It was using the wrong parameter order to hLine(). This caused a
regression in drawing Macintosh menu bars (rounded rectangles), and
quite possibly other things as well.
2025-01-06 09:56:25 +01:00
Cameron Cawley
5b01e8a0ca GRAPHICS: Make use of simpleBlitFrom for PM5544 rendering 2025-01-06 02:36:43 +02:00
Cameron Cawley
027c9bddca GRAPHICS: Add drawRoundRect to Graphics::Surface 2025-01-06 01:35:05 +02:00
Cameron Cawley
a79a710feb GRAPHICS: Use a Primitives subclass in Graphics::Surface 2025-01-06 01:35:05 +02:00
Cameron Cawley
7efb0f8287 GRAPHICS: Convert the primitives code to use classes 2025-01-06 01:35:05 +02:00
Cameron Cawley
05104adbf3 GRAPHICS: Add simplified mask blitting routines to ManagedSurface 2025-01-05 16:38:34 +02:00
Torbjörn Andersson
632c5b74fe GRAPHICS: Fix undefined behavior when initializing Octree
As noted by Digitall on Discord.
2025-01-04 11:59:15 +01:00
Torbjörn Andersson
c4c1d64d9f GRAPHICS: MACGUI: Allow menus to grow a bit wider
It's needed to avoid the Apple menu in the Day of the Tentacle Demo from
becoming truncated.
2025-01-02 18:00:50 +01:00
Torbjörn Andersson
5d3b85af65 GRAPHICS: Remove obsolete FIXME comment 2025-01-02 00:54:58 +02:00
Torbjörn Andersson
19e707ce19 GRAPHICS: Add ColorQuantizer class
This simply moves the new ColorQuantizer class out of the SCUMM engine
and into the Graphics namespace where I think it belongs. It reduces a
potentially large number of colors into a reasonable palette of the
desired size.

The SCUMM engine uses this so that the Mac versions can present the
thumbnail image (which is at least 16 bpp) stored in savegames.
2025-01-02 00:54:58 +02:00
Torbjörn Andersson
92e7d9400f GRAPHICS: MACGUI: Add callback for when the menu is activated
The LucasArts SCUMM games need to know when this happens so that they
can turn the screen black. Polling the window manager for the menu
status probably wasn't good enough, because it seemed there were cases
where the menu was both activated and opened too quickly for the game to
have a chance to register it happening.

There is no callback for when the menu is deactivated. I could be wrong,
but I don't think this is quite as sensitive?
2025-01-01 14:41:20 +02:00
Cameron Cawley
645f5d2e36 GRAPHICS: Remove overrideColor from ManagedSurface::transBlitFrom 2024-12-30 10:59:16 +02:00
Matthew Jimenez
3fd3f189cf GRAPHICS: Return early on exact color match for palette lookup 2024-12-26 10:59:48 +02:00
Matthew Jimenez
6c661eb473 GRAPHICS: Define color distance methods for palette 2024-12-26 10:59:48 +02:00
Hubert Maier
f54fd81b4f
JANITORIAL: Fix typos in general files 2024-12-25 16:57:34 +02:00
Cameron Cawley
20ceda8f28 GRAPHICS: OPENGL: Fix warnings when GLAD is disabled 2024-12-24 13:25:39 +02:00
Cameron Cawley
255562991c GRAPHICS: OPENGL: Enable more features with OpenGL ES 3 2024-12-24 13:25:39 +02:00
tunnelsociety
b792ba090d GRAPHICS: Handle seek-only case in TTFLibrary readCallback
As documented in FreeType API Reference. This avoids passing
a null buffer to ttfFile->read().
2024-12-19 22:51:20 +02:00
Paul Gilbert
f422bf985c GRAPHICS: Fix copying ManagedSurface to copy transparency info 2024-12-16 01:46:12 -08:00