Commit graph

1168 commits

Author SHA1 Message Date
Filippos Karapetis
4e7752b923 GRAPHICS: Use C++ 11 range-based for loops 2025-03-27 13:47:57 +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
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
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
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
Cameron Cawley
80804c06c4 GRAPHICS: MACGUI: Use LiberationSans instead of FreeSans as a fallback 2025-01-26 15:44:10 +02: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
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
027c9bddca GRAPHICS: Add drawRoundRect to Graphics::Surface 2025-01-06 01:35:05 +02: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
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
8d9614ccd5 GRAPHICS: MACGUI: Extend the font ID enum 2024-12-09 23:24:23 +02:00
Cameron Cawley
58a9aa6a2c COMMON: Deprecate U32String constructors that accept a uint32 array 2024-11-29 01:14:36 +02:00
Cameron Cawley
35138892c2 GRAPHICS: MACGUI: Use a const pointer for MacPatterns arrays 2024-11-26 00:32:00 +01:00
Torbjörn Andersson
97ced3166c SCUMM: MACGUI: Optimize Mac palette handling (bug #15492)
Previously, every palette change in a game get passed on to the Mac
Window Manager, which would then have to look up new colors for drawing
Mac GUI stuff. This was fine for some games, but later ones do a lot of
palette animations, which could slow things down.

Now the Mac Window Manager gets the new palette only when it's about to
draw the Mac menu, or when it's about to draw a dialog (since those can
be triggered outside of the menu).

Additionally, the Mac Window Manager now triggers the auto-opening of
the menu in the event handler, not in the drawing code. Otherwise the
menu would be drawn once before the SCUMM Mac GUI could notice that the
menu was visible, causing an ugly color glitch.
2024-11-20 11:39:25 +02:00
Scott Percival
a205480946 MACGUI: Fix getBorderFlags for titleless window types
Fixes rendering of game viewport in Zeddas: Servant of Sheol.
2024-11-11 20:40:06 +01:00
Niv Baehr
2a5602f34d GRAPHICS: MACGUI: Fix blank characters on forced Win95 mode 2024-11-05 20:18:50 +01:00
AndywinXp
90b5a73825 GRAPHICS: MACGUI: Add kWMModeForceMacFonts flag
This flag prevents Mac fonts substitutions with equivalent TTF fonts.
Of course, being this a flag, it will not impact any previous game using
this. It will only impact whichever engine will decide to set it to active
(in our case, SCUMM).
2024-10-28 08:24:59 +01:00
Eugene Sandulenko
56565c65e7
GRAPHICS: MACGUI: Fix regression after ManagedSurface usage changes 2024-10-25 23:12:53 +02:00
Eugene Sandulenko
c191ea24fa
GRAPHICS: MACGUI: Fix usage of deprecated ManagedSurface methods 2024-10-24 15:07:01 +02:00
Cameron Cawley
7e0dfe0081 GRAPHICS: Use custom stream callbacks for loading TTF fonts 2024-07-23 15:33:43 +01:00
Cameron Cawley
ff530edcb1 GRAPHICS: Deprecate ManagedSurface methods that implicitly copy pixel data 2024-07-02 13:31:18 +01:00
Scott Percival
e1f2418c17
GRAPHICS: MACGUI: Fix MacMenu to support 32-bit graphics 2024-06-18 18:24:08 +08:00
Krish
1c1ed2e61e GRAPHICS: MACGUI: Fix compilation with DEBUG enabled 2024-06-03 14:01:15 +02:00
Krish
a51e33f1de GRAPHICS: MACGUl: Handle empty text in selection logic
Fixes crash in The Apartment version D4, movie "editableText"
./scummvm --start-movie=editableText theapartment4
2024-06-03 14:01:15 +02:00
Hubert Maier
9139412157 JANITORIAL: Fix refering typo in mactext.cpp 2024-05-18 13:52:31 +02:00
Hubert Maier
a545fa7539 JANITORIAL: Fix extention typos in mactext-canvas.cpp 2024-05-18 13:52:31 +02:00
Eugene Sandulenko
5bd7b57282
GRAPHICS: MACGUI: Switch TTFMap to saner data structure not requiring global constructor 2024-05-12 15:23:30 +02:00
Cameron Cawley
248ab4ca15 GRAPHICS: MACGUI: Improve image quality in markdown documents 2024-05-09 15:19:17 +02:00
InariInDream
cea8312c35 GUI: load ttf from archive in Unicode branch 2024-05-04 00:14:31 +02:00
InariInDream
bd867b109a GUI: Switch HelpDialog to TTF fonts 2024-05-04 00:14:31 +02:00
InariInDream
e70ea93149 GRAPHICS: MACGUI: Add support for TTF font maps 2024-05-04 00:14:31 +02:00
Eugene Sandulenko
2c33cfb478
GRAPHICS: MACGUI: Hid too noisy warning 2024-04-21 22:33:40 +02:00
hecmar007
558167eaa2
MACGUI WAGE: Handle \n in end of string case
Add logic to correctly add new line when a \n is present at the end of a string.
2024-04-01 18:21:24 +02:00
Matthew Jimenez
ee5ebec7ca IMAGE: Remove palette start from image decoder.
The palette start value was always zero, adding complexity without benefit.
2024-03-31 23:16:59 +03:00
D G Turner
3dcd3e6fa6 GRAPHICS: MACGUI: Fix Signed vs. Unsigned Comparison GCC Compiler Warnings 2024-03-30 16:40:22 +00:00
Krish
34ecd753ad GRAPHICS: MACGUI: Implement submenu scrolling 2024-03-27 15:34:34 +01:00
s-m33r
b2851f8128 GRAPHICS: MACGUI: add _draggable property to BaseMacWindow 2024-03-25 21:22:56 +01:00
Nabeel Khan
5b10353a68 GUI: Implement Window border draggability 2024-03-14 18:59:16 +01:00
hecmar007
c6c80b9313
GRAPHICS: MACGUI: Process extra long words (#5703)
GRAPHICS:  MACGUI: Process extra long words

Added functionality to rewrap words that split into different lines.
2024-03-13 17:39:21 +01:00
Matthew Jimenez
5219c99400 GRAPHICS: Move PaletteManager definition to a separate header 2024-03-12 12:24:00 +02:00
Torbjörn Andersson
1bf0dbad75 GRAPHICS: MACGUI: Eliminate timer use
As part of fixing a graphical glitch in Mac Indiana Jones and the Last
Crusade, eliminate the menu timer from the Mac window manager. It's just
too unpredictable and error prone for my taste.
2024-03-10 23:12:25 +01:00
polyesterswing
9626012752 MACGUI: Fill in the upper-left and upper-right corners with black 2024-03-04 19:16:22 +01:00