Changeset 4


Ignore:
Timestamp:
Jan 30, 2016, 12:15:16 AM (8 years ago)
Author:
chronos
Message:
  • Added: Not finished class for loading WSA files.
Location:
trunk
Files:
2 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Dune2.lpi

    r3 r4  
    8282      </Item4>
    8383    </RequiredPackages>
    84     <Units Count="10">
     84    <Units Count="11">
    8585      <Unit0>
    8686        <Filename Value="Dune2.lpr"/>
     
    128128      </Unit8>
    129129      <Unit9>
    130         <Filename Value="UFormat80.pas"/>
     130        <Filename Value="UDecode.pas"/>
    131131        <IsPartOfProject Value="True"/>
    132132      </Unit9>
     133      <Unit10>
     134        <Filename Value="UWsaFile.pas"/>
     135        <IsPartOfProject Value="True"/>
     136      </Unit10>
    133137    </Units>
    134138  </ProjectOptions>
  • trunk/Dune2.lpr

    r3 r4  
    99  Interfaces, // this includes the LCL widgetset
    1010  Forms, UFormMain, UCore, UPakFile, CoolStreaming, Common, TemplateGenerics,
    11   UGame, UFile1, UEngFile, UFormLog, UShpFile, UFormat80
     11  UGame, UFile1, UEngFile, UFormLog, UShpFile, UDecode
    1212  { you can add units after this };
    1313
  • trunk/UGame.pas

    r3 r4  
    66
    77uses
    8   Classes, SysUtils, Graphics, UFile1, UEngFile, UShpFile, UFormat80, Types;
     8  Classes, SysUtils, Graphics, UFile1, UEngFile, UShpFile, UDecode, Types,
     9  UWsaFile;
    910
    1011type
     
    2627    procedure LoadUnits;
    2728    procedure LoadUnitsFile(FileName: string);
     29    procedure LoadWsa;
    2830  public
    2931    Bitmap: TBitmap;
     
    258260  LoadUnitsFile('extracted/DUNE.PAK/PIECES.SHP');
    259261  LoadUnitsFile('extracted/DUNE.PAK/SHAPES.SHP');
    260 
    261 end;
    262 
     262end;
     263
     264procedure TGame.LoadWsa;
     265var
     266  F: TWsaFile;
     267begin
     268  F := TWsaFile.Create;
     269  F.Open('extracted/DUNE.PAK/WIN1.WSA');
     270  F.Free;
     271end;
    263272
    264273procedure TGame.LoadData;
     
    269278  //LoadTexts;
    270279  LoadUnits;
     280  LoadWSA;
    271281end;
    272282
  • trunk/UShpFile.pas

    r3 r4  
    66
    77uses
    8   Classes, SysUtils, Contnrs, Graphics, UFormat80, Types;
     8  Classes, SysUtils, Contnrs, Graphics, UDecode, Types;
    99
    1010type
     
    3939implementation
    4040
    41 function Format20(Source: TByteDynArray): TByteDynArray;
    42 var
    43   D: Byte;
    44   Count: Integer;
    45   SourceIndex: Integer;
    46   DestIndex: Integer;
    47 begin
    48   SourceIndex := 0;
    49   DestIndex := 0;
    50   SetLength(Result, Length(Source));
    51   while SourceIndex < Length(Source) do begin
    52     D := Source[SourceIndex];
    53     Inc(SourceIndex);
    54     if D = 0 then begin
    55       if SourceIndex >= Length(Source) then
    56         Break;
    57       Count := Source[SourceIndex];
    58       if Count = 0 then Break;
    59       Inc(SourceIndex);
    60       if (DestIndex + Count) >= Length(Result) then
    61         SetLength(Result, DestIndex + Count + 1);
    62       FillChar(Result[DestIndex], Count, 0);
    63       Inc(DestIndex, Count);
    64     end else begin
    65       if DestIndex >= Length(Result) then
    66         SetLength(Result, DestIndex + 1);
    67       Result[DestIndex] := D;
    68       Inc(DestIndex);
    69     end;
    70   end;
    71 end;
    7241
    7342{ TShpFileItem }
Note: See TracChangeset for help on using the changeset viewer.