DragonMinded / libdragon

Open source library for N64 development.
https://libdragon.dev
The Unlicense
746 stars 108 forks source link

rdpq_sprite_blit crop doesn't work with flipping #562

Open kannoneer opened 6 months ago

kannoneer commented 6 months ago

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