From a1c2876fb12cfc860044f00210f69a9bdc2cf687 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 20 Sep 2007 10:35:02 +0000 Subject: minor fixes for lazarus build.. forgot file... oops.. :) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@416 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/Ulazjpeg.pas | 118 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 Game/Code/Classes/Ulazjpeg.pas (limited to 'Game/Code/Classes/Ulazjpeg.pas') diff --git a/Game/Code/Classes/Ulazjpeg.pas b/Game/Code/Classes/Ulazjpeg.pas new file mode 100644 index 00000000..1f6d8b99 --- /dev/null +++ b/Game/Code/Classes/Ulazjpeg.pas @@ -0,0 +1,118 @@ +{ Copyright (C) 2003 Mattias Gaertner + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License + for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +} +unit Ulazjpeg; + +{$mode objfpc}{$H+} + +interface + +uses + SysUtils, Classes, FPImage, IntfGraphics, Graphics, FPReadJPEG, FPWriteJPEG; + +type + TJPEGQualityRange = TFPJPEGCompressionQuality; + TJPEGPerformance = TJPEGReadPerformance; + + TJPEGImage = class(TFPImageBitmap) + private + FPerformance: TJPEGPerformance; + FProgressiveEncoding: boolean; + FQuality: TJPEGQualityRange; + protected + procedure InitFPImageReader(ImgReader: TFPCustomImageReader); override; + procedure FinalizeFPImageReader(ImgReader: TFPCustomImageReader); override; + procedure InitFPImageWriter(ImgWriter: TFPCustomImageWriter); override; + public + constructor Create; override; + class function GetFileExtensions: string; override; + class function GetDefaultFPReader: TFPCustomImageReaderClass; override; + class function GetDefaultFPWriter: TFPCustomImageWriterClass; override; + public + property CompressionQuality: TJPEGQualityRange read FQuality write FQuality; + property ProgressiveEncoding: boolean read FProgressiveEncoding; + property Performance: TJPEGPerformance read FPerformance write FPerformance; + end; + +const + DefaultJPEGMimeType = 'image/jpeg'; + + +implementation + + +{ TJPEGImage } + +procedure TJPEGImage.InitFPImageReader(ImgReader: TFPCustomImageReader); +var + JPEGReader: TFPReaderJPEG; +begin + if ImgReader is TFPReaderJPEG then begin + JPEGReader:=TFPReaderJPEG(ImgReader); + JPEGReader.Performance:=Performance; + end; + inherited InitFPImageReader(ImgReader); +end; + +procedure TJPEGImage.FinalizeFPImageReader(ImgReader: TFPCustomImageReader); +var + JPEGReader: TFPReaderJPEG; +begin + if ImgReader is TFPReaderJPEG then begin + JPEGReader:=TFPReaderJPEG(ImgReader); + FProgressiveEncoding:=JPEGReader.ProgressiveEncoding; + end; + inherited FinalizeFPImageReader(ImgReader); +end; + +procedure TJPEGImage.InitFPImageWriter(ImgWriter: TFPCustomImageWriter); +var + JPEGWriter: TFPWriterJPEG; +begin + if ImgWriter is TFPWriterJPEG then begin + JPEGWriter:=TFPWriterJPEG(ImgWriter); + if JPEGWriter<>nil then ; + JPEGWriter.ProgressiveEncoding:=ProgressiveEncoding; + JPEGWriter.CompressionQuality:=CompressionQuality; + end; + inherited InitFPImageWriter(ImgWriter); +end; + +class function TJPEGImage.GetDefaultFPReader: TFPCustomImageReaderClass; +begin + Result:=TFPReaderJPEG; +end; + +class function TJPEGImage.GetDefaultFPWriter: TFPCustomImageWriterClass; +begin + Result:=TFPWriterJPEG; +end; + +constructor TJPEGImage.Create; +begin + inherited Create; + FPerformance:=jpBestQuality; + FProgressiveEncoding:=false; + FQuality:=75; +end; + +class function TJPEGImage.GetFileExtensions: string; +begin + Result:='jpg;jpeg'; +end; + +end. + -- cgit v1.2.3 From 47d6da8f4e8eb47e3c9b26b7d231d91f3cebafd0 Mon Sep 17 00:00:00 2001 From: tobigun Date: Wed, 5 Dec 2007 22:03:49 +0000 Subject: - compatibility changes for fpc 2.2.0 and lazarus 0.9.24. Changes are enabled if {$DEFINE LAZARUS_V0924} and/or {$DEFINE FPC_V220} are defined in switches.inc. - this is a very ugly HACK and should be replaced by something different (not in switches.inc and some sort of {$IF FPC_VERSION > VERSION(2, 2, 0)} git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@672 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/Ulazjpeg.pas | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'Game/Code/Classes/Ulazjpeg.pas') diff --git a/Game/Code/Classes/Ulazjpeg.pas b/Game/Code/Classes/Ulazjpeg.pas index 1f6d8b99..d63ce753 100644 --- a/Game/Code/Classes/Ulazjpeg.pas +++ b/Game/Code/Classes/Ulazjpeg.pas @@ -17,6 +17,7 @@ unit Ulazjpeg; {$mode objfpc}{$H+} +{$I switches.inc} interface @@ -33,9 +34,17 @@ type FProgressiveEncoding: boolean; FQuality: TJPEGQualityRange; protected +{$IFDEF LAZARUS_V0924} + procedure InitFPImageReader(IntfImg: TLazIntfImage; ImgReader: TFPCustomImageReader); override; +{$ELSE} procedure InitFPImageReader(ImgReader: TFPCustomImageReader); override; +{$ENDIF} procedure FinalizeFPImageReader(ImgReader: TFPCustomImageReader); override; +{$IFDEF LAZARUS_V0924} + procedure InitFPImageWriter(IntfImg: TLazIntfImage; ImgWriter: TFPCustomImageWriter); override; +{$ELSE} procedure InitFPImageWriter(ImgWriter: TFPCustomImageWriter); override; +{$ENDIF} public constructor Create; override; class function GetFileExtensions: string; override; @@ -56,15 +65,26 @@ implementation { TJPEGImage } +{$IFDEF LAZARUS_V0924} +procedure TJPEGImage.InitFPImageReader(IntfImg: TLazIntfImage; ImgReader: TFPCustomImageReader); +{$ELSE} procedure TJPEGImage.InitFPImageReader(ImgReader: TFPCustomImageReader); +{$ENDIF} var JPEGReader: TFPReaderJPEG; begin if ImgReader is TFPReaderJPEG then begin JPEGReader:=TFPReaderJPEG(ImgReader); JPEGReader.Performance:=Performance; +{$IFDEF LAZARUS_V0924} + JPEGReader.OnProgress:=@Progress; +{$ENDIF} end; +{$IFDEF LAZARUS_V0924} + inherited InitFPImageReader(IntfImg, ImgReader); +{$ELSE} inherited InitFPImageReader(ImgReader); +{$ENDIF} end; procedure TJPEGImage.FinalizeFPImageReader(ImgReader: TFPCustomImageReader); @@ -78,7 +98,11 @@ begin inherited FinalizeFPImageReader(ImgReader); end; +{$IFDEF LAZARUS_V0924} +procedure TJPEGImage.InitFPImageWriter(IntfImg: TLazIntfImage; ImgWriter: TFPCustomImageWriter); +{$ELSE} procedure TJPEGImage.InitFPImageWriter(ImgWriter: TFPCustomImageWriter); +{$ENDIF} var JPEGWriter: TFPWriterJPEG; begin @@ -87,8 +111,15 @@ begin if JPEGWriter<>nil then ; JPEGWriter.ProgressiveEncoding:=ProgressiveEncoding; JPEGWriter.CompressionQuality:=CompressionQuality; +{$IFDEF LAZARUS_V0924} + JPEGWriter.OnProgress:=@Progress; +{$ENDIF} end; +{$IFDEF LAZARUS_V0924} + inherited InitFPImageWriter(IntfImg, ImgWriter); +{$ELSE} inherited InitFPImageWriter(ImgWriter); +{$ENDIF} end; class function TJPEGImage.GetDefaultFPReader: TFPCustomImageReaderClass; -- cgit v1.2.3 From 7d61a98f807803a337fd12342c29eb0f5f69fc76 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Thu, 20 Dec 2007 03:33:14 +0000 Subject: made USDX function when file paths differ from previous expectations.. ( most of the software was still using hard coded paths ) also added ability to have multiple song directories. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@735 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/Ulazjpeg.pas | 300 +++++++++++++++++++++-------------------- 1 file changed, 151 insertions(+), 149 deletions(-) (limited to 'Game/Code/Classes/Ulazjpeg.pas') diff --git a/Game/Code/Classes/Ulazjpeg.pas b/Game/Code/Classes/Ulazjpeg.pas index d63ce753..003e9ab0 100644 --- a/Game/Code/Classes/Ulazjpeg.pas +++ b/Game/Code/Classes/Ulazjpeg.pas @@ -1,149 +1,151 @@ -{ Copyright (C) 2003 Mattias Gaertner - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License - for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -} -unit Ulazjpeg; - -{$mode objfpc}{$H+} -{$I switches.inc} - -interface - -uses - SysUtils, Classes, FPImage, IntfGraphics, Graphics, FPReadJPEG, FPWriteJPEG; - -type - TJPEGQualityRange = TFPJPEGCompressionQuality; - TJPEGPerformance = TJPEGReadPerformance; - - TJPEGImage = class(TFPImageBitmap) - private - FPerformance: TJPEGPerformance; - FProgressiveEncoding: boolean; - FQuality: TJPEGQualityRange; - protected -{$IFDEF LAZARUS_V0924} - procedure InitFPImageReader(IntfImg: TLazIntfImage; ImgReader: TFPCustomImageReader); override; -{$ELSE} - procedure InitFPImageReader(ImgReader: TFPCustomImageReader); override; -{$ENDIF} - procedure FinalizeFPImageReader(ImgReader: TFPCustomImageReader); override; -{$IFDEF LAZARUS_V0924} - procedure InitFPImageWriter(IntfImg: TLazIntfImage; ImgWriter: TFPCustomImageWriter); override; -{$ELSE} - procedure InitFPImageWriter(ImgWriter: TFPCustomImageWriter); override; -{$ENDIF} - public - constructor Create; override; - class function GetFileExtensions: string; override; - class function GetDefaultFPReader: TFPCustomImageReaderClass; override; - class function GetDefaultFPWriter: TFPCustomImageWriterClass; override; - public - property CompressionQuality: TJPEGQualityRange read FQuality write FQuality; - property ProgressiveEncoding: boolean read FProgressiveEncoding; - property Performance: TJPEGPerformance read FPerformance write FPerformance; - end; - -const - DefaultJPEGMimeType = 'image/jpeg'; - - -implementation - - -{ TJPEGImage } - -{$IFDEF LAZARUS_V0924} -procedure TJPEGImage.InitFPImageReader(IntfImg: TLazIntfImage; ImgReader: TFPCustomImageReader); -{$ELSE} -procedure TJPEGImage.InitFPImageReader(ImgReader: TFPCustomImageReader); -{$ENDIF} -var - JPEGReader: TFPReaderJPEG; -begin - if ImgReader is TFPReaderJPEG then begin - JPEGReader:=TFPReaderJPEG(ImgReader); - JPEGReader.Performance:=Performance; -{$IFDEF LAZARUS_V0924} - JPEGReader.OnProgress:=@Progress; -{$ENDIF} - end; -{$IFDEF LAZARUS_V0924} - inherited InitFPImageReader(IntfImg, ImgReader); -{$ELSE} - inherited InitFPImageReader(ImgReader); -{$ENDIF} -end; - -procedure TJPEGImage.FinalizeFPImageReader(ImgReader: TFPCustomImageReader); -var - JPEGReader: TFPReaderJPEG; -begin - if ImgReader is TFPReaderJPEG then begin - JPEGReader:=TFPReaderJPEG(ImgReader); - FProgressiveEncoding:=JPEGReader.ProgressiveEncoding; - end; - inherited FinalizeFPImageReader(ImgReader); -end; - -{$IFDEF LAZARUS_V0924} -procedure TJPEGImage.InitFPImageWriter(IntfImg: TLazIntfImage; ImgWriter: TFPCustomImageWriter); -{$ELSE} -procedure TJPEGImage.InitFPImageWriter(ImgWriter: TFPCustomImageWriter); -{$ENDIF} -var - JPEGWriter: TFPWriterJPEG; -begin - if ImgWriter is TFPWriterJPEG then begin - JPEGWriter:=TFPWriterJPEG(ImgWriter); - if JPEGWriter<>nil then ; - JPEGWriter.ProgressiveEncoding:=ProgressiveEncoding; - JPEGWriter.CompressionQuality:=CompressionQuality; -{$IFDEF LAZARUS_V0924} - JPEGWriter.OnProgress:=@Progress; -{$ENDIF} - end; -{$IFDEF LAZARUS_V0924} - inherited InitFPImageWriter(IntfImg, ImgWriter); -{$ELSE} - inherited InitFPImageWriter(ImgWriter); -{$ENDIF} -end; - -class function TJPEGImage.GetDefaultFPReader: TFPCustomImageReaderClass; -begin - Result:=TFPReaderJPEG; -end; - -class function TJPEGImage.GetDefaultFPWriter: TFPCustomImageWriterClass; -begin - Result:=TFPWriterJPEG; -end; - -constructor TJPEGImage.Create; -begin - inherited Create; - FPerformance:=jpBestQuality; - FProgressiveEncoding:=false; - FQuality:=75; -end; - -class function TJPEGImage.GetFileExtensions: string; -begin - Result:='jpg;jpeg'; -end; - -end. - +{ Copyright (C) 2003 Mattias Gaertner + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License + for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +} +unit Ulazjpeg; + +{$mode objfpc}{$H+} +{$I switches.inc} + +{$DEFINE LAZARUS_V0924} + +interface + +uses + SysUtils, Classes, FPImage, IntfGraphics, Graphics, FPReadJPEG, FPWriteJPEG; + +type + TJPEGQualityRange = TFPJPEGCompressionQuality; + TJPEGPerformance = TJPEGReadPerformance; + + TJPEGImage = class(TFPImageBitmap) + private + FPerformance: TJPEGPerformance; + FProgressiveEncoding: boolean; + FQuality: TJPEGQualityRange; + protected +{$IFDEF LAZARUS_V0924} + procedure InitFPImageReader(IntfImg: TLazIntfImage; ImgReader: TFPCustomImageReader); override; +{$ELSE} + procedure InitFPImageReader(ImgReader: TFPCustomImageReader); override; +{$ENDIF} + procedure FinalizeFPImageReader(ImgReader: TFPCustomImageReader); override; +{$IFDEF LAZARUS_V0924} + procedure InitFPImageWriter(IntfImg: TLazIntfImage; ImgWriter: TFPCustomImageWriter); override; +{$ELSE} + procedure InitFPImageWriter(ImgWriter: TFPCustomImageWriter); override; +{$ENDIF} + public + constructor Create; override; + class function GetFileExtensions: string; override; + class function GetDefaultFPReader: TFPCustomImageReaderClass; override; + class function GetDefaultFPWriter: TFPCustomImageWriterClass; override; + public + property CompressionQuality: TJPEGQualityRange read FQuality write FQuality; + property ProgressiveEncoding: boolean read FProgressiveEncoding; + property Performance: TJPEGPerformance read FPerformance write FPerformance; + end; + +const + DefaultJPEGMimeType = 'image/jpeg'; + + +implementation + + +{ TJPEGImage } + +{$IFDEF LAZARUS_V0924} +procedure TJPEGImage.InitFPImageReader(IntfImg: TLazIntfImage; ImgReader: TFPCustomImageReader); +{$ELSE} +procedure TJPEGImage.InitFPImageReader(ImgReader: TFPCustomImageReader); +{$ENDIF} +var + JPEGReader: TFPReaderJPEG; +begin + if ImgReader is TFPReaderJPEG then begin + JPEGReader:=TFPReaderJPEG(ImgReader); + JPEGReader.Performance:=Performance; +{$IFDEF LAZARUS_V0924} + JPEGReader.OnProgress:=@Progress; +{$ENDIF} + end; +{$IFDEF LAZARUS_V0924} + inherited InitFPImageReader(IntfImg, ImgReader); +{$ELSE} + inherited InitFPImageReader(ImgReader); +{$ENDIF} +end; + +procedure TJPEGImage.FinalizeFPImageReader(ImgReader: TFPCustomImageReader); +var + JPEGReader: TFPReaderJPEG; +begin + if ImgReader is TFPReaderJPEG then begin + JPEGReader:=TFPReaderJPEG(ImgReader); + FProgressiveEncoding:=JPEGReader.ProgressiveEncoding; + end; + inherited FinalizeFPImageReader(ImgReader); +end; + +{$IFDEF LAZARUS_V0924} +procedure TJPEGImage.InitFPImageWriter(IntfImg: TLazIntfImage; ImgWriter: TFPCustomImageWriter); +{$ELSE} +procedure TJPEGImage.InitFPImageWriter(ImgWriter: TFPCustomImageWriter); +{$ENDIF} +var + JPEGWriter: TFPWriterJPEG; +begin + if ImgWriter is TFPWriterJPEG then begin + JPEGWriter:=TFPWriterJPEG(ImgWriter); + if JPEGWriter<>nil then ; + JPEGWriter.ProgressiveEncoding:=ProgressiveEncoding; + JPEGWriter.CompressionQuality:=CompressionQuality; +{$IFDEF LAZARUS_V0924} + JPEGWriter.OnProgress:=@Progress; +{$ENDIF} + end; +{$IFDEF LAZARUS_V0924} + inherited InitFPImageWriter(IntfImg, ImgWriter); +{$ELSE} + inherited InitFPImageWriter(ImgWriter); +{$ENDIF} +end; + +class function TJPEGImage.GetDefaultFPReader: TFPCustomImageReaderClass; +begin + Result:=TFPReaderJPEG; +end; + +class function TJPEGImage.GetDefaultFPWriter: TFPCustomImageWriterClass; +begin + Result:=TFPWriterJPEG; +end; + +constructor TJPEGImage.Create; +begin + inherited Create; + FPerformance:=jpBestQuality; + FProgressiveEncoding:=false; + FQuality:=75; +end; + +class function TJPEGImage.GetFileExtensions: string; +begin + Result:='jpg;jpeg'; +end; + +end. + -- cgit v1.2.3 From 8d367ca3e9d49fbac6798f5aad0be03f8e5cfeec Mon Sep 17 00:00:00 2001 From: tobigun Date: Thu, 20 Dec 2007 20:12:38 +0000 Subject: removed hard-coded lazarus_v0924 define (why is it in there?) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@736 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/Ulazjpeg.pas | 2 -- 1 file changed, 2 deletions(-) (limited to 'Game/Code/Classes/Ulazjpeg.pas') diff --git a/Game/Code/Classes/Ulazjpeg.pas b/Game/Code/Classes/Ulazjpeg.pas index 003e9ab0..a5271a7e 100644 --- a/Game/Code/Classes/Ulazjpeg.pas +++ b/Game/Code/Classes/Ulazjpeg.pas @@ -19,8 +19,6 @@ unit Ulazjpeg; {$mode objfpc}{$H+} {$I switches.inc} -{$DEFINE LAZARUS_V0924} - interface uses -- cgit v1.2.3 From 5df25a794dd5ba29729574560a1622f77f6b7048 Mon Sep 17 00:00:00 2001 From: tobigun Date: Tue, 5 Feb 2008 16:34:22 +0000 Subject: updated to use the new UConfig.pas git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@825 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/Ulazjpeg.pas | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'Game/Code/Classes/Ulazjpeg.pas') diff --git a/Game/Code/Classes/Ulazjpeg.pas b/Game/Code/Classes/Ulazjpeg.pas index a5271a7e..2414002c 100644 --- a/Game/Code/Classes/Ulazjpeg.pas +++ b/Game/Code/Classes/Ulazjpeg.pas @@ -16,13 +16,15 @@ } unit Ulazjpeg; -{$mode objfpc}{$H+} +{$mode delphi} + {$I switches.inc} interface uses - SysUtils, Classes, FPImage, IntfGraphics, Graphics, FPReadJPEG, FPWriteJPEG; + SysUtils, Classes, FPImage, IntfGraphics, Graphics, FPReadJPEG, FPWriteJPEG, + UConfig; type TJPEGQualityRange = TFPJPEGCompressionQuality; @@ -34,17 +36,17 @@ type FProgressiveEncoding: boolean; FQuality: TJPEGQualityRange; protected -{$IFDEF LAZARUS_V0924} +{$IF LAZARUS_VERSION >= 000009024} // 0.9.24 procedure InitFPImageReader(IntfImg: TLazIntfImage; ImgReader: TFPCustomImageReader); override; {$ELSE} procedure InitFPImageReader(ImgReader: TFPCustomImageReader); override; -{$ENDIF} +{$IFEND} procedure FinalizeFPImageReader(ImgReader: TFPCustomImageReader); override; -{$IFDEF LAZARUS_V0924} +{$IF LAZARUS_VERSION >= 000009024} // 0.9.24 procedure InitFPImageWriter(IntfImg: TLazIntfImage; ImgWriter: TFPCustomImageWriter); override; {$ELSE} procedure InitFPImageWriter(ImgWriter: TFPCustomImageWriter); override; -{$ENDIF} +{$IFEND} public constructor Create; override; class function GetFileExtensions: string; override; @@ -65,26 +67,26 @@ implementation { TJPEGImage } -{$IFDEF LAZARUS_V0924} +{$IF LAZARUS_VERSION >= 000009024} // 0.9.24 procedure TJPEGImage.InitFPImageReader(IntfImg: TLazIntfImage; ImgReader: TFPCustomImageReader); {$ELSE} procedure TJPEGImage.InitFPImageReader(ImgReader: TFPCustomImageReader); -{$ENDIF} +{$IFEND} var JPEGReader: TFPReaderJPEG; begin if ImgReader is TFPReaderJPEG then begin JPEGReader:=TFPReaderJPEG(ImgReader); JPEGReader.Performance:=Performance; -{$IFDEF LAZARUS_V0924} - JPEGReader.OnProgress:=@Progress; -{$ENDIF} +{$IF LAZARUS_VERSION >= 000009024} // 0.9.24 + JPEGReader.OnProgress:=Progress; +{$IFEND} end; -{$IFDEF LAZARUS_V0924} +{$IF LAZARUS_VERSION >= 000009024} // 0.9.24 inherited InitFPImageReader(IntfImg, ImgReader); {$ELSE} inherited InitFPImageReader(ImgReader); -{$ENDIF} +{$IFEND} end; procedure TJPEGImage.FinalizeFPImageReader(ImgReader: TFPCustomImageReader); @@ -98,11 +100,11 @@ begin inherited FinalizeFPImageReader(ImgReader); end; -{$IFDEF LAZARUS_V0924} +{$IF LAZARUS_VERSION >= 000009024} // 0.9.24 procedure TJPEGImage.InitFPImageWriter(IntfImg: TLazIntfImage; ImgWriter: TFPCustomImageWriter); {$ELSE} procedure TJPEGImage.InitFPImageWriter(ImgWriter: TFPCustomImageWriter); -{$ENDIF} +{$IFEND} var JPEGWriter: TFPWriterJPEG; begin @@ -111,15 +113,15 @@ begin if JPEGWriter<>nil then ; JPEGWriter.ProgressiveEncoding:=ProgressiveEncoding; JPEGWriter.CompressionQuality:=CompressionQuality; -{$IFDEF LAZARUS_V0924} - JPEGWriter.OnProgress:=@Progress; -{$ENDIF} +{$IF LAZARUS_VERSION >= 000009024} // 0.9.24 + JPEGWriter.OnProgress:=Progress; +{$IFEND} end; -{$IFDEF LAZARUS_V0924} +{$IF LAZARUS_VERSION >= 000009024} // 0.9.24 inherited InitFPImageWriter(IntfImg, ImgWriter); {$ELSE} inherited InitFPImageWriter(ImgWriter); -{$ENDIF} +{$IFEND} end; class function TJPEGImage.GetDefaultFPReader: TFPCustomImageReaderClass; -- cgit v1.2.3