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