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
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.
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)
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.
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.
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.
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.