source: oup/current/Helper_LevelDB.pas@ 87

Last change on this file since 87 was 86, checked in by alloc, 18 years ago
File size: 39.9 KB
RevLine 
[43]1unit Helper_LevelDB;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7 Dialogs, ComCtrls, StdCtrls, StrUtils;
8
9type
10 TForm_LevelDB = class(TForm)
11 group_progress: TGroupBox;
12 progress: TProgressBar;
13 lbl_progress: TLabel;
14 btn_abortok: TButton;
15 lbl_estimation: TLabel;
16 procedure btn_abortokClick(Sender: TObject);
17 private
18 procedure HandleFile(ext: String; fileid: LongWord; dir_dat2db: Boolean);
19 procedure stop_convert;
20 public
21 procedure CreateDatabase(Source, target: String);
22 procedure CreateLevel(Source, target: String);
23 end;
24
25
26var
27 Form_LevelDB: TForm_LevelDB;
28
29implementation
30
31{$R *.dfm}
32
[46]33uses ABSMain, ABSDecUtil, Main, Functions, Data,
34 OniImgClass, DataStructures, OniDataClass;
[43]35
36type
37 THandler = procedure(fileid: LongWord; dir_dat2db: Boolean);
38
39 TConvertHandlers = record
40 Ext: String[4];
41 needed: Boolean;
42 Handler: THandler;
43 end;
44
45var
46 ConvertHandlers: array of TConvertHandlers;
47 loaded_filename: String;
48 converting: Boolean = False;
49 abort: Boolean = False;
50 DataBase: TABSDatabase;
51 Query: TABSQuery;
52 MimeCoder: TStringFormat_MIME64;
53
54var
55 DatHeader: THeader;
56 FilesHeader: TFilesMap;
57 NamedFilesHeader: TNamedFilesMap;
58 ExtensionsHeader: TExtensionsMap;
59 Stream_Body, Stream_Names: TMemoryStream;
60 Stream_Dat, Stream_Raw, Stream_Sep: TFileStream;
61
62
63
64
65procedure TForm_LevelDB.CreateLevel(Source, target: String);
66var
67 files: LongWord;
68
69 i, j: LongWord;
70 temps, temps2: String;
71 Data, rawdata: Tdata;
72 absolutebegintime, begintime: Double;
73 step: Byte;
74 rawlist: TRawList;
75 extlist: TExtensionsMap;
76 fileinfo: TFileInfo;
77 datlinks: TDatLinks;
78 OniImage: TOniImage;
79 levelid: LongWord;
[56]80 timeformat: TFormatSettings;
[86]81
82 conIndex: Integer;
83 connection: TOniData;
[43]84const
85 steps: Byte = 3;
86
87
88
89
90 procedure DoStep(stepname: String);
91 begin
92 Inc(step);
93 if stepname <> 'FIN' then
94 group_progress.Caption :=
95 'Creating Dat (Step ' + IntToStr(step) + '/' + IntToStr(steps) + ': ' + stepname + ')'
96 else
97 group_progress.Caption := 'Creating Dat (FINISHED)';
98 end;
99
100begin
101
102 //
103 // FILE EXISTS CHECK FÜR DAT/RAW/SEP!!!
104 //
105
[85]106 timeformat.ShortTimeFormat := 'hh:nn:ss';
[56]107 timeformat.LongTimeFormat := 'hh:nn:ss';
108 timeformat.TimeSeparator := ':';
109
[86]110 if CreateDataConnection(Source, ODB_ADB) = nil then
[43]111 begin
112 ShowMessage('Could not connect to .oldb-file');
113 Exit;
114 end;
115 levelid := OniDataConnection.LevelInfo.LevelNumber;
116 levelid := (levelid * 2) * 256 * 256 * 256 + $01;
117 OniImage := TOniImage.Create;
118
119 absolutebegintime := Time;
120
121 Self.Visible := True;
122 Form_Main.Visible := False;
123 step := 0;
124 converting := True;
125 abort := False;
126 btn_abortok.Caption := '&Abort...';
127 btn_abortok.Default := False;
128 absolutebegintime := Time;
129
130 Stream_Body := TMemoryStream.Create;
131 Stream_Names := TMemoryStream.Create;
132 Stream_Dat := TFileStream.Create(target, fmCreate);
133 Stream_Raw := TFileStream.Create(AnsiReplaceStr(target, '.dat', '.raw'), fmCreate);
134 if OniDataConnection.OSisMac then
135 Stream_Sep := TFileStream.Create(AnsiReplaceStr(target, '.dat', '.sep'), fmCreate);
136
137 DoStep('Creating header');
138 progress.Position := 0;
139 lbl_progress.Caption := '';
140 lbl_estimation.Caption := 'Estimated finishing time: unknown';
141 Application.ProcessMessages;
142
143 NamedFilesHeader := TOniDataADB(OniDataConnection).GetNamedFilesMap;
144 extlist := OniDataConnection.GetExtendedExtensionsList;
145 for i := 0 to High(DatHeader.Ident) do
146 DatHeader.Ident[i] := OniDataConnection.LevelInfo.Ident[i];
147 DatHeader.Files := OniDataConnection.GetFilesCount;
148 DatHeader.NamedFiles := Length(NamedFilesHeader);
149 DatHeader.Extensions := Length(extlist);
150 DatHeader.DataAddr := 0;
151 DatHeader.DataSize := 0;
152 DatHeader.NamesAddr := 0;
153 DatHeader.NamesSize := 0;
154 for i := 0 to High(DatHeader.Ident2) do
155 DatHeader.Ident2[i] := 0;
156 SetLength(FilesHeader, DatHeader.Files);
157 SetLength(ExtensionsHeader, DatHeader.Extensions);
158
159 DoStep('Writing extensions-header');
160 progress.Max := Length(OniDataConnection.GetExtensionsList);
161 Application.ProcessMessages;
162
163 for i := 0 to High(ExtensionsHeader) do
164 begin
165 ExtensionsHeader[i].Ident := extlist[i].Ident;
166 ExtensionsHeader[i].Extension := extlist[i].Extension;
167 SetLength(temps, 4);
168 for j := 0 to 3 do
169 temps[j + 1] := ExtensionsHeader[i].Extension[3 - j];
170 ExtensionsHeader[i].ExtCount :=
[46]171 Length(OniDataConnection.GetFilesList(temps, '', False, stIDAsc));
[43]172 progress.Position := i + 1;
173 lbl_progress.Caption := 'Extensions done: ' + IntToStr(i + 1) + '/' +
174 IntToStr(Length(extlist));
175 Application.ProcessMessages;
176 end;
177
178 DoStep('Storing files-data');
179 progress.Position := 0;
180 progress.Max := DatHeader.Files;
181 lbl_progress.Caption := '';
182 lbl_estimation.Caption := 'Estimated finishing time: unknown';
183 Application.ProcessMessages;
184
185 begintime := Time;
186 for i := 0 to DatHeader.Files - 1 do
187 begin
188 fileinfo := OniDataConnection.GetFileInfo(i);
189 for j := 0 to 3 do
190 FilesHeader[i].Extension[j] := fileinfo.Extension[4 - j];
191 if fileinfo.Size > 0 then
192 begin
193 // DatLinks:=;
194 FilesHeader[i].DataAddr := Stream_Body.Size + 8;
195 Data := OniDataConnection.LoadDatFile(i);
196 Data[4] := (levelid) and $FF;
197 Data[5] := (levelid shr 8) and $FF;
198 Data[6] := (levelid shr 16) and $FF;
199 Data[7] := (levelid shr 24) and $FF;
200
201 if (Pos(UpperCase(fileinfo.Extension), UpperCase(raws)) mod 4) = 1 then
202 begin
203 rawlist := OniDataConnection.GetRawList(i);
204 if Length(rawlist) > 0 then
205 begin
206 for j := 0 to High(rawlist) do
207 begin
208 if rawlist[j].raw_size > 0 then
209 begin
210 if (UpperCase(fileinfo.Extension) = 'TXMP') and
211 ((Data[$88] and $01) > 0) then
212 begin
[86]213 OniImage.LoadFromTXMP(Connection, i);
[43]214 OniImage.GetMipMappedImage(rawdata);
215 rawlist[j].raw_size := OniImage.GetImageDataSize(True);
216 Data[$90] := $08;
217 Data[$89] := 32;
218{ if data[$90]<>OniImage.StoreType then begin
219 data[$90]:=OniImage.StoreType;
220 data[$89]:=(data[$89] and $CF) or $20;
221 end;
222} end
223 else
224 begin
225 SetLength(rawdata, rawlist[j].raw_size);
226 OniDataConnection.LoadRawFile(i, rawlist[j].src_offset, @rawdata[0]);
227 end;
228 // data[$88]:=data[$88] and $FE;
229
230 if rawlist[j].loc_sep then
231 begin
232 rawlist[j].raw_addr := Stream_Sep.Size;
233 Stream_Sep.Write(rawdata[0], Length(rawdata));
234 end
235 else
236 begin
237 rawlist[j].raw_addr := Stream_Raw.Size;
238 Stream_Raw.Write(rawdata[0], Length(rawdata));
239 end;
240 end
241 else
242 rawlist[j].raw_addr := 0;
243 Data[rawlist[j].src_offset + 0] := (rawlist[j].raw_addr) and $FF;
244 Data[rawlist[j].src_offset + 1] := (rawlist[j].raw_addr shr 8) and $FF;
245 Data[rawlist[j].src_offset + 2] := (rawlist[j].raw_addr shr 16) and $FF;
246 Data[rawlist[j].src_offset + 3] := (rawlist[j].raw_addr shr 24) and $FF;
247 end;
248 end;
249 end;
250
251 Stream_Body.Write(Data[0], Length(Data));
252 //
253 end
254 else
255 FilesHeader[i].DataAddr := 0;
256 if Length(fileinfo.Name) > 0 then
257 begin
258 FilesHeader[i].NameAddr := Stream_Names.Size;
259 temps := fileinfo.Extension + fileinfo.Name + Chr(0);
260 Stream_Names.Write(temps[1], Length(temps));
261 end
262 else
263 FilesHeader[i].NameAddr := 0;
264 FilesHeader[i].FileSize := fileinfo.Size;
265 FilesHeader[i].FileType := fileinfo.FileType;
266
[58]267 if ((i mod 10) = 0) and (i >= 100) then
268 lbl_estimation.Caption := 'Estimated time left: ' + TimeToStr(
[81]269 (Time - begintime) / i * (progress.Max - i + 1) * 1.1, timeformat );
[43]270 progress.Position := i + 1;
271 lbl_progress.Caption := 'Files done: ' + IntToStr(i + 1) + '/' + IntToStr(progress.Max);
272 Application.ProcessMessages;
273 end;
274
275 Stream_Dat.Write(DatHeader, SizeOf(DatHeader));
276 for i := 0 to High(FilesHeader) do
277 Stream_Dat.Write(FilesHeader[i], SizeOf(FilesHeader[i]));
278 for i := 0 to High(NamedFilesHeader) do
279 Stream_Dat.Write(NamedFilesHeader[i], SizeOf(NamedFilesHeader[i]));
280 for i := 0 to High(ExtensionsHeader) do
281 Stream_Dat.Write(ExtensionsHeader[i], SizeOf(ExtensionsHeader[i]));
282
283 DatHeader.DataSize := Stream_Body.Size;
284 DatHeader.NamesSize := Stream_Names.Size;
285 DatHeader.DataAddr := Stream_Dat.Size;
286 Stream_Body.Seek(0, soFromBeginning);
287 Stream_Dat.CopyFrom(Stream_Body, Stream_Body.Size);
288 DatHeader.NamesAddr := Stream_Dat.Size;
289 Stream_Names.Seek(0, soFromBeginning);
290 Stream_Dat.CopyFrom(Stream_Names, Stream_Names.Size);
291
292 Stream_Dat.Seek(0, soFromBeginning);
293 Stream_Dat.Write(DatHeader, SizeOf(DatHeader));
294
295 Stream_Dat.Free;
296 Stream_Body.Free;
297 Stream_Names.Free;
298 Stream_Raw.Free;
299 if OniDataConnection.OSisMac then
300 Stream_Sep.Free;
301
302 progress.Position := progress.Max;
303 lbl_progress.Caption := 'Files done: ' + IntToStr(progress.Max) + '/' +
304 IntToStr(progress.Max);
[56]305 lbl_estimation.Caption := 'FINISHED (duration: ' + TimeToStr(Time - absolutebegintime, timeformat) + ')';
[43]306
307 DoStep('FIN');
308 btn_abortok.Caption := '&OK';
309 btn_abortok.Default := True;
310
311 OniImage.Free;
312
313 converting := False;
314
[86]315 CloseDataConnection(DataConnections[conIndex]);
[43]316end;
317
318
319
320
321procedure TForm_LevelDB.HandleFile;
322var
323 i: Byte;
324begin
325 for i := 1 to Length(ConvertHandlers) do
326 if UpperCase(ConvertHandlers[i].Ext) = UpperCase(ext) then
327 if ConvertHandlers[i].needed then
328 begin
329 ConvertHandlers[i].Handler(fileid, dir_dat2db);
330 Break;
331 end
332 else
333 Break;
334end;
335
336
337
338
339procedure TForm_LevelDB.CreateDatabase(Source, target: String);
340var
341 i, j: LongWord;
342 temps, temps2: String;
343 Data: Tdata;
344 absolutebegintime, begintime: Double;
345 step: Byte;
346 rawlist: TRawList;
347 extlist: TExtensionsMap;
348 fileinfo: TFileInfo;
[56]349 timeformat: TFormatSettings;
[86]350
351 conIndex: Integer;
[43]352const
353 steps: Byte = 4;
354
355
356
357
358 procedure DoStep(stepname: String);
359 begin
360 Inc(step);
361 if stepname <> 'FIN' then
362 group_progress.Caption :=
363 'Creating DB (Step ' + IntToStr(step) + '/' + IntToStr(steps) + ': ' + stepname + ')'
364 else
365 group_progress.Caption := 'Creating DB (FINISHED)';
366 end;
367
368begin
[86]369 if CreateDataConnection(Source, ODB_Dat) = nil then
[43]370 begin
371 ShowMessage('Could not connect to .dat-file');
372 Exit;
373 end
374 else
375 begin
376 TOniDataDat(OniDataConnection).UnloadWhenUnused := False;
377 end;
378
[85]379 timeformat.LongTimeFormat := 'hh:nn:ss';
380 timeformat.ShortTimeFormat := 'hh:nn:ss';
381 timeformat.TimeSeparator := ':';
382
[43]383 Self.Visible := True;
384 Form_Main.Visible := False;
385 step := 0;
386 converting := True;
387 abort := False;
388 btn_abortok.Caption := '&Abort...';
389 btn_abortok.Default := False;
390 loaded_filename := target;
391
392 absolutebegintime := Time;
393
394 DataBase := TABSDatabase.Create(Self);
395 DataBase.DatabaseName := 'OLDB';
396 DataBase.DatabaseFileName := target;
397 DataBase.CreateDatabase;
398
399 DoStep('Creating tables');
400 progress.Position := 0;
401 lbl_progress.Caption := '';
402 lbl_estimation.Caption := 'Estimated finishing time: unknown';
403 Application.ProcessMessages;
404
405 Query := TABSQuery.Create(Self);
406 Query.DatabaseName := 'OLDB';
407 Query.SQL.Text :=
408 'CREATE TABLE globals ( id AUTOINC PRIMARY KEY, name STRING(128), value STRING(128) );';
409 Query.ExecSQL;
410 Query.SQL.Text :=
411 'CREATE TABLE linkmap ( id AUTOINC PRIMARY KEY, src_id INTEGER, src_link_offset INTEGER, target_id INTEGER );';
412 Query.ExecSQL;
413 Query.SQL.Text :=
414 'CREATE TABLE rawmap ( id AUTOINC PRIMARY KEY, src_id INTEGER, src_link_offset INTEGER, sep BOOLEAN, size INTEGER, data BLOB BlobCompressionMode 9 BlobBlockSize 1024 BlobCompressionAlgorithm ZLib );';
415 // Query.SQL.Text:='CREATE TABLE rawmap ( id AUTOINC PRIMARY KEY, src_id INTEGER, src_link_offset INTEGER, size INTEGER, data BLOB BlobCompressionAlgorithm None );';
416 Query.ExecSQL;
417 Query.SQL.Text :=
418 'CREATE TABLE datfiles ( id INTEGER PRIMARY KEY, extension CHAR(4), name STRING(128), contenttype INTEGER, size INTEGER, data BLOB BlobCompressionMode 9 BlobBlockSize 1024 BlobCompressionAlgorithm ZLib );';
419 // Query.SQL.Text:='CREATE TABLE datfiles ( id INTEGER PRIMARY KEY, extension CHAR(4), name STRING(128), contenttype INTEGER, size INTEGER, data BLOB BlobCompressionAlgorithm None );';
420 Query.ExecSQL;
421 Query.SQL.Text :=
422 'CREATE TABLE extlist ( id AUTOINC PRIMARY KEY, ext CHAR(4), ident CHAR(16) );';
423 Query.ExecSQL;
424
425 Query.SQL.Text := 'INSERT INTO globals (name,value) VALUES ("dbversion","' +
426 dbversion + '");';
427 Query.ExecSQL;
428 SetLength(Data, Length(OniDataConnection.LevelInfo.Ident));
429 for i := 0 to High(OniDataConnection.LevelInfo.Ident) do
430 Data[i] := OniDataConnection.LevelInfo.Ident[i];
431 temps := CreateHexString(Data, True);
432 Query.SQL.Text := 'INSERT INTO globals (name,value) VALUES ("ident","' + temps + '");';
433 Query.ExecSQL;
434 Query.SQL.Text := 'INSERT INTO globals (name,value) VALUES ("lvl","' +
435 IntToStr(OniDataConnection.LevelInfo.LevelNumber) + '");';
436 Query.ExecSQL;
437 if OniDataConnection.OSisMAC then
438 Query.SQL.Text := 'INSERT INTO globals (name,value) VALUES ("os","MAC");'
439 else
440 Query.SQL.Text := 'INSERT INTO globals (name,value) VALUES ("os","PC");';
441 Query.ExecSQL;
442
443 DoStep('Writing extensionslist');
444 progress.Max := Length(OniDataConnection.GetExtensionsList);
445 Application.ProcessMessages;
446
447 extlist := OniDataConnection.GetExtendedExtensionsList;
448 for i := 0 to High(extlist) do
449 begin
450 SetLength(Data, Length(extlist[i].Ident));
451 for j := 0 to High(extlist[i].Ident) do
452 Data[j] := extlist[i].Ident[j];
453 temps := CreateHexString(Data, True);
454 temps2 := extlist[i].Extension[3] + extlist[i].Extension[2] +
455 extlist[i].Extension[1] + extlist[i].Extension[0];
456 Query.SQL.Text := 'INSERT INTO extlist (ext,ident) VALUES ("' +
457 temps2 + '","' + temps + '");';
458 Query.ExecSQL;
459 progress.Position := i;
460 lbl_progress.Caption := 'Extensions done: ' + IntToStr(i) + '/' +
461 IntToStr(Length(extlist));
462 Application.ProcessMessages;
463 if abort then
464 begin
465 stop_convert;
466 Exit;
467 end;
468 end;
469 lbl_progress.Caption := '';
470
471 progress.Position := 0;
472 lbl_progress.Caption := 'Files done: ' + IntToStr(0) + '/' + IntToStr(
473 OniDataConnection.GetFilesCount);
474 lbl_estimation.Caption := 'Estimated finishing time: unknown';
475
476 DoStep('Loading .dat into memory');
477 Application.ProcessMessages;
478
479 progress.Max := OniDataConnection.GetFilesCount;
480 begintime := Time;
481 DoStep('Writing .dat-fileslist');
482 Application.ProcessMessages;
483
484 Database.StartTransaction;
485 for i := 0 to OniDataConnection.GetFilesCount - 1 do
486 begin
487 fileinfo := OniDataConnection.GetFileInfo(i);
488 if (fileinfo.FileType and $02) = 0 then
489 begin
490 mimecoder := TStringFormat_MIME64.Create;
491 Data := OniDataConnection.LoadDatFile(i);
492 Query.SQL.Text :=
493 'INSERT INTO datfiles (id,extension,name,contenttype,size,data) VALUES (' +
494 IntToStr(i) + ',"' + fileinfo.Extension + '","' + fileinfo.Name + '","' + IntToHex(
495 fileinfo.FileType, 8) + '",' + IntToStr(fileinfo.Size) + ',MimeToBin("' +
496 MimeCoder.StrTo(@Data[0], Length(Data)) + '") );';
497 Query.ExecSQL;
498 mimecoder.Free;
499
500 rawlist := OniDataConnection.GetRawList(i);
501 if Length(rawlist) > 0 then
502 begin
503 for j := 0 to High(rawlist) do
504 begin
505 if rawlist[j].raw_size > 0 then
506 begin
507 SetLength(Data, rawlist[j].raw_size);
508 OniDataConnection.LoadRawFile(i, rawlist[j].src_offset, Data);
509 mimecoder := TStringFormat_MIME64.Create;
510 Query.SQL.Text :=
511 'INSERT INTO rawmap (src_id,src_link_offset,sep,size,data) VALUES (' +
512 IntToStr(i) + ',' + IntToStr(rawlist[j].src_offset) + ',' + BoolToStr(
513 rawlist[j].loc_sep) + ',' + IntToStr(rawlist[j].raw_size) + ',MimeToBin("' +
514 MimeCoder.StrTo(@Data[0], rawlist[j].raw_size) + '") );';
515 Query.ExecSQL;
516 mimecoder.Free;
517 end
518 else
519 begin
520 Query.SQL.Text :=
521 'INSERT INTO rawmap (src_id,src_link_offset,sep,size) VALUES (' +
522 IntToStr(i) + ',' + IntToStr(rawlist[j].src_offset) + ',' + BoolToStr(rawlist[j].loc_sep) + ',0);';
523 Query.ExecSQL;
524 end;
525 end;
526 end;
527
528 HandleFile(fileinfo.Extension, i, True);
529 end
530 else
531 begin
532 Query.SQL.Text :=
533 'INSERT INTO datfiles (id,extension,name,contenttype,size) VALUES (' +
534 IntToStr(i) + ',"' + fileinfo.Extension + '","' + fileinfo.Name + '","' + IntToHex(
535 fileinfo.FileType, 8) + '",0);';
536 Query.ExecSQL;
537 end;
538 if ((i mod 100) = 0) and (i > 0) then
539 begin
540 Database.Commit(False);
541 Database.StartTransaction;
542 end;
[58]543 if ((i mod 10) = 0) and (i >= 100) then
544 lbl_estimation.Caption := 'Estimated time left: ' + TimeToStr(
[81]545 (Time - begintime) / i * (progress.Max - i + 1) * 1.1, timeformat );
[43]546 progress.Position := i;
547 lbl_progress.Caption := 'Files done: ' + IntToStr(i) + '/' + IntToStr(progress.Max);
548 Application.ProcessMessages;
549 if abort then
550 begin
551 stop_convert;
552 Exit;
553 end;
554 end;
555 Database.Commit(False);
556 progress.Position := progress.Max;
557 lbl_progress.Caption := 'Files done: ' + IntToStr(progress.Max) + '/' +
558 IntToStr(progress.Max);
559
[56]560 lbl_estimation.Caption := 'FINISHED (duration: ' + TimeToStr(Time - absolutebegintime, timeformat) + ')';
561
[43]562 DoStep('FIN');
563 btn_abortok.Caption := '&OK';
564 btn_abortok.Default := True;
565
566 converting := False;
567
568 database.Close;
569 database.Free;
570
[86]571 CloseDataConnection(DataConnections[conIndex]);
[43]572end;
573
574
575
576
577procedure TForm_LevelDB.stop_convert;
578begin
579 btn_abortok.Caption := '&Close';
580 btn_abortok.Default := True;
581 converting := False;
582 lbl_estimation.Caption := 'ABORTED';
583 group_progress.Caption := 'Creating DB (ABORTED)';
584 DataBase.Close;
585 if MessageBox(Self.Handle, PChar('Delete the unfinished DB-file?'),
586 PChar('Delete file?'), MB_YESNO) = idYes then
587 begin
588 DeleteFile(loaded_filename);
589 end;
590end;
591
592
593
594
595procedure TForm_LevelDB.btn_abortokClick(Sender: TObject);
596begin
597 if converting then
598 begin
599 if MessageBox(Self.Handle,
600 PChar('Do you really want to cancel the convert-progress?'),
601 PChar('Warning: Converting'), MB_YESNO) = idYes then
602 abort := True;
603 end
604 else
605 begin
606 Self.Visible := False;
607 Form_Main.Visible := True;
608 end;
609end;
610
611
612
613
614procedure InsertDatLinkToDB(fileid: LongWord; offset: LongWord);
615var
616 link: LongWord;
617begin
618 OniDataConnection.LoadDatFilePart(fileid, offset, 4, @link);
619 if link = 0 then
620 link := $FFFFFFFF
621 else
622 link := link div 256;
623 Query.SQL.Text := 'INSERT INTO linkmap (src_id,src_link_offset,target_id) VALUES (' +
624 IntToStr(fileid) + ',' + IntToStr(offset) + ',' + IntToStr(link) + ');';
625 Query.ExecSQL;
626end;
627
628
629
630
631procedure AISA(fileid: LongWord; dir_dat2db: Boolean);
632var
633 packages: Word;
634 i: LongWord;
635begin
636 if dir_dat2db then
637 begin
638 OniDataConnection.LoadDatFilePart(fileid, $1E, 2, @packages);
639 if packages > 0 then
640 begin
641 for i := 0 to packages - 1 do
642 InsertDatLinkToDB(fileid, $20 + i * $160 + $28);
643 for i := 0 to packages - 1 do
644 InsertDatLinkToDB(fileid, $20 + i * $160 + $150);
645 end;
646 end
647 else
648 begin
649 end;
650end;
651
652
653
654
655procedure AKEV(fileid: LongWord; dir_dat2db: Boolean);
656var
657 i: LongWord;
658begin
659 if dir_dat2db then
660 begin
661 for i := 0 to 16 do
662 InsertDatLinkToDB(fileid, $8 + i * 4);
663 end
664 else
665 begin
666 end;
667end;
668
669
670
671
672procedure AKOT(fileid: LongWord; dir_dat2db: Boolean);
673var
674 i: LongWord;
675begin
676 if dir_dat2db then
677 begin
678 for i := 0 to 4 do
679 InsertDatLinkToDB(fileid, $8 + i * 4);
680 end
681 else
682 begin
683 end;
684end;
685
686
687
688
689procedure CBPI(fileid: LongWord; dir_dat2db: Boolean);
690var
691 i: LongWord;
692begin
693 if dir_dat2db then
694 begin
695 for i := 0 to 56 do
696 InsertDatLinkToDB(fileid, $8 + i * 4);
697 end
698 else
699 begin
700 end;
701end;
702
703
704
705
706procedure CBPM(fileid: LongWord; dir_dat2db: Boolean);
707var
708 i: LongWord;
709begin
710 if dir_dat2db then
711 begin
712 for i := 0 to 18 do
713 InsertDatLinkToDB(fileid, $8 + i * 4);
714 end
715 else
716 begin
717 end;
718end;
719
720
721
722
723procedure CONS(fileid: LongWord; dir_dat2db: Boolean);
724var
725 i: LongWord;
726begin
727 if dir_dat2db then
728 begin
729 for i := 0 to 1 do
730 InsertDatLinkToDB(fileid, $24 + i * 4);
731 end
732 else
733 begin
734 end;
735end;
736
737
738
739
740procedure CRSA(fileid: LongWord; dir_dat2db: Boolean);
741var
742 packages: LongWord;
743 i: LongWord;
744begin
745 if dir_dat2db then
746 begin
747 OniDataConnection.LoadDatFilePart(fileid, $14, 4, @packages);
748 if packages > 0 then
749 for i := 0 to packages - 1 do
750 InsertDatLinkToDB(fileid, $20 + i * 1100 + $A0);
751 end
752 else
753 begin
754 end;
755end;
756
757
758
759
760procedure DOOR(fileid: LongWord; dir_dat2db: Boolean);
761begin
762 if dir_dat2db then
763 begin
764 InsertDatLinkToDB(fileid, $08);
765 InsertDatLinkToDB(fileid, $10);
766 end
767 else
768 begin
769 end;
770end;
771
772
773
774
775procedure DPGE(fileid: LongWord; dir_dat2db: Boolean);
776begin
777 if dir_dat2db then
778 begin
779 InsertDatLinkToDB(fileid, $40);
780 end
781 else
782 begin
783 end;
784end;
785
786
787
788
789procedure HPGE(fileid: LongWord; dir_dat2db: Boolean);
790begin
791 if dir_dat2db then
792 begin
793 InsertDatLinkToDB(fileid, $0C);
794 end
795 else
796 begin
797 end;
798end;
799
800
801
802
803procedure IGHH(fileid: LongWord; dir_dat2db: Boolean);
804begin
805 if dir_dat2db then
806 begin
807 InsertDatLinkToDB(fileid, $24);
808 InsertDatLinkToDB(fileid, $28);
809 end
810 else
811 begin
812 end;
813end;
814
815
816
817
818procedure IGPA(fileid: LongWord; dir_dat2db: Boolean);
819var
820 links: LongWord;
821 i: LongWord;
822begin
823 if dir_dat2db then
824 begin
825 OniDataConnection.LoadDatFilePart(fileid, $1C, 4, @links);
826 if links > 0 then
827 for i := 0 to links - 1 do
828 InsertDatLinkToDB(fileid, $20 + i * 4);
829 end
830 else
831 begin
832 end;
833end;
834
835
836
837
838procedure IGPG(fileid: LongWord; dir_dat2db: Boolean);
839var
840 i: LongWord;
841begin
842 if dir_dat2db then
843 begin
844 for i := 0 to 1 do
845 InsertDatLinkToDB(fileid, $1C + i * 4);
846 end
847 else
848 begin
849 end;
850end;
851
852
853
854
855procedure IGSA(fileid: LongWord; dir_dat2db: Boolean);
856var
857 links: LongWord;
858 i: LongWord;
859begin
860 if dir_dat2db then
861 begin
862 OniDataConnection.LoadDatFilePart(fileid, $1C, 4, @links);
863 if links > 0 then
864 for i := 0 to links - 1 do
865 InsertDatLinkToDB(fileid, $20 + i * 4);
866 end
867 else
868 begin
869 end;
870end;
871
872
873
874
875procedure IMPT(fileid: LongWord; dir_dat2db: Boolean);
876begin
877 if dir_dat2db then
878 begin
879 InsertDatLinkToDB(fileid, $10);
880 end
881 else
882 begin
883 end;
884end;
885
886
887
888
889procedure IPGE(fileid: LongWord; dir_dat2db: Boolean);
890begin
891 if dir_dat2db then
892 begin
893 InsertDatLinkToDB(fileid, $0C);
894 end
895 else
896 begin
897 end;
898end;
899
900
901
902
903procedure KEYI(fileid: LongWord; dir_dat2db: Boolean);
904var
905 i: LongWord;
906begin
907 if dir_dat2db then
908 begin
909 for i := 0 to 9 do
910 InsertDatLinkToDB(fileid, $08 + i * 4);
911 end
912 else
913 begin
914 end;
915end;
916
917
918
919
920procedure M3GA(fileid: LongWord; dir_dat2db: Boolean);
921var
922 links: LongWord;
923 i: LongWord;
924begin
925 if dir_dat2db then
926 begin
927 OniDataConnection.LoadDatFilePart(fileid, $1C, 4, @links);
928 if links > 0 then
929 for i := 0 to links - 1 do
930 InsertDatLinkToDB(fileid, $20 + i * 4);
931 end
932 else
933 begin
934 end;
935end;
936
937
938
939
940procedure M3GM(fileid: LongWord; dir_dat2db: Boolean);
941var
942 i: LongWord;
943begin
944 if dir_dat2db then
945 begin
946 for i := 0 to 6 do
947 InsertDatLinkToDB(fileid, $0C + i * 4);
948 end
949 else
950 begin
951 end;
952end;
953
954
955
956
957procedure MTRL(fileid: LongWord; dir_dat2db: Boolean);
958begin
959 if dir_dat2db then
960 begin
961 InsertDatLinkToDB(fileid, $10);
962 end
963 else
964 begin
965 end;
966end;
967
968
969
970
971procedure OBDC(fileid: LongWord; dir_dat2db: Boolean);
972var
973 packages: Word;
974 i: LongWord;
975begin
976 if dir_dat2db then
977 begin
978 OniDataConnection.LoadDatFilePart(fileid, $1E, 2, @packages);
979 if packages > 0 then
980 for i := 0 to packages - 1 do
981 InsertDatLinkToDB(fileid, $20 + i * $18 + $4);
982 end
983 else
984 begin
985 end;
986end;
987
988
989
990
991procedure OBOA(fileid: LongWord; dir_dat2db: Boolean);
992var
993 packages: Word;
994 i: LongWord;
995begin
996 if dir_dat2db then
997 begin
998 OniDataConnection.LoadDatFilePart(fileid, $1E, 2, @packages);
999 if packages > 0 then
1000 for i := 0 to packages - 1 do
1001 begin
1002 InsertDatLinkToDB(fileid, $20 + i * 240 + $0);
1003 InsertDatLinkToDB(fileid, $20 + i * 240 + $4);
1004 InsertDatLinkToDB(fileid, $20 + i * 240 + $8);
1005 end;
1006 end
1007 else
1008 begin
1009 end;
1010end;
1011
1012
1013
1014
1015procedure OFGA(fileid: LongWord; dir_dat2db: Boolean);
1016var
1017 packages: LongWord;
1018 i: LongWord;
1019begin
1020 if dir_dat2db then
1021 begin
1022 OniDataConnection.LoadDatFilePart(fileid, $1C, 4, @packages);
1023 if packages > 0 then
1024 for i := 0 to packages - 1 do
1025 InsertDatLinkToDB(fileid, $20 + i * 12 + $04);
1026 end
1027 else
1028 begin
1029 end;
1030end;
1031
1032
1033
1034
1035procedure ONCC(fileid: LongWord; dir_dat2db: Boolean);
1036var
1037 i: LongWord;
1038begin
1039 if dir_dat2db then
1040 begin
1041 InsertDatLinkToDB(fileid, $28);
1042 InsertDatLinkToDB(fileid, $434);
1043 InsertDatLinkToDB(fileid, $438);
1044 InsertDatLinkToDB(fileid, $43C);
1045 InsertDatLinkToDB(fileid, $C3C);
1046 InsertDatLinkToDB(fileid, $C40);
1047 InsertDatLinkToDB(fileid, $C44);
1048 InsertDatLinkToDB(fileid, $C48);
1049 InsertDatLinkToDB(fileid, $C88);
1050 InsertDatLinkToDB(fileid, $C8C);
1051 end
1052 else
1053 begin
1054 end;
1055end;
1056
1057
1058
1059
1060procedure ONCV(fileid: LongWord; dir_dat2db: Boolean);
1061begin
1062 if dir_dat2db then
1063 begin
1064 InsertDatLinkToDB(fileid, $08);
1065 end
1066 else
1067 begin
1068 end;
1069end;
1070
1071
1072
1073
1074procedure ONLV(fileid: LongWord; dir_dat2db: Boolean);
1075var
1076 i: LongWord;
1077begin
1078 if dir_dat2db then
1079 begin
1080 for i := 0 to 5 do
1081 InsertDatLinkToDB(fileid, $48 + i * 4);
1082 for i := 0 to 5 do
1083 InsertDatLinkToDB(fileid, $64 + i * 4);
1084 InsertDatLinkToDB(fileid, $300);
1085 end
1086 else
1087 begin
1088 end;
1089end;
1090
1091
1092
1093
1094procedure ONOA(fileid: LongWord; dir_dat2db: Boolean);
1095var
1096 packages: LongWord;
1097 i: LongWord;
1098begin
1099 if dir_dat2db then
1100 begin
1101 OniDataConnection.LoadDatFilePart(fileid, $1C, 4, @packages);
1102 if packages > 0 then
1103 for i := 0 to packages - 1 do
1104 InsertDatLinkToDB(fileid, $20 + i * 8 + $04);
1105 end
1106 else
1107 begin
1108 end;
1109end;
1110
1111
1112
1113
1114procedure ONSK(fileid: LongWord; dir_dat2db: Boolean);
1115begin
1116 if dir_dat2db then
1117 begin
1118 InsertDatLinkToDB(fileid, $08);
1119 InsertDatLinkToDB(fileid, $0C);
1120 InsertDatLinkToDB(fileid, $10);
1121 InsertDatLinkToDB(fileid, $14);
1122 InsertDatLinkToDB(fileid, $18);
1123 InsertDatLinkToDB(fileid, $20);
1124 InsertDatLinkToDB(fileid, $44);
1125 end
1126 else
1127 begin
1128 end;
1129end;
1130
1131
1132
1133
1134procedure ONVL(fileid: LongWord; dir_dat2db: Boolean);
1135var
1136 packages: LongWord;
1137 i: LongWord;
1138begin
1139 if dir_dat2db then
1140 begin
1141 OniDataConnection.LoadDatFilePart(fileid, $1C, 4, @packages);
1142 if packages > 0 then
1143 for i := 0 to packages - 1 do
1144 InsertDatLinkToDB(fileid, $20 + i * 4);
1145 end
1146 else
1147 begin
1148 end;
1149end;
1150
1151
1152
1153
1154procedure ONWC(fileid: LongWord; dir_dat2db: Boolean);
1155begin
1156 if dir_dat2db then
1157 begin
1158 InsertDatLinkToDB(fileid, $28);
1159 InsertDatLinkToDB(fileid, $34);
1160 InsertDatLinkToDB(fileid, $40);
1161 InsertDatLinkToDB(fileid, $54);
1162 InsertDatLinkToDB(fileid, $58);
1163 InsertDatLinkToDB(fileid, $5C);
1164 InsertDatLinkToDB(fileid, $60);
1165 InsertDatLinkToDB(fileid, $6FC);
1166 InsertDatLinkToDB(fileid, $700);
1167 end
1168 else
1169 begin
1170 end;
1171end;
1172
1173
1174
1175
1176procedure OPGE(fileid: LongWord; dir_dat2db: Boolean);
1177begin
1178 if dir_dat2db then
1179 begin
1180 InsertDatLinkToDB(fileid, $0C);
1181 end
1182 else
1183 begin
1184 end;
1185end;
1186
1187
1188
1189
1190procedure PSPC(fileid: LongWord; dir_dat2db: Boolean);
1191begin
1192 if dir_dat2db then
1193 begin
1194 InsertDatLinkToDB(fileid, $50);
1195 end
1196 else
1197 begin
1198 end;
1199end;
1200
1201
1202
1203
1204procedure PSPL(fileid: LongWord; dir_dat2db: Boolean);
1205var
1206 packages: LongWord;
1207 i: LongWord;
1208begin
1209 if dir_dat2db then
1210 begin
1211 OniDataConnection.LoadDatFilePart(fileid, $1C, 4, @packages);
1212 if packages > 0 then
1213 for i := 0 to packages - 1 do
1214 InsertDatLinkToDB(fileid, $20 + i * 8 + $4);
1215 end
1216 else
1217 begin
1218 end;
1219end;
1220
1221
1222
1223
1224procedure PSUI(fileid: LongWord; dir_dat2db: Boolean);
1225var
1226 i: LongWord;
1227begin
1228 if dir_dat2db then
1229 begin
1230 for i := 0 to 43 do
1231 InsertDatLinkToDB(fileid, $08 + i * 4);
1232 end
1233 else
1234 begin
1235 end;
1236end;
1237
1238
1239
1240
1241procedure STNA(fileid: LongWord; dir_dat2db: Boolean);
1242var
1243 packages: Word;
1244 i: LongWord;
1245begin
1246 if dir_dat2db then
1247 begin
1248 OniDataConnection.LoadDatFilePart(fileid, $1E, 2, @packages);
1249 if packages > 0 then
1250 for i := 0 to packages - 1 do
1251 InsertDatLinkToDB(fileid, $20 + i * 4);
1252 end
1253 else
1254 begin
1255 end;
1256end;
1257
1258
1259
1260
1261procedure TRAC(fileid: LongWord; dir_dat2db: Boolean);
1262var
1263 packages: Word;
1264 i: LongWord;
1265begin
1266 if dir_dat2db then
1267 begin
1268 InsertDatLinkToDB(fileid, $18);
1269 OniDataConnection.LoadDatFilePart(fileid, $1E, 2, @packages);
1270 if packages > 0 then
1271 for i := 0 to packages - 1 do
1272 InsertDatLinkToDB(fileid, $20 + i * 12 + 8);
1273 end
1274 else
1275 begin
1276 end;
1277end;
1278
1279
1280
1281
1282procedure TRAM(fileid: LongWord; dir_dat2db: Boolean);
1283begin
1284 if dir_dat2db then
1285 begin
1286 InsertDatLinkToDB(fileid, $40);
1287 InsertDatLinkToDB(fileid, $44);
1288 end
1289 else
1290 begin
1291 end;
1292end;
1293
1294
1295
1296
1297procedure TRAS(fileid: LongWord; dir_dat2db: Boolean);
1298begin
1299 if dir_dat2db then
1300 begin
1301 InsertDatLinkToDB(fileid, $08);
1302 end
1303 else
1304 begin
1305 end;
1306end;
1307
1308
1309
1310
1311procedure TRBS(fileid: LongWord; dir_dat2db: Boolean);
1312var
1313 i: LongWord;
1314begin
1315 if dir_dat2db then
1316 begin
1317 for i := 0 to 4 do
1318 InsertDatLinkToDB(fileid, $08 + i * 4);
1319 end
1320 else
1321 begin
1322 end;
1323end;
1324
1325
1326
1327
1328procedure TRCM(fileid: LongWord; dir_dat2db: Boolean);
1329var
1330 i: LongWord;
1331begin
1332 if dir_dat2db then
1333 begin
1334 for i := 0 to 2 do
1335 InsertDatLinkToDB(fileid, $5C + i * 4);
1336 end
1337 else
1338 begin
1339 end;
1340end;
1341
1342
1343
1344
1345procedure TRGA(fileid: LongWord; dir_dat2db: Boolean);
1346var
1347 i: LongWord;
1348 packages: Word;
1349begin
1350 if dir_dat2db then
1351 begin
1352 OniDataConnection.LoadDatFilePart(fileid, $1E, 2, @packages);
1353 if packages > 0 then
1354 for i := 0 to packages - 1 do
1355 InsertDatLinkToDB(fileid, $20 + i * 4);
1356 end
1357 else
1358 begin
1359 end;
1360end;
1361
1362
1363
1364
1365procedure TRGE(fileid: LongWord; dir_dat2db: Boolean);
1366begin
1367 if dir_dat2db then
1368 begin
1369 InsertDatLinkToDB(fileid, $20);
1370 end
1371 else
1372 begin
1373 end;
1374end;
1375
1376
1377
1378
1379procedure TRIG(fileid: LongWord; dir_dat2db: Boolean);
1380begin
1381 if dir_dat2db then
1382 begin
1383 InsertDatLinkToDB(fileid, $18);
1384 InsertDatLinkToDB(fileid, $24);
1385 InsertDatLinkToDB(fileid, $28);
1386 end
1387 else
1388 begin
1389 end;
1390end;
1391
1392
1393
1394
1395procedure TRMA(fileid: LongWord; dir_dat2db: Boolean);
1396var
1397 i: LongWord;
1398 packages: Word;
1399begin
1400 if dir_dat2db then
1401 begin
1402 OniDataConnection.LoadDatFilePart(fileid, $1E, 2, @packages);
1403 if packages > 0 then
1404 for i := 0 to packages - 1 do
1405 InsertDatLinkToDB(fileid, $20 + i * 4);
1406 end
1407 else
1408 begin
1409 end;
1410end;
1411
1412
1413
1414
1415procedure TRSC(fileid: LongWord; dir_dat2db: Boolean);
1416var
1417 i: LongWord;
1418 packages: Word;
1419begin
1420 if dir_dat2db then
1421 begin
1422 OniDataConnection.LoadDatFilePart(fileid, $1E, 2, @packages);
1423 if packages > 0 then
1424 for i := 0 to packages - 1 do
1425 InsertDatLinkToDB(fileid, $20 + i * 4);
1426 end
1427 else
1428 begin
1429 end;
1430end;
1431
1432
1433
1434
1435procedure TSFF(fileid: LongWord; dir_dat2db: Boolean);
1436var
1437 i: LongWord;
1438 packages: LongWord;
1439begin
1440 if dir_dat2db then
1441 begin
1442 OniDataConnection.LoadDatFilePart(fileid, $1C, 4, @packages);
1443 if packages > 0 then
1444 for i := 0 to packages - 1 do
1445 InsertDatLinkToDB(fileid, $20 + i * 4);
1446 end
1447 else
1448 begin
1449 end;
1450end;
1451
1452
1453
1454
1455procedure TSFT(fileid: LongWord; dir_dat2db: Boolean);
1456begin
1457 if dir_dat2db then
1458 begin
1459 InsertDatLinkToDB(fileid, $1C);
1460 end
1461 else
1462 begin
1463 end;
1464end;
1465
1466
1467
1468
1469procedure TURR(fileid: LongWord; dir_dat2db: Boolean);
1470begin
1471 if dir_dat2db then
1472 begin
1473 InsertDatLinkToDB(fileid, $60);
1474 InsertDatLinkToDB(fileid, $6C);
1475 InsertDatLinkToDB(fileid, $74);
1476 end
1477 else
1478 begin
1479 end;
1480end;
1481
1482
1483
1484
1485procedure TXAN(fileid: LongWord; dir_dat2db: Boolean);
1486var
1487 i: LongWord;
1488 packages: LongWord;
1489begin
1490 if dir_dat2db then
1491 begin
1492 OniDataConnection.LoadDatFilePart(fileid, $1C, 4, @packages);
1493 if packages > 0 then
1494 for i := 0 to packages - 1 do
1495 InsertDatLinkToDB(fileid, $20 + i * 4);
1496 end
1497 else
1498 begin
1499 end;
1500end;
1501
1502
1503
1504
1505procedure TXMA(fileid: LongWord; dir_dat2db: Boolean);
1506var
1507 i: LongWord;
1508 packages: LongWord;
1509begin
1510 if dir_dat2db then
1511 begin
1512 OniDataConnection.LoadDatFilePart(fileid, $1C, 4, @packages);
1513 if packages > 0 then
1514 for i := 0 to packages - 1 do
1515 InsertDatLinkToDB(fileid, $20 + i * 4);
1516 end
1517 else
1518 begin
1519 end;
1520end;
1521
1522
1523
1524
1525procedure TXMB(fileid: LongWord; dir_dat2db: Boolean);
1526var
1527 i: LongWord;
1528 packages: LongWord;
1529begin
1530 if dir_dat2db then
1531 begin
1532 OniDataConnection.LoadDatFilePart(fileid, $1C, 4, @packages);
1533 if packages > 0 then
1534 for i := 0 to packages - 1 do
1535 InsertDatLinkToDB(fileid, $20 + i * 4);
1536 end
1537 else
1538 begin
1539 end;
1540end;
1541
1542
1543
1544
1545procedure TXMP(fileid: LongWord; dir_dat2db: Boolean);
1546begin
1547 if dir_dat2db then
1548 begin
1549 InsertDatLinkToDB(fileid, $94);
1550 InsertDatLinkToDB(fileid, $98);
1551 end
1552 else
1553 begin
1554 end;
1555end;
1556
1557
1558
1559
1560procedure TXTC(fileid: LongWord; dir_dat2db: Boolean);
1561begin
1562 if dir_dat2db then
1563 begin
1564 InsertDatLinkToDB(fileid, $08);
1565 end
1566 else
1567 begin
1568 end;
1569end;
1570
1571
1572
1573
1574procedure WMCL(fileid: LongWord; dir_dat2db: Boolean);
1575var
1576 i: LongWord;
1577 packages: LongWord;
1578begin
1579 if dir_dat2db then
1580 begin
1581 OniDataConnection.LoadDatFilePart(fileid, $1C, 4, @packages);
1582 if packages > 0 then
1583 for i := 0 to packages - 1 do
1584 InsertDatLinkToDB(fileid, $20 + i * 8 + $4);
1585 end
1586 else
1587 begin
1588 end;
1589end;
1590
1591
1592
1593
1594procedure WMDD(fileid: LongWord; dir_dat2db: Boolean);
1595var
1596 i: LongWord;
1597 packages: LongWord;
1598begin
1599 if dir_dat2db then
1600 begin
1601 OniDataConnection.LoadDatFilePart(fileid, $11C, 4, @packages);
1602 if packages > 0 then
1603 for i := 0 to packages - 1 do
1604 InsertDatLinkToDB(fileid, $120 + i * $124 + $114);
1605 end
1606 else
1607 begin
1608 end;
1609end;
1610
1611
1612
1613
1614procedure WMMB(fileid: LongWord; dir_dat2db: Boolean);
1615var
1616 i: LongWord;
1617 packages: LongWord;
1618begin
1619 if dir_dat2db then
1620 begin
1621 OniDataConnection.LoadDatFilePart(fileid, $1C, 4, @packages);
1622 if packages > 0 then
1623 for i := 0 to packages - 1 do
1624 InsertDatLinkToDB(fileid, $20 + i * 4);
1625 end
1626 else
1627 begin
1628 end;
1629end;
1630
1631
1632
1633
1634procedure WPGE(fileid: LongWord; dir_dat2db: Boolean);
1635begin
1636 if dir_dat2db then
1637 begin
1638 InsertDatLinkToDB(fileid, $08);
1639 InsertDatLinkToDB(fileid, $0C);
1640 end
1641 else
1642 begin
1643 end;
1644end;
1645
1646
1647
1648
1649procedure InsertHandler(ext: String; needed: Boolean; handler: THandler);
1650begin
1651 SetLength(ConvertHandlers, Length(ConvertHandlers) + 1);
1652 ConvertHandlers[High(ConvertHandlers)].Ext := ext;
1653 ConvertHandlers[High(ConvertHandlers)].needed := needed;
1654 ConvertHandlers[High(ConvertHandlers)].handler := handler;
1655end;
1656
1657begin
1658 InsertHandler('ABNA', False, nil);
1659 // InsertHandler('AGDB',True,AGDB);
1660 InsertHandler('AGDB', False, nil);
1661 InsertHandler('AGQC', False, nil);
1662 InsertHandler('AGQG', False, nil);
1663 InsertHandler('AGQR', False, nil);
1664 InsertHandler('AISA', True, AISA);
1665 InsertHandler('AITR', False, nil);
1666 InsertHandler('AKAA', False, nil);
1667 InsertHandler('AKBA', False, nil);
1668 InsertHandler('AKBP', False, nil);
1669 InsertHandler('AKDA', False, nil);
1670 InsertHandler('AKEV', True, AKEV);
1671 InsertHandler('AKOT', True, AKOT);
1672 InsertHandler('AKVA', False, nil);
1673 InsertHandler('BINA', False, nil);
1674 InsertHandler('CBPI', True, CBPI);
1675 InsertHandler('CBPM', True, CBPM);
1676 InsertHandler('CONS', True, CONS);
1677 InsertHandler('CRSA', True, CRSA);
1678 InsertHandler('DOOR', True, DOOR);
1679 InsertHandler('DPGE', True, DPGE);
1680 InsertHandler('ENVP', False, nil);
1681 InsertHandler('FILM', False, nil);
1682 InsertHandler('HPGE', True, HPGE);
1683 InsertHandler('IDXA', False, nil);
1684 InsertHandler('IGHH', True, IGHH);
1685 InsertHandler('IGPA', True, IGPA);
1686 InsertHandler('IGPG', True, IGPG);
1687 InsertHandler('IGSA', True, IGSA);
1688 InsertHandler('IMPT', True, IMPT);
1689 InsertHandler('IPGE', True, IPGE);
1690 InsertHandler('KEYI', True, KEYI);
1691 InsertHandler('M3GA', True, M3GA);
1692 InsertHandler('M3GM', True, M3GM);
1693 InsertHandler('MTRL', True, MTRL);
1694 InsertHandler('OBAN', False, nil);
1695 InsertHandler('OBDC', True, OBDC);
1696 InsertHandler('OBOA', True, OBOA);
1697 InsertHandler('OFGA', True, OFGA);
1698 InsertHandler('ONCC', True, ONCC);
1699 InsertHandler('ONCP', False, nil);
1700 InsertHandler('ONCV', True, ONCV);
1701 InsertHandler('ONFA', False, nil);
1702 InsertHandler('ONGS', False, nil);
1703 InsertHandler('ONIA', False, nil);
1704 InsertHandler('ONLD', False, nil);
1705 InsertHandler('ONLV', True, ONLV);
1706 InsertHandler('ONMA', False, nil);
1707 InsertHandler('ONOA', True, ONOA);
1708 InsertHandler('ONSA', False, nil);
1709 InsertHandler('ONSK', True, ONSK);
1710 InsertHandler('ONTA', False, nil);
1711 InsertHandler('ONVL', True, ONVL);
1712 InsertHandler('ONWC', True, ONWC);
1713 InsertHandler('OPGE', True, OPGE);
1714 InsertHandler('OSBD', False, nil);
1715 InsertHandler('OTIT', False, nil);
1716 InsertHandler('OTLF', False, nil);
1717 InsertHandler('PLEA', False, nil);
1718 InsertHandler('PNTA', False, nil);
1719 InsertHandler('PSPC', True, PSPC);
1720 InsertHandler('PSPL', True, PSPL);
1721 InsertHandler('PSUI', True, PSUI);
1722 InsertHandler('QTNA', False, nil);
1723 InsertHandler('SNDD', False, nil);
1724 InsertHandler('STNA', True, STNA);
1725 InsertHandler('SUBT', False, nil);
1726 InsertHandler('TRAC', True, TRAC);
1727 InsertHandler('TRAM', True, TRAM);
1728 InsertHandler('TRAS', True, TRAS);
1729 InsertHandler('TRBS', True, TRBS);
1730 InsertHandler('TRCM', True, TRCM);
1731 InsertHandler('TRGA', True, TRGA);
1732 InsertHandler('TRGE', True, TRGE);
1733 InsertHandler('TRIA', False, nil);
1734 InsertHandler('TRIG', True, TRIG);
1735 InsertHandler('TRMA', True, TRMA);
1736 InsertHandler('TRSC', True, TRSC);
1737 InsertHandler('TRTA', False, nil);
1738 InsertHandler('TSFF', True, TSFF);
1739 InsertHandler('TSFL', False, nil);
1740 InsertHandler('TSFT', True, TSFT);
1741 InsertHandler('TSGA', False, nil);
1742 InsertHandler('TSTR', False, nil);
1743 InsertHandler('TURR', True, TURR);
1744 InsertHandler('TXAN', True, TXAN);
1745 InsertHandler('TXCA', False, nil);
1746 InsertHandler('TXMA', True, TXMA);
1747 InsertHandler('TXMB', True, TXMB);
1748 InsertHandler('TXMP', True, TXMP);
1749 InsertHandler('TXTC', True, TXTC);
1750 InsertHandler('VCRA', False, nil);
1751 InsertHandler('WMCL', True, WMCL);
1752 InsertHandler('WMDD', True, WMDD);
1753 InsertHandler('WMM_', False, nil);
1754 InsertHandler('WMMB', True, WMMB);
1755 InsertHandler('WPGE', True, WPGE);
1756end.
Note: See TracBrowser for help on using the repository browser.