summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fc76d42)
raw | patch | inline | side by side (parent: fc76d42)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 24 Apr 2016 17:23:07 +0000 (20:23 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sun, 24 Apr 2016 17:23:07 +0000 (20:23 +0300) |
src/sfs/wadcvt.dpr | patch | blob | history |
diff --git a/src/sfs/wadcvt.dpr b/src/sfs/wadcvt.dpr
index af1f8d527845c68afde2fd687790a7c8e8f9bdf6..617edb69ad7cff939dfdb7587aa3af415083d678 100644 (file)
--- a/src/sfs/wadcvt.dpr
+++ b/src/sfs/wadcvt.dpr
optConvertATX: Boolean = false;
optConvertTGA: Boolean = false;
optLoCaseNames: Boolean = false;
+ optAggressivePng: Boolean = false;
+ optRecompress: Boolean = false;
function convertAnimTexture (wadSt: TStream; wadName: AnsiString): TMemoryStream;
sto := TMemoryStream.Create();
//writeln(' ... [', ChangeFileExt(wadName, '.png'), '] (', length(ia), ') ');
+ Imaging.SetOption(ImagingPNGCompressLevel, 9);
+ if optAggressivePng then Imaging.SetOption(ImagingPNGPreFilter, 6);
if SaveMultiImageToStream('png', sto, ia) then
begin
sto.position := 0;
try
GlobalMetadata.CopyLoadedMetaItemsForSaving;
sto := TMemoryStream.Create();
+ Imaging.SetOption(ImagingPNGCompressLevel, 9);
+ if optAggressivePng then Imaging.SetOption(ImagingPNGPreFilter, 6);
if SaveMultiImageToStream('png', sto, ia) then
begin
sto.position := 0;
Halt(1);
end;
+ Imaging.SetOption(ImagingPNGCompressLevel, 9);
+ Imaging.SetOption(ImagingPNGLoadAnimated, 1);
+ Imaging.SetOption(ImagingGIFLoadAnimated, 1);
+
for f := 1 to ParamCount() do
begin
arg := ParamStr(f);
else if arg = '--tga' then optConvertTGA := true
else if arg = '--locase' then optLoCaseNames := true
else if arg = '--nocase' then optLoCaseNames := false
+ else if arg = '--aggressive' then begin optAggressivePng := true; Imaging.SetOption(ImagingPNGPreFilter, 6); end
+ else if arg = '--recompress' then optRecompress := true
else if (arg = '--help') or (arg = '-h') then
begin
writeln('usage: wadcvt [options] file.wad');
Halt(1);
end;
- Imaging.SetOption(ImagingPNGCompressLevel, 9);
- Imaging.SetOption(ImagingPNGLoadAnimated, 1);
- Imaging.SetOption(ImagingGIFLoadAnimated, 1);
-
{$IFNDEF WINDOWS}
optLoCaseNames := true;
{$ENDIF}
{$ENDIF}
end;
end
- else if optConvertTGA and (StrEquCI1251(ExtractFileExt(newname), '.tga') or StrEquCI1251(ExtractFileExt(newname), '.bmp')) then
+ else if optRecompress or (optConvertTGA and (StrEquCI1251(ExtractFileExt(newname), '.tga') or StrEquCI1251(ExtractFileExt(newname), '.bmp'))) then
begin
ast := recompressImageToPng(fs);
if ast <> nil then
newname := fl[f].fPath+newname;
if optLoCaseNames then for c := 1 to length(newname) do newname[c] := LoCase1251(newname[c]);
nfo := ZipOne(fo, newname, fs);
- write('DONE');
+ write(nfo.pksize, ' DONE');
{$IFNDEF ONELINELOG}
writeln;
{$ENDIF}