Skip to content

Commit c487c28

Browse files
committed
Use alpha blending with bilinear filtering to smooth rotation
1 parent 409dfa6 commit c487c28

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/bird.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,16 @@ void bird_draw(const bird_t *bird)
115115
const int t_offset = bird->color_type * bird->slice_h;
116116
/* Draw the bird sprite with rotation */
117117
rdpq_set_mode_standard();
118-
rdpq_mode_alphacompare(1);
118+
if (bird->rotation != 0.0f && bird->rotation != BIRD_ROTATION_DOWN_DEG)
119+
{
120+
/* Use alpha blending with bilinear filtering to smooth rotation */
121+
rdpq_mode_blender(RDPQ_BLENDER_MULTIPLY);
122+
rdpq_mode_filter(FILTER_BILINEAR);
123+
}
124+
else
125+
{
126+
rdpq_mode_alphacompare(1);
127+
}
119128
rdpq_sprite_blit(bird->sprite, cx, bird_y, &(rdpq_blitparms_t){
120129
.s0 = s_offset,
121130
.t0 = t_offset,

0 commit comments

Comments
 (0)