Hiya, as u may already know im currently learning C/C++ properly and coding a few projects as a learn, but i've hit something which i cannot figure out.
frame_to_draw = (int)((special_fx_frames / fx.original_duration) * fx.duration);
basically i have three values here, the number of frames total in an animation, the original length of the animation, and the amount of time left in the animation.
what im trying to do, is work out what frame to draw based on what % thru the animation it is.
(i realise that code would the animation in reverse as duration counts down)
it always returns 0, i know im doing something wrong - just not sure what, maybe i need to chuck a few '*' in or maybe i need to define it as something which allows fractions, either way the value (frame_to_draw) has to be an int.
thanks in advance
frame_to_draw = (int)((special_fx_frames / fx.original_duration) * fx.duration);
basically i have three values here, the number of frames total in an animation, the original length of the animation, and the amount of time left in the animation.
what im trying to do, is work out what frame to draw based on what % thru the animation it is.
(i realise that code would the animation in reverse as duration counts down)
it always returns 0, i know im doing something wrong - just not sure what, maybe i need to chuck a few '*' in or maybe i need to define it as something which allows fractions, either way the value (frame_to_draw) has to be an int.
thanks in advance