From: Ketmar Dark Date: Sun, 24 Apr 2016 08:45:39 +0000 (+0300) Subject: round aimg frame delays X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=e8f8394426db6b11bc3e15ca60e413fade0b16e1;p=d2df-sdl.git round aimg frame delays --- diff --git a/src/game/g_map.pas b/src/game/g_map.pas index a05a2cf..5bca6b0 100644 --- a/src/game/g_map.pas +++ b/src/game/g_map.pas @@ -473,7 +473,7 @@ var ia: TDynImageDataArray = nil; il: TImageFileFormat = nil; meta: TMetadata = nil; - f: Integer; + f, c: Integer; gf: TGIFFileFormat; pf: TPNGFileFormat; begin @@ -650,7 +650,11 @@ begin //writeln(' frame delay: ', meta.MetaItems[SMetaFrameDelay]); try f := meta.MetaItems[SMetaFrameDelay]; - f := f div 27; + if f < 0 then f := 0; + // rounding ;-) + c := f mod 27; + if c < 13 then c := 0 else c := 1; + f := (f div 27)+c; if f < 1 then f := 1 else if f > 255 then f := 255; _speed := f; except