05-09-2022, 08:55 PM
Hi!
Built-in blending tables are created in file Tables.c, in CreateBlendTables() function:
https://github.com/megamarc/Tilengine/bl...bles.c#L20
To add new modes, just expand the public enumeration TLN_Blend here:
https://github.com/megamarc/Tilengine/bl...gine.h#L83
And add the corresponding blend formula in the aforementioned CreateBlendTables() with the desired effect.
For example formula for hypothetical logical AND should be:
Parameters a and b are brightness levels between 0 and 255
Built-in blending tables are created in file Tables.c, in CreateBlendTables() function:
https://github.com/megamarc/Tilengine/bl...bles.c#L20
To add new modes, just expand the public enumeration TLN_Blend here:
https://github.com/megamarc/Tilengine/bl...gine.h#L83
And add the corresponding blend formula in the aforementioned CreateBlendTables() with the desired effect.
For example formula for hypothetical logical AND should be:
Code:
_blend_tables[BLEND_AND][offset] = (a & b);
Parameters a and b are brightness levels between 0 and 255