Commit Graph
26 Commits
Author SHA1 Message Date
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Paul Gilbert 675d67fea1 AGS: Fix crash due to reading outside source bitmap bounds 2021-07-24 11:12:44 -07:00
Paul Gilbert baccbedf50 GRAPHICS: Changed surface classes sizes from uint16 to int16 2021-07-04 18:24:27 -07:00
Paul Gilbert 701396361c AGS: Import of fresh codebase 2021-06-13 21:08:44 -07:00
Thierry Crozat 0a4460ba34 AGS: Optimize non-stretched draw 2021-03-25 01:10:45 +00:00
Thierry Crozat 8f8eebc427 AGS: Optimize blitting
The check on the mask color is now done before decomposing
the color to its RGB values. This avoids doing the decomposition
for the transparent pixels.

Blitting on a surface with the same pixel format now also
skips the color decomposition and directly copies the color
values.
2021-03-25 01:10:45 +00:00
Thierry Crozat a1b36bf0de AGS: Fix rendering some sprites
The original interpreter only checks the mask color on the source
bitmap when blitting sprites. And I checked that if I remove the
check on the destination bitmap I still get the correct result in
all 10 games I tried.

And this check was not properly implemented as if the destination
color was the mask color it was setting the result to the source
color without doing any blending. This caused the cursor in
Resonance to be missing. The reason for that is:
1. The original cursor sprite has alpha set to 0.
2. It creates a transparent (i.e. filled with the mask color)
   intermediate bitmap.
3. The cursor sprite is drawn on this intermediate bitmap with the
   opaque alpha blender that sets the result RGB to the source RGB
   and the result alpha to 255.
4. Then this intermediate bitmap is drawn to the screen with a
   source alpha blender.
The check we had on the destination pixel meant that since it is
the mask color everywhere on the intermediate bitmap, when drawing
the cursor bitmap on it it was simply copying the colors instead of
calling the blender function. As a result the alpha was set to 0
instead of 255. Then in the next step when it was blended using
the source alpha it ended up being completely transparent.
2021-03-21 23:13:05 +00:00
Thierry Crozat 6816c62822 AGS: Fix fully transparent savegame screenshots
If On A Winter's Night, Four Travelers was such as game that
generated fully transparent screenshots. I am not completely
sure why it happens, and the easiest solution was to reset
the alpha byte to 0xff.
2021-03-13 03:28:22 +00:00
Thierry Crozat a2ed9906e4 AGS Cleanup surface creation
The main changce is that create_bitmap() now uses the current
get_color_depth(), as it is supposed to (according to the Allegro
documentation).

Also it remove cases where the surface could be created without the transparent color.
2021-03-10 00:28:29 +00:00
Paul Gilbert f060408108 AGS: Move palettes into Globals 2021-03-07 14:27:20 -08:00
Paul Gilbert 3a3f31cd56 AGS: Move Allegro color.cpp globals to Globals 2021-03-07 08:52:15 -08:00
Thierry Crozat f09cca7ac9 AGS: Fix issues with BITMAP clipping rect
Allegro API to set or get the clipping rect include both the
top-left and bottom-right corners. But internally in the
BITMAP the bottom-right corner is excluded, and is thus one
more that the one in the API functions.

Also ensure that the clipping rect is used by setting the clip
flag to true. The Allegro documentation indicates that it can
be set to false to get better performances, but will result in
your program dying a horrible death if you try to draw beyond
the edges of the bitmap. And by default clip is on. AGS never
turns it off, so just ensure it is set to on in the constructor.
2021-03-07 01:08:21 +00:00
Thierry Crozat d6db4c27ad AGS: Fix off by one error in clipping rect and drawing rect
In allegro both the top-left and bottom-right corners are
included in the rect, but in Common::Rect the bottom-righ
corner is excluded. So we need to add one when creating the
Common::Rect.
2021-03-06 00:51:58 +00:00
Thierry Crozat 1f5a068a0f AGS: Remove obsolete TODO
We did need to skip transparent colors for paletted bitmaps
and this was fixed in a previous commit.
2021-03-05 23:49:12 +00:00
Paul Gilbert 07e998c98d AGS: Fix drawing partially off-screen sprites 2021-03-03 20:25:08 -08:00
Thierry Crozat 6b08906f25 AGS: Remove hack to skip transparent color when blitting to screen
The previous commit to fix skipping transparent colors when
drawing a paletted sprite on paletted bitmap seems to have
fixed the original issue.
2021-03-04 00:19:00 +00:00
Thierry Crozat c1295f90d1 AGS: Fix handling of transparency when drawing paletted sprites
One test case for this is Trilby's Note that now render properly.
2021-03-04 00:19:00 +00:00
Thierry Crozat eccbde5530 AGS: Implement blender modes 2021-03-04 00:19:00 +00:00
Paul Gilbert b8a6375067 AGS: Implement draw clipping rect handling 2021-03-01 18:36:38 -08:00
Thierry Crozat d2bb119824 AGS: Fix drawing tinted sprites 2021-02-23 17:13:26 +00:00
Paul Gilbert 78022b8530 AGS: Fix some compiler warnings 2021-02-22 21:16:38 -08:00
Paul Gilbert a054c12856 AGS: Fix rendering of Mallone in Blackwell Deception 2021-02-22 20:48:18 -08:00
Paul Gilbert 0b3b2a2dc3 AGS: Workaround for pink screen flash during Black Cauldron remake intro 2021-02-22 20:11:08 -08:00
Paul Gilbert 4e173627da AGS: Fix drawing paletted cursors 2021-02-22 19:35:04 -08:00
Paul Gilbert 5bc8d36cb2 AGS: Draw method specific for AGS 2021-02-22 19:19:34 -08:00
Paul Gilbert 675d851476 AGS: Shift BITMAP & Surface into it's own file 2021-02-20 14:37:29 -08:00