widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #08817
Re: [Merge] lp:~widelands-dev/widelands/animation_scaling into lp:widelands
Yep, I'm not really happy with it either, but I don't have a better idea.
I added 2 replies to your comment, please have a look.
Diff comments:
>
> === modified file 'src/graphic/animation.h'
> --- src/graphic/animation.h 2016-10-25 08:14:28 +0000
> +++ src/graphic/animation.h 2016-11-18 17:52:33 +0000
> @@ -57,8 +58,17 @@
> }
>
> /// The dimensions of this animation.
> - virtual uint16_t width() const = 0;
> - virtual uint16_t height() const = 0;
> + virtual float height() const = 0;
This is used by Soldiers to position their health bar etc.
> +
> + /// The size of the animation source images. Use 'percent_from_bottom' to crop the animation.
The unit is %, as the variable name says. I don't know what the unit for scale is, shall we rename it to zoom_scale?
> + virtual Rectf source_rectangle(int percent_from_bottom) const = 0;
> +
> + /// Calculates the destination rectangle for blitting the animation.
> + /// 'position' is where the top left corner of the animation will end up,
> + /// 'source_rect' is the rectangle calculated by source_rectangle,
> + /// 'scale' is the zoom scale.
> + virtual Rectf
> + destination_rectangle(const Vector2f& position, const Rectf& source_rect, float scale) const = 0;
>
> /// The number of animation frames of this animation.
> virtual uint16_t nr_frames() const = 0;
--
https://code.launchpad.net/~widelands-dev/widelands/animation_scaling/+merge/310718
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/animation_scaling.
References