mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-10-01 15:46:17 -04:00
cof: added Duration method
This commit is contained in:
parent
e7c5efe8e4
commit
78404ed56c
@ -14,3 +14,14 @@ func (c *COF) SpeedToFPS() float64 {
|
||||
|
||||
return fps
|
||||
}
|
||||
|
||||
// Duration returns animation's duration
|
||||
func (c *COF) Duration() float64 {
|
||||
const (
|
||||
milliseconds = 1000
|
||||
)
|
||||
|
||||
frameDelay := milliseconds / c.SpeedToFPS()
|
||||
|
||||
return float64(c.FramesPerDirection) * frameDelay
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user