Commit Graph

943 Commits

Author SHA1 Message Date
Scott Percival
c94f2de321 DIRECTOR: Add font quirks for two Star Trek games 2023-06-08 09:16:30 +02:00
Harishankar Kumar
797803d515 GRAPHICS: MACGUI: Implement lockable widgets
Lockable widgets are those which takes in all input
and if set then no other widget can take any input
its same as them being inactive, no buttons, animations
etc will work.

This is implemented to support `modal` property of window,
which requires a window to take all input and prevent all
others from having any actions.
2023-06-01 20:17:23 +02:00
Harishankar Kumar
dd72dd09ca DIRECTOR: Implement the titleVisible property of window
Modifies border of window by first changing title to "", then updating
window border to borderType 2 `ThinNoTitle`.

`titleVisible of window` to verify this behavior.

Co-authored-by: Pragyansh Chaturvedi <pragyanshchaturvedi18@gmail.com>
2023-06-01 20:17:23 +02:00
Harishankar Kumar
4f07e8dec4 GRAPHICS: MACGUI: Added support to change inner dimension of macwindow derived object
Added setInnerDimension which calls resize (with bool inner dimension change: true), moveto and finally updateOuterDimension.

This was implemented to match window rectangle size as used by window property `rect`, `rect of window` in `workshop` uses this.
2023-05-31 13:29:33 +02:00
Harishankar Kumar
23f1229e67 GRAPHICS: MACGUI: Refactor resize() to extract inner window resizing
resize function is extracted to new function resize and resizeInner,
also a new private function rebuildSurface is created to handle common
code of refreshing/rebuilding surface after modifying inner or outer
window dimensions.
2023-05-31 13:29:33 +02:00
Harishankar Kumar
76d1590ccc GRAPHICS: Implement smartmenu for macpopups
Smartmenu implementation using offsetY to displace popup such that the previous selected item will fall onto cursor, includes checked item and highlighted.

For `Popup Menu` in theapartment, without this patch the second popmenu was not remembering the last selected item and was opening it from scratch, after this patch popupmenu will open from the last selected item already selected with checkbox.
2023-05-28 13:50:18 +02:00
Harishankar Kumar
fd5977b911 GRAPHICS: Add blinking animation when selecting item
Additional logic for drawing blinks when closing popup menu is added, closeMenu is overriden because it is called inside eventLoop and therefore need to be captured when closingMenu.

Add blinking animation support for macpopups, affects `Popup Menu` in theapartment, before this there was no animation when selecting item and the menu just used to immediately close, now however there is proper animation for item selection.
2023-05-28 13:50:18 +02:00
Harishankar Kumar
e12d3053cc GRAPHICS: Implement macpopupmenu while reusing macmenu
Added functions for menu drawing/selections, this uses the base functions of macmenu to implement mac-styled popupmenu's, also return selected item index/text.

Used by 'Popup Menu' in theapartment: With this changes the popupmenu is working with both item selectors, doesn't implement the icon selector.
2023-05-28 13:50:18 +02:00
Harishankar Kumar
014712bbc5 GRAPHICS: Add menu by id and support custom menu
Adds new function addMenu/getMenu with menu id to add custom menus.

Used when implementing macpopupmenu which reuses macmenu for theapartment.
2023-05-28 13:50:18 +02:00
Harishankar Kumar
5bb6e06624 GRAPHICS: Expose internal macmenu structs for reusing in popmenu
Exposed MacMenuItem, MacMenuSubMenu, MacMenuItem and MacMenuData to headers and changed visibility of needed functions to protected.

These structs and functions is used in popupmenu for reusing macmenu code.
2023-05-28 13:50:18 +02:00
Eugene Sandulenko
70b1a4432a
GRAPHICS: MACGUI: Use proper check symbol in MacMenu 2023-05-28 12:54:06 +02:00
Misty De Meo
ce61aa9b9b GRAPHICS: MACGUI: remove unused variable 2023-05-14 12:04:58 +03:00
Scott Percival
14c7756d06 GRAPHICS: MACGUI: Fix edge cases of getMouseWord 2023-03-24 21:27:34 +01:00
Donovan Watteau
18ab6803d6 JANITORIAL: Fix various "an" typos in comments 2023-03-16 14:47:28 +01:00
Scott Percival
585ec558b6 GRAPHICS: MACGUI: Move getFont() messages to a higher debug level 2023-03-06 21:26:28 +01:00
Roland van Laar
157b1d9a48 GRAPHICS: MACGUI: keep formatting in empty text
When text is emptied by user action, e.g. backspace, the formattting
should be preserved.

In the game Majestic a text box for user input would start out with the
correct formatting, i.e. green text on a black background. When the user
would then press backspace till the text was gone, the method
`MacText::getTextChunk` would return an empty string, with the
formatting removed. If the user started typing again the text would use
the default formatting with black text on black background.

Fixes: https://trello.com/c/POQZRCEO/546-text-doesnt-show-in-majestic-in-text-box
2023-02-17 15:02:52 +01:00
Roland van Laar
d33005f8b2 JANITORIAL: GRAPHICS: print fgcolor in base 10
All colors in debug output in mactext use base 10
where this line was in base 16.
2023-02-17 15:02:52 +01:00
Eugene Sandulenko
39f1b97fb9
GRAPHICS: MACGUI: Clean up "-Regular" prefix from the loaded MacFonts
Usage is in mcluhan quirk where we load font named "McLuhan-Regular"
2023-02-10 23:51:14 +01:00
Eugene Sandulenko
980e927e57
GRAPHICS: MACGUI: Warn about incorrect winfont sizes used as a substitute
Used by mcluhan-win that has 3 fonts bundled with it.
2023-02-10 20:59:30 +01:00
Eugene Sandulenko
e5c1ef3fbb
DIRECTOR: Fix regression from 48740a2ad1
The color values went inverted, but in several places they left
untouched.

In general, it is not a good idea to have this hardcoded, but at least
now we have this addressed.
2023-02-10 00:53:38 +01:00
Cameron Cawley
28d7b361ea COMMON: Move more file format code into common/formats 2022-12-11 22:33:23 +01:00
Eugene Sandulenko
fb7095f5a4
COMMON: Move all compression-related files to a separate directory 2022-12-01 11:53:02 +01:00
elasota
261ced8ca4 GRAPHICS: Fix getRowCol returning uninitialized variable nsx if there were no chunks for the chosen line. 2022-11-28 18:43:55 +01:00
Hubert Maier
a3ec89bf51 JANITORIAL: GRAPHICS: Correct Spelling Mistake
begining -> beginning
2022-11-15 22:52:43 +02:00
sluicebox
2775987cba MACGUI: Expose font families in MacFontManager
MacFontManager didn't have a mechanism to report which fonts it loaded
from an external resource. It also requires that any fonts that aren't
built-in be explicitly registered by name by the client before they can
be used. This combination meant that a client couldn't load fonts from
an external file and use them by their properties (id / size / style).

SCI contains Mac fonts in its executable along with a table that maps
each SCI font id to a Mac font id and size. The font name isn't a part
of this since the Classic Mac Toolbox API took id / size / style as
input when drawing text.

Now MacFontManager exposes the font families it has loaded along with
their names. This allows a client to see which fonts were loaded,
register them by name, and proceed to use them with the existing API.
2022-11-06 23:05:20 -08:00
Eugene Sandulenko
3659fa9d70
GRAPHICS: MACGUI: Fixed returned palette size in WM 2022-11-03 20:36:59 +01:00
Eugene Sandulenko
62f067a72c
MACGUI: Fix incorrect logical operator usage. PVS-Studio V564 2022-10-27 23:27:44 +02:00
Hubert Maier
072a3b2958
GRAPHICS: Correct spelling mistake
begining -> beginning
2022-10-27 15:56:06 +02:00
Scott Percival
095ae06405 COMMON: Refactor MacResManager::load* methods to accept a pointer
Previously the methods would pass by reference, then convert to a
pointer on success and take ownership. This isn't ideal, as a
reference suggests no transferral of ownership, and doesn't suggest
it needs to be a heap resource allocated by new.
2022-09-25 10:35:03 +02:00
Roland van Laar
034a5efe98 DIRECTOR: Fix memory leak in registered FONDs
References to FOND resource streams are stored in an array.

Font streams were registered by their family name in a hashmap.
When a second font with the same name was encoutered it would replace
the pointer to the previous font.
The only use case for the hashmap was to register the stream to be able
to later close them.
2022-09-24 16:37:27 +02:00
Roland van Laar
82142000c6 GRAPHICS: MACGUI: leave _desktopBmp as a nullptr
Make sure _desktopBmp can be checked to be a nullptr.
2022-09-20 23:19:08 +02:00
Roland van Laar
c537cd9ca6 GRAPHICS: MACGUI: Fix memory leak
Clean up _desktopBmp before it's reallocated again.
2022-09-20 23:12:09 +02:00
Le Philousophe
8ec9835358 GRAPHICS: Initialize _japaneseFontsLoaded before it's used 2022-09-18 16:15:56 +02:00
Le Philousophe
5774811be8 GRAPHICS: Don't dereference a null pointer 2022-09-18 16:15:56 +02:00
Le Philousophe
e020710d5d GRAPHICS: Free WinFont when erroring out 2022-09-18 16:15:56 +02:00
Eugene Sandulenko
70721f9a59
GRAPHICS: MACGUI: Sync methods with their prototypes 2022-09-09 17:43:35 +02:00
Pragyansh Chaturvedi
842fe20c5e DIRECTOR: Modify decomposeColor to fix missing text in buttons in 32bpp mode 2022-09-09 02:21:47 +02:00
Avijeet
26c3c4f160 MACVENTURE: Invert exit window's color when active 2022-09-04 20:30:02 +02:00
Eugene Sandulenko
b697ad6cfa
GRAPHICS: MACGUI: Improved debug output 2022-08-22 17:39:47 +02:00
Le Philousophe
12df7f3767 GRAPHICS: Fix uint vs uint32 discrepancies 2022-08-22 13:09:45 +02:00
Eugene Sandulenko
ba4a260e9e
GRAPHICS: MACGUI: Use uint32 for color information 2022-08-20 22:12:29 +02:00
Eugene Sandulenko
4bce66edbb
GRAPHICS: MACGUI: Fix warnings 2022-08-05 20:20:53 +02:00
Avijeet
a21afb29b1 GRAPHICS: MACGUI: Reduce duplicated code in MacTect::render 2022-08-05 20:17:23 +02:00
Avijeet
ff1f5712e3 PINK: Fix reversed hebrew text 2022-08-05 20:17:23 +02:00
Avijeet
4f3dc247e4 GRAPHICS: MACGUI: Handle EVENT_QUIT properly in MacDialog 2022-08-05 20:15:03 +02:00
Avijeet
1ad34487ee GRAPHICS: MACGUI: Remove unnecessary headers from macdialog.h 2022-08-05 20:15:03 +02:00
Avijeet
033bc00cd1 GRAPHICS: MACGUI: Poll events in MacDialog itself 2022-08-05 20:15:03 +02:00
Avijeet
1b955dc90c GRAPHICS: MACGUI: Refactor MacDialog to not use WAGE functions 2022-08-05 20:15:03 +02:00
Avijeet
2c905885c4 GRAPHICS: MACGUI: Fix text alignment for MacDialog 2022-08-05 20:15:03 +02:00
Avijeet
c4ede93e79 WAGE: Add about screen 2022-08-05 20:15:03 +02:00