Commit Graph
3580 Commits
Author SHA1 Message Date
Cameron Cawley 4b2e3e6726 TINYGL: Use realloc to increase the size of the vertex array 2023-02-03 22:06:53 +00:00
Cameron Cawley 320492d442 TINYGL: Use gl_malloc() and gl_free() for the TexelBuffer classes 2023-02-03 18:06:51 +00:00
Cameron Cawley 2773eea09d TINYGL: Move more TexelBuffer code into texelbuffer.cpp 2023-02-03 18:06:51 +00:00
Cameron Cawley 4c1fdb81d5 TINYGL: Make use of ColorMask templates for NearestTexelBuffer 2023-02-03 18:06:51 +00:00
Matthew Duggan eb3aa0077a TINYGL: Fix potential buffer overflow in glMaterialfv
When setting GL_SHININESS via glMaterialfv, the pointer only points to a single
value. Don't read past that.

Reported in github.com/C-Chads/tinygl/pull/20
2023-02-03 21:41:53 +09:00
Cameron Cawley e7c405f933 TINYGL: Remove unused code 2023-02-02 18:54:14 +00:00
Eugene Sandulenko 0722f5e9c0 GRAPHICS: Implemented PixelFormat::isCLUT8() 2023-02-02 19:33:20 +01:00
Le Philousophe bc343edb42 GRAPHICS: Fix BDF font loading
When the character is out of range, just go to the next character.
2023-01-29 13:18:54 +01:00
Le Philousophe b1ebc64c03 GRAPHICS: OPENGL: Free log after using it 2023-01-28 18:44:51 +01:00
Le Philousophe b8f1f64d00 GRAPHICS: Delete archive when it's not needed 2023-01-26 07:42:48 +01:00
Marcus Comstedt 9203d278dd GRAPHICS: Add Latin Extended-A to small GUI font
This fixes incorrectly rendered characters in the about crawler.

The big GUI font was already fixed in commit 20eb91cb.

The following BDF file was used as source:
https://opensource.apple.com/source/X11fonts/X11fonts-14/font-schumacher-misc/font-schumacher-misc-1.1.2/clR6x12.bdf
2023-01-22 19:47:29 +01:00
Vladimir Serbinenko eed26db50d GRAPHICS: Fix riscos compilation with an explicit cast 2023-01-19 10:32:26 +01:00
Donovan Watteau 69a386aff7 GRAPHICS: Fix MSVC C4309 enum sign warning 2023-01-18 21:24:49 +01:00
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