From 6d570e1aac92f03f9491a016cb6e413548ac849f Mon Sep 17 00:00:00 2001 From: Ketmar Dark Date: Sun, 24 Apr 2016 14:41:34 +0300 Subject: [PATCH] wadcvt: creating more corrent apngs --- src/sfs/wadcvt.dpr | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/sfs/wadcvt.dpr b/src/sfs/wadcvt.dpr index 83461a8..5d1c1f1 100644 --- a/src/sfs/wadcvt.dpr +++ b/src/sfs/wadcvt.dpr @@ -25,6 +25,10 @@ uses ImagingTypes, Imaging, ImagingUtility; +{.$WARNINGS ON} +{.$NOTES ON} +{.$HINTS ON} + var optConvertATX: Boolean = false; @@ -33,18 +37,15 @@ function LoadAnimTexture (wadSt: TStream; wadName: AnsiString): TMemoryStream; var WAD: TWADFile = nil; TextureWAD: PChar = nil; - ttw: PChar = nil; TextData: Pointer = nil; TextureData: Pointer = nil; cfg: TConfig = nil; - ResLength, rrl: Integer; + ResLength: Integer; TextureResource: String; _width, _height, _framecount, _speed: Integer; _backanimation: Boolean; - imgfmt: string; ia: TDynImageDataArray = nil; - il: TImageFileFormat = nil; - f, c, frdelay, frloop: Integer; + f: Integer; img: TImageData; x, y, ofsx, ofsy, nx, ny: Integer; clr: TColor32Rec; @@ -134,6 +135,12 @@ begin //writeln('creating ', length(ia), ' animation frames...'); for f := 0 to high(ia) do begin + GlobalMetadata.SetMetaItem(SMetaFrameDelay, _speed*28, f); + if _backanimation then + GlobalMetadata.SetMetaItem(SMetaAnimationLoops, 1, f) + else + GlobalMetadata.SetMetaItem(SMetaAnimationLoops, 0, f); + InitImage(ia[f]); NewImage(_width, _height, TImageFormat.ifA8R8G8B8, ia[f]); ofsx := f*_width; @@ -191,10 +198,12 @@ begin end; +{ procedure processed (count: Cardinal); begin //writeln(' read ', count, ' bytes'); end; +} // returs crc -- 2.29.2