DEADSOFTWARE

Vampyre Imaging Library updated to latest HEAD
[d2df-sdl.git] / src / lib / vampimg / ImagingPcx.pas
index 257ad76837440f15b948ea27f82e5fe686e83a12..d278542ed188bf86b33f225f9d0595cd67d316fd 100644 (file)
@@ -1,5 +1,4 @@
 {
-  $Id: ImagingPcx.pas 100 2007-06-28 21:09:52Z galfar $
   Vampyre Imaging Library
   by Marek Mauder
   http://imaginglib.sourceforge.net
@@ -44,10 +43,10 @@ type
     to spread).}
   TPCXFileFormat = class(TImageFileFormat)
   protected
+    procedure Define; override;
     function LoadData(Handle: TImagingHandle; var Images: TDynImageDataArray;
       OnlyFirstLevel: Boolean): Boolean; override;
   public
-    constructor Create; override;
     function TestFormat(Handle: TImagingHandle): Boolean; override;
   end;
 
@@ -77,13 +76,11 @@ type
 
 { TPCXFileFormat }
 
-constructor TPCXFileFormat.Create;
+procedure TPCXFileFormat.Define;
 begin
-  inherited Create;
+  inherited;
   FName := SPCXFormatName;
-  FCanLoad := True;
-  FCanSave := False;
-  FIsMultiImageFormat := False;
+  FFeatures := [ffLoad];
 
   AddMasks(SPCXMasks);
 end;
@@ -263,7 +260,7 @@ begin
       else if FileDataFormat = ifMono then
       begin
         // Convert 1bit images to ifIndex8
-        Convert1To8(UncompData, Bits, Width, Height, Hdr.BytesPerLine);
+        Convert1To8(UncompData, Bits, Width, Height, Hdr.BytesPerLine, False);
       end
       else if FileDataFormat = ifIndex2 then
       begin
@@ -271,7 +268,7 @@ begin
         // usually use (from specs, I've never seen one myself) CGA palette
         // which is not array of RGB tripplets. So 2bit PCXs are loaded but
         // their colors would be wrong
-        Convert2To8(UncompData, Bits, Width, Height, Hdr.BytesPerLine);
+        Convert2To8(UncompData, Bits, Width, Height, Hdr.BytesPerLine, False);
       end
       else if FileDataFormat = ifIndex4 then
       begin
@@ -306,7 +303,7 @@ begin
         else if (Hdr.BitsPerPixel = 4) and (Hdr.Planes = 1) then
         begin
           // Convert 4bit images to ifIndex8
-          Convert4To8(UncompData, Bits, Width, Height, Hdr.BytesPerLine);
+          Convert4To8(UncompData, Bits, Width, Height, Hdr.BytesPerLine, False);
         end
       end;