Support for horizontal animated sprites
This commit is contained in:
parent
e1d0817a5b
commit
d48df9756f
|
|
@ -208,12 +208,14 @@ sub LoadAnimatedSprite {
|
||||||
);
|
);
|
||||||
my $surface = $s1->surface();
|
my $surface = $s1->surface();
|
||||||
|
|
||||||
|
my $smallest = ($surface->width() < $surface->height() ? $surface->width() : $surface->height());
|
||||||
|
|
||||||
my $sprite = SDLx::Sprite::Animated->new(
|
my $sprite = SDLx::Sprite::Animated->new(
|
||||||
surface => $surface,
|
surface => $surface,
|
||||||
width => $surface->width(),
|
width => $smallest,
|
||||||
height => $surface->width(),
|
height => $smallest,
|
||||||
step_x => $surface->width(),
|
step_x => $smallest,
|
||||||
step_y => $surface->width(),
|
step_y => $smallest,
|
||||||
);
|
);
|
||||||
if(!$sprite) {
|
if(!$sprite) {
|
||||||
LogData(ERROR, "Unable to load ASprite '$filename': $!");
|
LogData(ERROR, "Unable to load ASprite '$filename': $!");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue