mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 01:48:15 +03:00
Make "[Press ENTER to return to editor]" fade out after a bit
This makes the "[Press ENTER to return to editor]" fade out after a few frames, allowing screenshots of custom levels to be cleaner and to make sure nothing is obscured while the user is editing their level. This commit also adds alpha support in BlitSurfaceColoured, where it takes into account the alpha of the pixel *and* the alpha of the color. `graphics::getRGBA(r,g,b,a)` was added to help with this.
This commit is contained in:
@@ -300,7 +300,11 @@ void BlitSurfaceColoured(
|
||||
Uint32 pixel = ReadPixel(_src, x, y);
|
||||
Uint32 Alpha = pixel & fmt.Amask;
|
||||
Uint32 result = ct.colour & 0x00FFFFFF;
|
||||
DrawPixel(tempsurface, x, y, result | Alpha);
|
||||
Uint32 CTAlpha = ct.colour & fmt.Amask;
|
||||
float div1 = ((Alpha >> 24) / 255.0f);
|
||||
float div2 = ((CTAlpha >> 24) / 255.0f);
|
||||
Uint32 UseAlpha = (div1 * div2) * 255.0f;
|
||||
DrawPixel(tempsurface, x, y, result | (UseAlpha << 24));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user