Test #1
I made vertical gradient background image:


Result:
- SMBX calculating image in real-time render by color-mixing, as you see, appeared a lot of color glitches.
- The PGE applying masks only on image-loading process, and calculated image saving in RAM, and after using always in working process.
Get this test
Test #2
Will be made test with horizontal gradient:


Result:
- SMBX uses Color-Mixing for imitating semi-transparency
- PGE uses a alpha-channel for generating target sprites from masks, and renders real semi-transparency.
Get this test
Test #3
Little programming examples:
For make real test, I got THIS example for Visual Basic 6 (Language, used for made SMBX):
http://www.vbexplorer.com/VBExplorer/gdi1.asp
And I replaced images to my SMBX's sprites:

And build them.
I take this result:

As you see, result is same, what displayed in SMBX.
VisualBasic 6 source, what creating this mask (And I think, this is same method, what uses in SMBX for render sprites)
Code: Select all
Private Sub cmdDrawMask_Click()
'Draws the mask with vbSrcAnd raster operation
BitBlt Me.hDC, 0, 0, picMask.ScaleWidth, picMask.ScaleHeight, picMask.hDC, 0, 0, vbSrcAnd
End Sub
Private Sub cmdDrawSprite_Click()
'Draws the sprite witht the vbSrcPaint raster operation
BitBlt Me.hDC, 0, 0, picSprite.ScaleWidth, picSprite.ScaleHeight, picSprite.hDC, 0, 0, vbSrcPaint
End Sub
In C++ with Qt I using mask for define alpha-channel of image:
https://github.com/Wohlhabend-Networks/ ... cs.cpp#L24
Code: Select all
QPixmap setAlphaMask(QPixmap image, QPixmap mask)
{
if(mask.isNull())
return image;
if(image.isNull())
return image;
QImage target = image.toImage();
QImage newmask = mask.toImage();
if(target.size()!= newmask.size())
{
newmask = newmask.copy(0,0, target.width(), target.height());
}
newmask.invertPixels();
target.setAlphaChannel(newmask);
return QPixmap::fromImage(target);
}
But you must fix all lazy-made sprites (What is this?), what sometimes using in SMBX's custom graphics