libretro-lutro
libretro-lutro copied to clipboard
Painter updates: scaling (HAVE_SCALING=1) and clip rect on clear
Summary
-
pntr_clear
is now affected by the clip rect, as per the love 2d api documentation. - build with
make HAVE_SCALING=1
to enable scaling inpntr_draw
. (This allows images to be scaled when drawn) - draw offset is applied correctly now (subtracted, not added)
This is great! Thanks for the addition... Would you mind adding a test or an example for this somewhere? Also, I thought some of this was handled by HAVE_COMPOSITION
when drawing images when scaled? Perhaps that was different.
@RobLoach, I've now added a unit test for scaling (test/graphics/scale.lua
). It also tests that image offset is correctly applied (the ox, oy field in love.graphics.draw). Image offset was previously applied incorrectly -- it should be subtracted, not added. There's a nice explanation whhy here.
Also, I thought some of this was handled by HAVE_COMPOSITION when drawing images when scaled?
From the looks of the code, HAVE_COMPOSITION only affects how transparency is resolved. From the README:
make HAVE_COMPOSITION=1` Enables alpha-blending.
By the way, one thing I'm not sure about is how to check from the lua test side of things if lutro was compile with HAVE_TRANSFORM (or HAVE_COMPOSITION). Ideally the scaling test should be skipped if HAVE_COMPOSITION is disabled (or the makefile should ensure that tests are built with both fields enabled somehow).
Hmmm, we could possibly expose something like love.config.transform
or love.config.composition
or something?
This pull request introduces 1 alert when merging e4f931df04ee916d0446b8313bec689e2dfbd699 into 81e078f29795b89d597ab93ebf56d35fe72be99d - view on LGTM.com
new alerts:
- 1 for Local variable hides global variable
Hmmm, we could possibly expose something like
love.config.transform
orlove.config.composition
or something?
Okay, I've added this. See diff in lutro.c
.
@nstbayless Apologies for being away. Is this good to merge???? Looks pretty awesome.
Is this going to be merged?