libdragon icon indicating copy to clipboard operation
libdragon copied to clipboard

rdpq_sprite_blit crop doesn't work with flipping

Open kannoneer opened this issue 8 months ago • 0 comments

I apologize for not having a minimal repro for this but see the example in https://github.com/kannoneer/libdragon/blob/4521ce1bbee1328ba7022a203e33b3de0c85956b/examples/gameloop/gameloop.c#L111

  rdpq_sprite_blit(player_sprite, player.pos.x, player.pos.y, &(rdpq_blitparms_t){
      .s0 = player.frame * PLAYER_SPRITE_SIZE,
      .width = PLAYER_SPRITE_SIZE,
      .flip_x = player.facing == FACING_LEFT
  });

when .flip_x=true the sprite is rendered at a wrong location on x axis.

This is the spritesheet I was trying to display: ninjafrog

kannoneer avatar May 28 '24 21:05 kannoneer