ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/oup/current/Helper/LevelDB.pas
(Generate patch)

Comparing oup/current/Helper/LevelDB.pas (file contents):
Revision 112 by alloc, Thu Feb 22 00:37:39 2007 UTC vs.
Revision 173 by alloc, Wed May 2 13:19:40 2007 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)