Last change
on this file was 3, checked in by chronos, 8 years ago |
- Added: Classes for decoding MAP, CPS, SHP and ENG file formats.
|
File size:
1.2 KB
|
Line | |
---|
1 | unit UCore;
|
---|
2 |
|
---|
3 | {$mode delphi}{$H+}
|
---|
4 |
|
---|
5 | interface
|
---|
6 |
|
---|
7 | uses
|
---|
8 | Classes, SysUtils, FileUtil, UPakFile, UFindFile, UGame;
|
---|
9 |
|
---|
10 | type
|
---|
11 |
|
---|
12 | { TCore }
|
---|
13 |
|
---|
14 | TCore = class(TDataModule)
|
---|
15 | procedure DataModuleCreate(Sender: TObject);
|
---|
16 | procedure DataModuleDestroy(Sender: TObject);
|
---|
17 | private
|
---|
18 | procedure ExtractPakFiles;
|
---|
19 | public
|
---|
20 | Game: TGame;
|
---|
21 | procedure Init;
|
---|
22 | end;
|
---|
23 |
|
---|
24 | var
|
---|
25 | Core: TCore;
|
---|
26 |
|
---|
27 | implementation
|
---|
28 |
|
---|
29 | {$R *.lfm}
|
---|
30 |
|
---|
31 | uses
|
---|
32 | UFormMain;
|
---|
33 |
|
---|
34 | { TCore }
|
---|
35 |
|
---|
36 | procedure TCore.DataModuleCreate(Sender: TObject);
|
---|
37 | begin
|
---|
38 | Game := TGame.Create;
|
---|
39 | end;
|
---|
40 |
|
---|
41 | procedure TCore.DataModuleDestroy(Sender: TObject);
|
---|
42 | begin
|
---|
43 | FreeAndNil(Game);
|
---|
44 | end;
|
---|
45 |
|
---|
46 | procedure TCore.ExtractPakFiles;
|
---|
47 | var
|
---|
48 | PakFile: TPakFile;
|
---|
49 | FindFile: TFindFile;
|
---|
50 | FoundFiles: TStrings;
|
---|
51 | I: Integer;
|
---|
52 | begin
|
---|
53 | PakFile := TPakFile.Create;
|
---|
54 | FindFile := TFindFile.Create(nil);
|
---|
55 | FindFile.Path := '../original';
|
---|
56 | FindFile.FileAttr := [ffaAnyFile];
|
---|
57 | FindFile.FileMask := '*.PAK';
|
---|
58 | FoundFiles := FindFile.SearchForFiles;
|
---|
59 | for I := 0 to FoundFiles.Count - 1 do begin
|
---|
60 | PakFile.Open(FoundFiles[I]);
|
---|
61 | PakFile.ExtractTo('extracted');
|
---|
62 | end;
|
---|
63 | FormMain.Caption := IntToStr(PakFile.Files.Count);
|
---|
64 | end;
|
---|
65 |
|
---|
66 | procedure TCore.Init;
|
---|
67 | begin
|
---|
68 | // ExtractPakFiles
|
---|
69 | Game.IW := $20;
|
---|
70 | Game.LoadData;
|
---|
71 | end;
|
---|
72 |
|
---|
73 | end.
|
---|
74 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.