mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Add some antialiasing
This commit is contained in:
parent
01aaed54d6
commit
79b10c4d53
1 changed files with 6 additions and 3 deletions
|
@ -82,7 +82,7 @@ public:
|
|||
class WaveAnimation : public Animation {
|
||||
public:
|
||||
void Draw(UIContext &dc, double t, float alpha) override {
|
||||
const uint32_t color = 0x30FFFFFF;
|
||||
const uint32_t color = colorAlpha(0xFFFFFFFF, alpha * 0.2f);
|
||||
const float speed = 1.0;
|
||||
|
||||
Bounds bounds = dc.GetBounds();
|
||||
|
@ -94,10 +94,13 @@ public:
|
|||
float i = x * 1280/bounds.w;
|
||||
|
||||
float wave0 = sin(i*0.005+t*0.8)*0.05 + sin(i*0.002+t*0.25)*0.02 + sin(i*0.001+t*0.3)*0.03 + 0.625;
|
||||
dc.Draw()->RectVGradient(x, wave0*bounds.h, pixel_in_dps_x, (1.0-wave0)*bounds.h, color, 0x00000000);
|
||||
|
||||
float wave1 = sin(i*0.0044+t*0.4)*0.07 + sin(i*0.003+t*0.1)*0.02 + sin(i*0.001+t*0.3)*0.01 + 0.625;
|
||||
dc.Draw()->RectVGradient(x, wave0*bounds.h, pixel_in_dps_x, (1.0-wave0)*bounds.h, color, 0x00000000);
|
||||
dc.Draw()->RectVGradient(x, wave1*bounds.h, pixel_in_dps_x, (1.0-wave1)*bounds.h, color, 0x00000000);
|
||||
|
||||
// Add some "antialiasing"
|
||||
dc.Draw()->RectVGradient(x, wave0*bounds.h-3*pixel_in_dps_y, pixel_in_dps_x, 3*pixel_in_dps_y, 0x00000000, color);
|
||||
dc.Draw()->RectVGradient(x, wave1*bounds.h-3*pixel_in_dps_y, pixel_in_dps_x, 3*pixel_in_dps_y, 0x00000000, color);
|
||||
}
|
||||
|
||||
dc.Flush();
|
||||
|
|
Loading…
Add table
Reference in a new issue