Commit Graph
3684 Commits
Author SHA1 Message Date
Le Philousophe f06f470685 GRAPHICS: Properly take stroke width into account when drawing lines
Old code:
- didn't handle well strokes with an odd width
- didn't handle strokes widths above 1 in generic lines handler
2023-06-03 18:27:17 +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 KumarandPragyansh Chaturvedi 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
Walter Agazzi 421295bdc6 GRAPHICS: Change pitch from int16 to int32
This is required for games allocating very big surfaces
(e.g. 9000x300 in Chronicle of Innsmouth - Mountains of Madness)
2023-05-20 23:23:58 +02:00
Vladimir Serbinenko 2366bff928 GRAPHICS: Fix glyph offsets for PC98 glyphs *9e 2023-05-19 21:16:17 +02:00
Eugene Sandulenko 39cd7338bc GRAPHICS: Added missing override keywords 2023-05-14 23:23:44 +02:00
Vladimir Serbinenko b4881f1451 GRAPHICS: Support PC98 font ROM 2023-05-14 23:12:46 +02:00
Cameron Cawley bbe8010cd1 TINYGL: Remove use of Graphics::PixelBuffer from the Line class 2023-05-14 23:04:11 +02:00
Cameron Cawley d293a659d3 TINYGL: Remove use of Graphics::PixelBuffer from the FrameBuffer class 2023-05-14 23:04:11 +02:00
Misty De Meo ce61aa9b9b GRAPHICS: MACGUI: remove unused variable 2023-05-14 12:04:58 +03:00
Miro Kropacek 6c1002aca5 GRAPHICS: ATARI: Fix special move16 case when w==15 2023-05-10 23:02:12 +02:00
Miro Kropacek 76d3706492 BACKENDS: ATARI: Add build scripts
- consolidate public #define's (just ATARI)
- cpu compiler flags are specified in the script
- allow explicit move16, SV and SV Blitter features enabled/disabled

Provide two build scripts:

1. "Fat" one targeted at 040/060 machines (possibly with SuperVidel)

This one is optimized for 68020-60 (so it's still possible to try
highres engines on 68030 machines).

2. "Slim" one targeted at 030 machines (Falcon030+DFB/CT2 or TT030)

This one is optimized for 68030 and stripped from even more features:
"fancy" (highres) themes, move16 & SuperVidel routines and most
importantly the highres engines.
2023-05-10 22:58:26 +02:00
Vladimir Serbinenko 1dc7fac7cc GRAPHICS: Fix default bpp value for drawBig5Char 2023-05-03 15:22:17 +02:00
Eugene Sandulenko fbb238bb91 GRAPHICS: Fix include 2023-04-29 13:39:21 +02:00
Vladimir Serbinenko eb2c55fe04 COMMON: Move DOS font from AGI to common
It's useful for Chinese EOB2 as well
2023-04-29 13:37:45 +02:00
Vladimir Serbinenko b43be897c7 GRAPHICS: sanity check for big5 font file 2023-04-29 13:37:45 +02:00
Vladimir Serbinenko 95bbb7c3d5 GRAPHICS: New method hasGlyphForBig5Char in big5font 2023-04-29 13:37:45 +02:00
Vladimir Serbinenko bc80106e04 GRAPHICS: Bring on-par Surface and raw draw for big5 font 2023-04-29 13:37:45 +02:00
Thierry Crozat 4b61397acd GRAPHICS: Support bliting CLUT8 Surface in non-CLUT8 ManagedSurface
The inner blitting code already handled that case, but we needed to be able to
pass the Surface palette to that inner code.
2023-04-25 21:44:51 +01:00
Thierry Crozat facb6852b8 GRAPHICS: Fix incorrect assert in ManagedSurface::blitFromInner
When blitting from CLUT8 to another format, we need a palette
for the source surface.
2023-04-25 21:44:51 +01:00
NischayDiwan aaa32cf118 GRAPHICS: Fix scaling for BDF fonts
- The primary change is to fix or improve the scaling of BDF fonts
 - Now uses the same approach as in MacFonts scaling that is creating another surface and refactor it with a grayscalemap
 - Bugs - there are still some problems when testing in capital letters
2023-04-16 21:13:50 +02:00
NischayDiwan 4b83dd78d6 GRAPHICS: Refactor MacFont scaling into reusable methods
- The refactoring code for MacFont that magnifies the font on a surface and then uses a grayscalemap to refactor the scaling, is pushed back into a resuable method in the base font class.
 - surface magnigy funtion transfer and scaleSingleGlyph method add to the font class.
2023-04-16 21:13:50 +02:00
su-xingyu 6ff2212f51 GUI: Fix hard shadow of tabs under HiDPI
Introduce 'shaodwIntensity' to shadow drawing functions
2023-04-15 22:17:27 +02:00
su-xingyu c577b1d616 GUI: Fix hard shadow under HiDPI rendering (#4908) 2023-04-15 02:04:16 +02:00
su-xingyu dc997b22ce GUI: Fix draw-size computation 2023-04-14 16:45:53 +02:00
Matthew Jimenez d456052c4c GRAPHICS: Fix cursor surface when bytes per pixel greater than one 2023-04-10 20:12:41 +02:00
Eugene Sandulenko d2abfe6f8a Revert "Revert "GRAPHICS: Add support for cursor as Surface""
Since the devs already started adapting other engines, this now is problematic.
2023-04-10 12:21:29 +02:00
Eugene Sandulenko 8ac1d007e2 Revert "GRAPHICS: Add support for cursor as Surface"
This reverts commit dd1232325d.

This breaks Windows cursors and was not tested properly.
2023-04-10 11:38:21 +02:00
Miro Kropacek dd1232325d GRAPHICS: Add support for cursor as Surface
This helps engines which pass Surface buffers to replaceCursor() and
pushCursor() while the surface is not guaranteed to have width == pitch.
2023-04-09 13:12:06 +02:00
Cameron Cawley fb2503d02e GUI: Only use a transparent colour for BMP images 2023-04-09 12:54:38 +02:00
Cameron Cawley f5f445be5f GRAPHICS: Add generic versions of applyColorKey() and setAlpha() 2023-04-09 12:49:23 +02:00
Miro Kropacek b2103898a7 GRAPHICS: ATARI: Optionally avoid surface pitch align
Some engines are too bound to linear surfaces in 8bpp that it is very
hard to repair them. So instead of polluting the engine with
Surface::init() & delete[] Surface::getPixels() just use this
workaround.

It is also useful as an early fix for newly found engines which may be
fixable later.
2023-04-07 15:54:28 +02:00
Miro Kropacek 94f9956bc4 GRAPHICS: ATARI: Fix copyBlit() on 040/060
The move16 routine needs not only src/dst aligned on 16 bytes but this
requirement must be honored in every iteration. Sometimes an engine
would pass a 16-byte aligned src (by chance) with srcPitch = 13 for
instance.

The routine above it where srcPitch == dstPitch works because there's
never a second iteration with unaligned pointers.

Also, a bit optimized (precalculated some of the jump offsets).
2023-04-07 12:55:57 +02:00
elasota e99485ae04 GRAPHICS: Only process Win cursor pixels as inverted if they are white and treat any other color with AND mask value 1 as transparent.
Fixes incorrect cursor transparency in Riven.
2023-04-06 21:38:19 +02:00
neuromancer 7a96738168 GRAPHICS: OPENGL: added another setUniform function to set an uniform value in shaders from an array of ints 2023-04-04 20:00:17 +02:00
neuromancer 5d92a98038 FREESCAPE: initial implementation of the opengl shader renderer 2023-04-01 23:12:43 +02:00
Miro Kropacek 6c5e3dbfd5 BACKENDS: ATARI: Refactor 2023-03-25 21:45:50 +01:00
Cameron Cawley ee35a3d268 GRAPHICS: Use standard palettes in ManagedSurface 2023-03-24 21:32:48 +01:00
Scott Percival 14c7756d06 GRAPHICS: MACGUI: Fix edge cases of getMouseWord 2023-03-24 21:27:34 +01:00
Miro Kropacek 06af761337 GRAPHICS: ATARI: Align surface on a 16-byte boundary
Also implement a CPU-based optimization for the 68040 / 68060.
2023-03-20 22:17:25 +01:00
Le Philousophe a2d8d9e4ce GRAPHICS: Fix clipping for circle and rounded squares
Rect::contains expect that bottom right is excluded but circle functions
consider the radius as included.

In addition fix an error in Wu's algorithm for rounded squares.
2023-03-19 17:33:01 +01:00
Eugene Sandulenko 9bb24b21f3 GRAPHICS: Use better rounding for BDF font scaling 2023-03-18 20:18:11 +01:00