Commit Graph
3567 Commits
Author SHA1 Message Date
Vladimir Serbinenko 0557535324 GRAPHICS: Support RGB332 in VectorRendererSpec.
This is efficient on RS90
2023-01-12 10:27:20 +03:00
Vladimir Serbinenko b9aa479bba GRAPHICS: Support Floyd dithering for RGB332
RGB332 is a special case of CLUT8 but RGB332 support allows to skip passing
palette explicitly and speeds up the dithering
2023-01-12 10:27:20 +03:00
Vladimir Serbinenko d4111a2f0b GRAPHICS: Use correct pixel size in Normal1x with CLUT8 2023-01-11 19:15:48 +01:00
Cameron Cawley f2d857a882 GRAPHICS: Support more pixel formats with the HQ2x and HQ3x scalers 2023-01-11 12:57:53 +00:00
Cameron Cawley 33675c0b2e GRAPHICS: Fix darkened fills on overlays with alpha bits but no blending 2023-01-11 12:55:52 +00:00
Scott Percival cb68c05dcb GRAPHICS: Loosen palette checks on Surface::convertTo
Surface::ditherFloyd() supports having different palette counts;
as it is a private function wrapped by convertTo(), adjust the
short-circuit check in convertTo() so that the short circuit
happens if both palettes are equal in size and content.
2023-01-10 13:41:53 +01:00
Eugene Sandulenko 4dcfc483e8 GRAPHICS: OPENGL: Do not search shaders in dev environment in release builds 2023-01-05 15:29:33 +01:00
grisenti 2db6ed40b4 TINYGL: reduce memory allocation 2022-12-23 14:04:18 +01:00
grisenti 304a2df165 HPL1: add basic tinygl impl classes 2022-12-23 14:04:03 +01:00
grisenti a8b8b5263f OPENGL: add hpl1 shaders directory in shader class 2022-12-23 14:03:40 +01:00
Cameron Cawley 7f2d9fd0fd GRAPHICS: Split conversion.cpp into multiple files 2022-12-22 23:45:14 +01:00
Cameron Cawley cae08a64c2 GRAPHICS: Optimize TransparentSurface blitting when using alpha-only modulation 2022-12-22 23:08:55 +01:00
Thierry Crozat 31d76cd039 Graphics: Add flipHorizontal to Surface
This complements flipVertical and is needed for the AGS engine.
2022-12-15 22:40:17 +01:00
Cameron Cawley 28d7b361ea COMMON: Move more file format code into common/formats 2022-12-11 22:33:23 +01:00
elasota cc11b531e3 JANITORIAL: Clean up all non-engine Visual Studio warnings. 2022-12-04 00:08:48 +01:00
Eugene Sandulenko fb7095f5a4 COMMON: Move all compression-related files to a separate directory 2022-12-01 11:53:02 +01:00
Donovan Watteau de88d24ef3 GRAPHICS: Fix MSVC C4309 enum sign warning 2022-11-29 01:37:55 +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
sluicebox 74d94f14f1 GRAPHICS: Fix WinFontDirEntry parsing regression
Fixes HUGO1 crash on startup

Incorrect offset introduced in 8cb2e1bb07

https://learn.microsoft.com/en-us/windows/win32/menurc/fontdirentry
2022-11-22 00:30:36 -08:00
Hubert Maier a3ec89bf51 JANITORIAL: GRAPHICS: Correct Spelling Mistake
begining -> beginning
2022-11-15 22:52:43 +02:00
Greg Kennedy 253a0519a7 GRAPHICS: Enable blitting 24bpp sources in managed_surface.cpp
Function `blitFromInner()` excludes source formats with 3 bytes per pixel.  These are commonly returned from opaque full-color image decoders, like JPEG.  This change enables blitting with these source images.

- Add `== 3` to the list of acceptable source formats
- Add READ_UINT24 handling for 3-byte source formats
- Add READ_UINT24 and RGBA conversion for 3-byte destination when blending (copying non-opaque source to 24bpp surface)
2022-11-13 06:46:35 +02:00
sluicebox e3c179e975 GRAPHICS: Fix MacCursor handling of color 255
Fixes bug #13922 where black cursor pixels in the SCI game QFG1VGA-Mac
weren't being drawn. MacCursor uses 255 as its color key but in CRSR
resources 255 is defined as black. CRSR resources use a mask for
transparency so they have no color key. Now 255 is remapped to black.
2022-11-12 19:32:57 -08:00
sluicebox b578f5be7b GRAPHICS: Expose Font leading and descent values
The leading value in Macintosh fonts is the space between lines,
defined as the space between a descent line and the ascent line
below it. Clients need this to draw text and calculate its height
as classic Macintosh did.
2022-11-06 23:05:20 -08: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
Thierry Crozat d3da8a7367 GRAPHICS: Fix undefined behaviour in ManagedSurface blit on opaque target
The color components computation had intermediate results that could overflow
a signed int. So now the computation is done using unsigned int instead, which
prevents the overflow (since the max intermediate value is 255*255*257*257,
which fits in an unsigned int).

Note: I also considered adding an explicit cast to do the uint8 * uint8
operations using uint32, but decided not to as it is not required (there is no
overflow due to integer promotion) and makes the code more difficult to read.
2022-10-31 21:46:22 +00: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
Hubert Maier 535f93cba4 GRAPHICS: Correct spelling mistake
lightening -> lightning
2022-10-27 15:56:06 +02:00
Hubert Maier ffb9342275 GRAPHICS: Correct spelling mistake
lightening -> lightning
2022-10-27 15:56:06 +02:00
Hubert Maier 829c5966fa GRAPHICS: Correct spelling mistake
accomodate -> accommodate
2022-10-27 15:56:05 +02:00
Hubert Maier e086da676d GRAPHICS: Correct spelling mistake
recieve -> receive
2022-10-27 15:56:05 +02:00
Paweł Kołodziejski bf8aa5c5b8 GRAPHICS: TINYGL: Added missing framebuffer class de-allocation 2022-10-27 01:02:32 +02:00
Le Philousophe 94b8f34302 GRAPHICS: Don't use unsafe sprintf and vsprintf 2022-10-23 22:46:19 +02:00
Le Philousophe 3aa220fdb4 GRAPHICS: Don't use unsafe strcat and strcpy 2022-10-23 22:46:19 +02:00
Le Philousophe 82cd971aca OPENGL: Add more texture wrap modes detection 2022-10-16 19:43:05 +02:00
Le Philousophe 884c3aa795 OPENGL: Use the correct index when attribute is added after link 2022-10-09 18:30:29 +02:00
Le Philousophe a205c79a98 OPENGL: Allow to get last call error status 2022-10-09 17:25:35 +02:00
Le Philousophe cb36b46864 OPENGL: Allow loading of raw shader source 2022-10-08 23:39:18 +02:00
Eugene Sandulenko 6f9728c9e8 GRAPHICS: Added doxygen documentation to PM5544 2022-10-08 23:39:18 +02:00
Eugene Sandulenko 37ba3744f7 GRAPHICS: Use proper color names in PM5544 2022-10-08 23:39:18 +02:00
Eugene Sandulenko 8c8b06e908 GRAPHICS: Move PM5544 test pattern drawing to a separate file 2022-10-08 23:39:18 +02:00
Eugene Sandulenko 31100637fa GRAPHICS: OPENGL: Refactor for adding possibility to avoid calling error() directly 2022-10-08 23:39:18 +02:00
Eugene Sandulenko 18c88fabfe GRAPHICS: Add possibility to specify dithering algorithm. Default is Floyd-Steinberg 2022-09-28 23:02:05 +02:00
Eugene Sandulenko ff9313056d GRAPHICS: Implement dithering in Surface::convertTo() 2022-09-28 22:38:08 +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
Roland van Laar b517ab6635 GRAPHICS: MACGUI: Fix memory leak in scaleFont
Free all surfaces after use.
2022-09-20 11:04:58 +02:00