Fix sprite flip property

This commit is contained in:
Ryan Shepherd 2018-10-01 22:53:30 -04:00
parent d03c6d2093
commit 48c2854fa2
2 changed files with 3 additions and 2 deletions

View File

@ -167,7 +167,9 @@ sub FlipSurface {
for(my $y = 0; $y < $src->height(); $y++) { for(my $y = 0; $y < $src->height(); $y++) {
for(my $x = 0; $x < $w; $x++) { for(my $x = 0; $x < $w; $x++) {
my $pixel = $src->get_pixel( $y, $x ); my $pixel = $src->get_pixel( $y, $x );
$dst->set_pixel($y, $w-($x+1), $pixel); my $c = SDL::Video::get_RGBA( $src->format(), $pixel );
my $c2 = SDL::Video::map_RGBA( $dst->format(), @$c );
$dst->set_pixel($y, $w-($x+1), $c2);
} }
} }

View File

@ -1,2 +1 @@
ShowSprite with flip option doesn't work
.vs constructed animated sprites don't respect source image's alpha channel .vs constructed animated sprites don't respect source image's alpha channel