- Timestamp:
- Jul 18, 2007, 12:27:16 AM (17 years ago)
- Location:
- oup/current
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/DataAccess/Access_OUP_ADB.pas
r229 r241 35 35 function GetRawList(FileID: Integer): TRawDataList; override; 36 36 function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; override; 37 function GetRawsForType(RawType: String): TRawDataList; override; 37 38 38 39 procedure LoadRawFile(FileID, DatOffset: Integer; var Target: TStream); overload; override; … … 268 269 else 269 270 list.Sorted := True; 271 if ext = '*' then 272 ext := ''; 270 273 for i := 0 to GetFileCount - 1 do 271 274 begin … … 490 493 begin 491 494 SetLength(Result, 0); 492 FQuery.SQL.Text := 'SELECT [src_link_offset],[ size],[sep] FROM rawmap WHERE [src_id]=' +495 FQuery.SQL.Text := 'SELECT [src_link_offset],[name],[size],[sep],[type] FROM rawmap WHERE [src_id]=' + 493 496 IntToStr(fileid) + ' ORDER BY src_link_offset ASC;'; 494 497 FQuery.Open; … … 499 502 i := 0; 500 503 repeat 504 Result[i].Name := FQuery.FieldByName('name').AsString; 501 505 Result[i].SrcID := fileid; 502 506 Result[i].SrcOffset := FQuery.FieldByName('src_link_offset').AsInteger; … … 504 508 Result[i].RawSize := FQuery.FieldByName('size').AsInteger; 505 509 Result[i].LocSep := FQuery.FieldByName('sep').AsBoolean; 510 Result[i].RawType := FQuery.FieldByName('type').AsString; 506 511 Inc(i); 507 512 FQuery.Next; … … 526 531 Result := rawlist[i] 527 532 else begin 533 Result.Name := ''; 528 534 Result.SrcID := -1; 529 535 Result.SrcOffset := -1; 530 536 Result.RawAddr := -1; 531 537 Result.RawSize := -1; 532 end; 533 end; 534 end; 538 Result.RawType := ''; 539 end; 540 end; 541 end; 542 543 544 function TAccess_OUP_ADB.GetRawsForType(RawType: String): TRawDataList; 545 var 546 i: Integer; 547 rawlist: TRawDataList; 548 begin 549 SetLength(Result, 0); 550 FQuery.SQL.Text := 'SELECT [src_id],[src_link_offset],[name],[size],[sep] FROM rawmap ' + 551 'WHERE [type]="' + RawType + '" ORDER BY src_id ASC, src_link_offset ASC;'; 552 FQuery.Open; 553 if FQuery.RecordCount > 0 then 554 begin 555 FQuery.First; 556 SetLength(Result, FQuery.RecordCount); 557 i := 0; 558 repeat 559 Result[i].Name := FQuery.FieldByName('name').AsString; 560 Result[i].SrcID := FQuery.FieldByName('src_id').AsInteger; 561 Result[i].SrcOffset := FQuery.FieldByName('src_link_offset').AsInteger; 562 Result[i].RawAddr := 0; 563 Result[i].RawSize := FQuery.FieldByName('size').AsInteger; 564 Result[i].LocSep := FQuery.FieldByName('sep').AsBoolean; 565 Result[i].RawType := RawType; 566 Inc(i); 567 FQuery.Next; 568 until FQuery.EOF; 569 end; 570 FQuery.Close; 571 end; 572 535 573 536 574 -
oup/current/DataAccess/Access_OniArchive.pas
r231 r241 39 39 function GetRawList(FileID: Integer): TRawDataList; override; 40 40 function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; override; 41 function GetRawsForType(RawType: String): TRawDataList; override; 41 42 42 43 procedure LoadRawOffset(LocSep: Boolean; RawAddr, Size: Integer; var target: TStream); overload; … … 285 286 list := TStringList.Create; 286 287 list.Sorted := True; 288 if ext = '*' then 289 ext := ''; 287 290 for i := 0 to GetFileCount - 1 do 288 291 begin … … 489 492 begin 490 493 Result := RawLists.GetRawList(FConnectionID, FileID); 494 end; 495 496 497 function TAccess_OniArchive.GetRawsForType(RawType: String): TRawDataList; 498 var 499 i, j: Integer; 500 dats: TStrings; 501 list: TRawDataList; 502 begin 503 dats := nil; 504 dats := GetFilesList(MidStr(RawType, 1, 4), '', True, ST_IDAsc); 505 for i := 0 to dats.Count - 1 do 506 begin 507 list := GetRawList(StrToInt(MidStr(dats.Strings[i], 1, 5))); 508 for j := 0 to Length(list) - 1 do 509 begin 510 if list[j].RawType = RawType then 511 begin 512 SetLength(Result, Length(Result)+1); 513 Result[High(Result)] := list[j]; 514 end; 515 end; 516 end; 491 517 end; 492 518 -
oup/current/DataAccess/DataAccess.pas
r229 r241 50 50 function GetRawList(FileID: Integer): TRawDataList; virtual; abstract; 51 51 function GetRawInfo(FileID, DatOffset: Integer): TRawDataInfo; virtual; abstract; 52 function GetRawsForType(RawType: String): TRawDataList; virtual; abstract; 52 53 53 54 procedure LoadRawFile(FileID, DatOffset: Integer; var Target: TStream); overload; virtual; abstract; -
oup/current/FileClasses/AKVA.pas
r237 r241 41 41 AddField(TInt, 'X-tiles', 'size of pathfinding grid', [4]); 42 42 AddField(TInt, 'Z-tiles', 'size of pathfinding grid', [4]); 43 AddField(TRawLink, 'RAW offset', 'offset of grid data', [ ]);43 AddField(TRawLink, 'RAW offset', 'offset of grid data', ['AKVA']); 44 44 AddField(TInt, 'RAW size', 'size of grid data', [4]); 45 45 AddField(TFloat, 'Tile size', 'usually 4 world units', []); -
oup/current/FileClasses/SUBT.pas
r240 r241 35 35 AddField(TUnused, 'Unused data', '', [16]); 36 36 37 AddField(TRawLink, 'Raw Address', '', [ ]);37 AddField(TRawLink, 'Raw Address', '', ['SUBT']); 38 38 39 39 with TArray(AddField(TArray, 'SUBT offsets array', '', [4])) do -
oup/current/FileClasses/TXAN.pas
r237 r241 36 36 with TArray(AddField(TArray, 'AnimTextures array', '', [4])) do 37 37 begin 38 AddField(TLinkByID, 'Texture', '', [' *']);38 AddField(TLinkByID, 'Texture', '', ['TXMP']); 39 39 SetCount; 40 40 end; -
oup/current/FileClasses/TXMP.pas
r236 r241 53 53 AddField(TInt, 'Height', '', [2]); 54 54 AddField(TInt, 'StoreType', '', [4]); 55 AddField(TLinkByID, 'TXAN', '', [' *']);55 AddField(TLinkByID, 'TXAN', '', ['TXAN']); 56 56 AddField(TLinkByID, 'TXMP', '', ['TXMP']); 57 AddField(TRawLink, 'RawLink', '', [ ]);58 AddField(TRawLink, 'SepLink', '', [ ]);57 AddField(TRawLink, 'RawLink', '', ['TXMP']); 58 AddField(TRawLink, 'SepLink', '', ['TXMP']); 59 59 AddField(TUnused, 'Unused', '', [$1C]); 60 60 end; -
oup/current/FileClasses/_DataTypes.pas
r240 r241 10 10 11 11 TDataField = class(TTreeElement) 12 function GetChildCount: Integer; override;13 function GetChild(ID: Integer): TTreeElement; override;14 function GetCaption: String; override;15 12 protected 16 13 FOffset: Integer; 17 14 FName: String; 15 FType: String; 18 16 FDescription: String; 19 17 FDataLength: Integer; … … 22 20 FChanged: Boolean; 23 21 FExtraArgs: array of TVarRec; 22 function GetChildCount: Integer; override; 23 function GetChild(ID: Integer): TTreeElement; override; 24 function GetCaption: String; override; 25 function GetType: String; override; 24 26 function GetValueAsString: String; virtual; 25 27 public … … 47 49 48 50 TBlock = class(TContainer) 49 pr ivate51 protected 50 52 FDataFields: array of TDataField; 51 53 function GetChildCount: Integer; override; … … 67 69 68 70 TInt = class(TDataField) 69 pr ivate71 protected 70 72 FInt: Integer; 71 73 function GetValueAsString: String; override; … … 80 82 81 83 TFloat = class(TDataField) 82 pr ivate84 protected 83 85 FFloat: Single; 84 86 function GetValueAsString: String; override; … … 93 95 94 96 TBitSet = class(TDataField) 95 pr ivate97 protected 96 98 FBits: Byte; 97 99 FNames: TStringList; … … 107 109 108 110 TLevelID = class(TDataField) 109 pr ivate111 protected 110 112 FLevelID: Integer; 111 113 function GetValueAsString: String; override; … … 120 122 121 123 TFileID = class(TDataField) 122 pr ivate124 protected 123 125 FFileID: Integer; 124 126 function GetValueAsString: String; override; … … 133 135 134 136 TDatLink = class(TDataField) 135 private 137 protected 138 FPosExts: String; 136 139 function GetTarget: TObject; virtual; abstract; 137 140 public 141 property PosExts: String read FPosExts; 138 142 property TargetFile: TObject read GetTarget; 139 143 end; … … 141 145 142 146 TLinkByID = class(TDatLink) 147 protected 148 FFileID: Integer; 143 149 function GetChildCount: Integer; override; 144 150 function GetChild(ID: Integer): TTreeElement; override; 145 private146 FFileID: Integer;147 FPosExts: String;148 151 function GetValueAsString: String; override; 149 152 function GetTarget: TObject; override; … … 158 161 159 162 TString = class(TDataField) 160 pr ivate163 protected 161 164 FString: String; 162 165 function GetValueAsString: String; override; … … 171 174 172 175 TArray = class(TContainer) 173 pr ivate176 protected 174 177 FDataFields: array of TBlock; 175 178 FTemplate: TBlock; … … 197 200 198 201 TRawLink = class(TDataField) 199 pr ivate202 protected 200 203 FRawAddress: Integer; 204 FRawType: String; 205 FSep: Boolean; 201 206 function GetValueAsString: String; override; 202 207 public 203 // ExtraArgs: keine 204 constructor Create(ParentFile: TObject; ParentBlock: TContainer; 205 Name, Description: String; ExtraArgs: array of const); override; 206 procedure Update(Offset, Length: Integer); override; 207 procedure WriteData(stream: TStream); override; 208 // ExtraArgs: String: RawType; Bool: Sep 209 constructor Create(ParentFile: TObject; ParentBlock: TContainer; 210 Name, Description: String; ExtraArgs: array of const); override; 211 procedure Update(Offset, Length: Integer); override; 212 procedure WriteData(stream: TStream); override; 213 214 property RawType: String read FRawType; 208 215 end; 209 216 210 217 211 218 TUnused = class(TDataField) 212 pr ivate219 protected 213 220 function GetValueAsString: String; override; 214 221 public … … 268 275 end; 269 276 277 function TDataField.GetType: String; 278 begin 279 Result := FType; 280 end; 281 270 282 function TDataField.GetValueAsString: String; 271 283 begin … … 280 292 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 281 293 FDataLength := ExtraArgs[0].VInteger; 294 FType := 'String[' + IntToStr(FDataLength) + ']'; 282 295 end; 283 296 … … 325 338 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 326 339 FDataLength := ExtraArgs[0].VInteger; 340 FType := 'Int' + IntToStr(FDataLength * 8); 327 341 FInt := 0; 328 342 end; … … 364 378 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 365 379 FCounterSize := ExtraArgs[0].VInteger; 380 FType := ''; 366 381 if Length(ExtraArgs) = 2 then 367 382 FBlockCount := ExtraArgs[1].VInteger … … 521 536 begin 522 537 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 538 FType := ''; 523 539 end; 524 540 … … 593 609 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 594 610 FDataLength := 4; 611 FType := 'LevelID'; 595 612 FLevelID := 0; 596 613 end; … … 628 645 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 629 646 FDataLength := 4; 647 FType := 'FileID'; 630 648 FFileID := -1; 631 649 end; … … 673 691 vtAnsiString: FPosExts := String(ExtraArgs[0].VAnsiString); 674 692 end; 693 FType := 'LinkByID(' + FPosExts + ')'; 675 694 FFileID := -1; 676 695 end; … … 740 759 begin 741 760 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 761 case ExtraArgs[0].VType of 762 vtChar: FRawType := ExtraArgs[0].VChar; 763 vtAnsiString: FRawType := String(ExtraArgs[0].VAnsiString); 764 end; 765 if Length(ExtraArgs) > 1 then 766 FSep := ExtraArgs[1].VBoolean; 767 FType := 'RawLink(' + FRawType + ')'; 742 768 FDataLength := 4; 743 769 end; … … 774 800 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 775 801 FDataLength := ExtraArgs[0].VInteger; 802 FType := 'Unused'; 776 803 end; 777 804 … … 813 840 end; 814 841 FDataLength := 1; 842 FType := 'BitSet'; 815 843 FBits := 0; 816 844 end; … … 854 882 inherited Create(ParentFile, ParentBlock, Name, Description, ExtraArgs); 855 883 FDataLength := 4; 884 FType := 'Float'; 856 885 FFloat := 0; 857 886 end; -
oup/current/FileClasses/_Extensions.pas
r237 r241 8 8 type 9 9 TExtension = class(TTreeElement) 10 protected 10 11 function GetChildCount: Integer; override; 11 12 function GetChild(ID: Integer): TTreeElement; override; 12 13 function GetCaption: String; override; 14 function GetType: String; override; 13 15 private 14 16 FExt: String; … … 64 66 begin 65 67 Result := Length(FFiles); 68 end; 69 70 function TExtension.GetType: String; 71 begin 72 Result := ''; 66 73 end; 67 74 -
oup/current/FileClasses/_FileTypes.pas
r240 r241 9 9 type 10 10 TFile = class(TTreeElement) 11 function GetChildCount: Integer; override;12 function GetChild(ID: Integer): TTreeElement; override;13 function GetCaption: String; override;14 11 protected 15 12 FFileInfo: TFileInfo; … … 25 22 FOpened: Boolean; 26 23 24 function GetChildCount: Integer; override; 25 function GetChild(ID: Integer): TTreeElement; override; 26 function GetCaption: String; override; 27 function GetType: String; override; 27 28 function GetEditor: TFrame; 28 29 function GetFieldByOffset(Offset: Integer): TDataField; … … 61 62 62 63 uses 63 DatLinks, RawList, ConnectionManager, Dialogs, _MetaTypes, _MetaManager; 64 DatLinks, RawList, ConnectionManager, Dialogs, _MetaTypes, _MetaManager, 65 SysUtils; 64 66 65 67 { TFileType } … … 134 136 135 137 138 function TFile.GetType: String; 139 begin 140 Result := FFileInfo.Extension; 141 end; 142 136 143 function TFile.GetCaption: String; 137 144 begin … … 139 146 if Result = '' then 140 147 Result := 'Unnamed'; 148 Result := Result + ' (' + IntToStr(FFileInfo.ID) + ')'; 141 149 end; 142 150 -
oup/current/FileClasses/_MetaTypes.pas
r240 r241 4 4 5 5 uses 6 _FileTypes, _EmptyFile, _ Unlinked, _DataTypes, _Extensions, _TreeElement,6 _FileTypes, _EmptyFile, _DataTypes, _Extensions, _TreeElement, 7 7 AKVA, SUBT, TXAN, TXMP; 8 8 // ABNA, AGDB, AGQC, AGQG, AGQM, AGQR, AISA, AITR, AIWA, AKAA, AKBA, AKBP, AKDA, … … 20 20 TFile = _FileTypes.TFile; 21 21 TFile_Empty = _EmptyFile.TFile_Empty; 22 TFile_Unlinked = _Unlinked.TFile_Unlinked;23 22 TExtension = _Extensions.TExtension; 24 23 TExtensions = _Extensions.TExtensions; 24 25 25 TDataField = _DataTypes.TDataField; 26 TContainer = _DataTypes.TContainer; 27 TBlock = _DataTypes.TBlock; 28 TArray = _DataTypes.TArray; 29 30 TFileID = _DataTypes.TFileID; 31 TLevelID = _DataTypes.TLevelID; 32 TInt = _DataTypes.TInt; 33 TFloat = _DataTypes.TFloat; 34 TString = _DataTypes.TString; 35 TBitSet = _DataTypes.TBitSet; 26 36 TDatLink = _DataTypes.TDatLink; 37 TLinkByID = _DataTypes.TLinkByID; 38 TRawLink = _DataTypes.TRawLink; 39 TUnused = _DataTypes.TUnused; 27 40 28 41 TFileClass = class of TFile; -
oup/current/FileClasses/_TreeElement.pas
r238 r241 5 5 type 6 6 TTreeElement = class 7 protected 7 8 FConnectionID: Integer; 8 9 function GetChildCount: Integer; virtual; abstract; 9 10 function GetChild(ID: Integer): TTreeElement; virtual; abstract; 10 11 function GetCaption: String; virtual; abstract; 11 private12 function GetType: String; virtual; abstract; 12 13 public 13 14 property ConnectionID: Integer read FConnectionID; … … 15 16 property Child[ID: Integer]: TTreeElement read GetChild; 16 17 property Caption: String read GetCaption; 18 property VType: String read GetType; 17 19 end; 18 20 -
oup/current/Global/DatLinks.pas
r215 r241 359 359 const 360 360 types: array[0..0] of String[4] = 361 (' *');361 ('Impt'); 362 362 var 363 363 i: Integer; … … 426 426 function M3GM(Connection: TDataAccess; FileID: Integer): TDatLinkList; 427 427 const 428 types: array[0.. 7] of String[4] =429 ('PNTA', 'VCRA', 'VCRA', 'TXCA', 'IDXA', 'IDXA', 'TXMP' , '*');428 types: array[0..6] of String[4] = 429 ('PNTA', 'VCRA', 'VCRA', 'TXCA', 'IDXA', 'IDXA', 'TXMP'); 430 430 var 431 431 i: Integer; 432 432 begin 433 433 SetLength(Result, 8); 434 for i := 0 to 7do434 for i := 0 to 6 do 435 435 begin 436 436 Result[i].SrcOffset := $0C + i*4; … … 444 444 const 445 445 types: array[0..0] of String[4] = 446 (' *');446 ('Mtrl'); 447 447 var 448 448 i: Integer; … … 587 587 Result[0].SrcOffset := $8; 588 588 Result[0].DestID := -1; 589 Result[0].PosDestExts := ' *';589 Result[0].PosDestExts := 'ONCV'; 590 590 end; 591 591 … … 730 730 Result[0].SrcOffset := $50; 731 731 Result[0].DestID := -1; 732 Result[0].PosDestExts := ' *';732 Result[0].PosDestExts := 'TXMP'; 733 733 end; 734 734 … … 748 748 Result[i].SrcOffset := $20 + i*8 + 4; 749 749 Result[i].DestID := -1; 750 Result[i].PosDestExts := ' *';750 Result[i].PosDestExts := 'PSpc'; 751 751 end; 752 752 end; … … 1104 1104 Result[0].SrcOffset := $94; 1105 1105 Result[0].DestID := -1; 1106 Result[0].PosDestExts := ' *';1106 Result[0].PosDestExts := 'TXAN'; 1107 1107 Result[1].SrcOffset := $98; 1108 1108 Result[1].DestID := -1; … … 1134 1134 Result[i].SrcOffset := $20 + i*8 + 4; 1135 1135 Result[i].DestID := -1; 1136 Result[i].PosDestExts := ' *';1136 Result[i].PosDestExts := 'PSpc'; 1137 1137 end; 1138 1138 end; -
oup/current/Global/Data.pas
r206 r241 5 5 const 6 6 Version: String = 'v0.35a'; 7 DBVersion: String = '0. 4';7 DBVersion: String = '0.5'; 8 8 CrLf: String[2] = #13 + #10; 9 9 -
oup/current/Global/RawList.pas
r226 r241 44 44 for i := 0 to links - 1 do 45 45 begin 46 Result[i].Name := '<TBD>';46 Result[i].Name := '<TBD>'; 47 47 Result[i].SrcOffset := $20 + i * 4; 48 48 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $20 + i * 4, 4, @link); … … 50 50 Result[i].RawSize := 32; 51 51 Result[i].LocSep := False; 52 Result[i].RawType := 'AGDB' + IntToStr(i mod 2); 52 53 end; 53 54 end; … … 66 67 for i := 0 to links - 1 do 67 68 begin 68 Result[i].Name := '<TBD>';69 Result[i].Name := '<TBD>'; 69 70 Result[i].SrcOffset := $20 + i * $74 + $24; 70 71 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $20 + i * $74 + $24, 4, @link); … … 73 74 Result[i].RawSize := link; 74 75 Result[i].LocSep := False; 76 Result[i].RawType := 'AKVA'; 75 77 end; 76 78 end; … … 87 89 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $08, 4, @datasize); 88 90 SetLength(Result, 1); 89 Result[0].Name := 'BinaryData';91 Result[0].Name := 'Binary data'; 90 92 Result[0].SrcOffset := $0C; 91 93 Result[0].RawAddr := link; 92 94 Result[0].RawSize := datasize; 93 95 Result[0].LocSep := not (ConManager.Connection[ConnectionID].DataOS = DOS_WIN); 96 Result[0].RawType := 'BINA'; 94 97 end; 95 98 … … 105 108 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $0C, 4, @link); 106 109 SetLength(Result, 1); 107 Result[0].Name := 'SoundBinaryData';110 Result[0].Name := 'Sound Binary Data'; 108 111 Result[0].SrcOffset := $0C; 109 112 Result[0].RawAddr := link; 110 113 Result[0].RawSize := datasize; 111 Result[0].LocSep := not (ConManager.Connection[ConnectionID].DataOS = DOS_WIN); 114 Result[0].LocSep := not (ConManager.Connection[ConnectionID].DataOS = DOS_WIN); 115 Result[0].RawType := 'OSBD'; 112 116 end; 113 117 … … 133 137 Result[0].SrcOffset := $44; 134 138 end; 135 Result[0].Name := 'SoundData';139 Result[0].Name := 'Sound data'; 136 140 Result[0].RawAddr := link; 137 141 Result[0].RawSize := datasize; 138 142 Result[0].LocSep := False; 143 Result[0].RawType := 'SNDD'; 139 144 end; 140 145 … … 181 186 Result[0].RawSize := Data.Position; 182 187 Result[0].LocSep := False; 188 Result[0].RawType := 'SUBT'; 183 189 end; 184 190 end; … … 208 214 Result[0].RawAddr := link; 209 215 Result[0].RawSize := frames * 4; 216 Result[0].RawType := 'TRAM0'; 210 217 {x-z-pos} 211 218 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $10, 4, @link); … … 214 221 Result[1].RawAddr := link; 215 222 Result[1].RawSize := frames * 8; 223 Result[1].RawType := 'TRAM1'; 216 224 {attacks} 217 225 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $182, 1, @tempb); … … 221 229 Result[2].RawAddr := link; 222 230 Result[2].RawSize := tempb * 32; 231 Result[2].RawType := 'TRAM2'; 223 232 {damage} 224 233 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $183, 1, @tempb); … … 228 237 Result[3].RawAddr := link; 229 238 Result[3].RawSize := tempb * 8; 239 Result[3].RawType := 'TRAM3'; 230 240 {motionblur} 231 241 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $184, 1, @tempb); … … 235 245 Result[4].RawAddr := link; 236 246 Result[4].RawSize := tempb * 12; 247 Result[4].RawType := 'TRAM4'; 237 248 {shortcut} 238 249 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $185, 1, @tempb); … … 242 253 Result[5].RawAddr := link; 243 254 Result[5].RawSize := tempb * 8; 255 Result[5].RawType := 'TRAM5'; 244 256 {throw} 245 257 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $24, 4, @link); … … 248 260 Result[6].RawAddr := link; 249 261 Result[6].RawSize := 24; 262 Result[6].RawType := 'TRAM6'; 250 263 {footstep} 251 264 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $186, 1, @tempb); … … 255 268 Result[7].RawAddr := link; 256 269 Result[7].RawSize := tempb * 4; 270 Result[7].RawType := 'TRAM7'; 257 271 {particle} 258 272 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $187, 1, @tempb); … … 262 276 Result[8].RawAddr := link; 263 277 Result[8].RawSize := tempb * 24; 278 Result[8].RawType := 'TRAM8'; 264 279 {position} 265 280 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $30, 4, @link); … … 268 283 Result[9].RawAddr := link; 269 284 Result[9].RawSize := frames * 8; 285 Result[9].RawType := 'TRAM9'; 270 286 {sound} 271 287 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $154, 2, @tempw); … … 275 291 Result[11].RawAddr := link; 276 292 Result[11].RawSize := tempw * 34; 293 Result[11].RawType := 'TRAM11'; 277 294 {extent} 278 295 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $138, 4, @templ); … … 282 299 Result[12].RawAddr := link; 283 300 Result[12].RawSize := templ * 12; 301 Result[12].RawType := 'TRAM12'; 284 302 285 303 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $34, 4, @link); … … 312 330 Result[10].SrcOffset := $34; 313 331 Result[10].RawAddr := link; 332 Result[10].RawType := 'TRAM10'; 314 333 end; 315 334 … … 373 392 Result[0].RawSize := datasize; 374 393 Result[0].LocSep := not (ConManager.Connection[ConnectionID].DataOS = DOS_WIN); 394 Result[0].RawType := 'TXMP'; 375 395 end; 376 396 … … 390 410 Result.RawAddr := -1; 391 411 Result.RawSize := -1; 412 Result.RawType := ''; 392 413 if Length(RawList) > 0 then 393 414 begin … … 402 423 Result.RawSize := RawList[i].RawSize; 403 424 Result.LocSep := RawList[i].LocSep; 425 Result.RawType := RawList[i].RawType; 404 426 Break; 405 427 end; -
oup/current/Global/TypeDefs.pas
r222 r241 82 82 RawSize: Integer; 83 83 LocSep: Boolean; 84 RawType: String; 84 85 end; 85 86 TRawDataList = array of TRawDataInfo; -
oup/current/Helper/LevelDB.pas
r173 r241 594 594 Query.ExecSQL; 595 595 Query.SQL.Text := 596 'CREATE TABLE rawmap ( id AUTOINC PRIMARY KEY, src_id INTEGER, ' +597 'src_link_offset INTEGER, sep BOOLEAN, size INTEGER, ' +596 'CREATE TABLE rawmap ( id AUTOINC PRIMARY KEY, name STRING(32), src_id INTEGER, ' + 597 'src_link_offset INTEGER, sep BOOLEAN, type STRING(8), size INTEGER, ' + 598 598 'data BLOB BlobCompressionMode 9 BlobBlockSize 1024 BlobCompressionAlgorithm ZLib);'; 599 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 600 Query.ExecSQL; 601 601 Query.SQL.Text := 'CREATE INDEX idsrcid ON rawmap (src_id);'; 602 Query.ExecSQL; 603 Query.SQL.Text := 'CREATE INDEX idtype ON rawmap (type);'; 602 604 Query.ExecSQL; 603 605 Query.SQL.Text := … … 667 669 mimecoder := TStringFormat_MIME64.Create; 668 670 Query.SQL.Text := 669 'INSERT INTO rawmap (src_id,src_link_offset,sep,size,data) VALUES (' + 671 'INSERT INTO rawmap (name,src_id,src_link_offset,sep,type,size,data) VALUES (' + 672 '"' + RawLinks[i].Name + '", ' + 670 673 IntToStr(FileID) + ', ' + IntToStr(RawLinks[i].SrcOffset) + ',' + 671 674 BoolToStr(RawLinks[i].LocSep) + ', ' + 675 '"' + RawLinks[i].RawType + '", ' + 672 676 IntToStr(RawLinks[i].RawSize) + ', ' + 673 677 'MimeToBin("' + MimeCoder.StrTo(@tempdata[0], RawLinks[i].RawSize) + '") );'; … … 678 682 begin 679 683 Query.SQL.Text := 680 'INSERT INTO rawmap (src_id,src_link_offset,sep,size) VALUES (' + 684 'INSERT INTO rawmap (name,src_id,src_link_offset,sep,type,size) VALUES (' + 685 '"' + RawLinks[i].Name + '", ' + 681 686 IntToStr(FileID) + ', ' + IntToStr(RawLinks[i].SrcOffset) + ', ' + 682 BoolToStr(RawLinks[i].LocSep) + ', 0);'; 687 BoolToStr(RawLinks[i].LocSep) + ', ' + 688 '"' + RawLinks[i].RawType + '", ' + 689 '0);'; 683 690 Query.ExecSQL; 684 691 end; -
oup/current/Main.pas
r239 r241 254 254 ConManager.OnCoonnectionListChanged := UpdateConLists; 255 255 256 Application.HintPause := 250; 257 Application.HintHidePause := 5000; 258 256 259 if FileExists(ExtractFilepath(Application.EXEname) + '\oniunpacker.ini') then 257 260 begin -
oup/current/OniUnPacker.bdsproj
r240 r241 176 176 <Language Name="ProjectLang">$00000000</Language> 177 177 <Language Name="RootDir"></Language> 178 </Language> 179 <Excluded_Packages> 178 </Language> <Excluded_Packages> 180 179 <Excluded_Packages Name="d:\programme\borland\bds\3.0\Bin\dbwebxprt.bpl">Borland Web Wizard Package</Excluded_Packages> 181 180 </Excluded_Packages> -
oup/current/OniUnPacker.dpr
r240 r241 44 44 _Extensions in 'FileClasses\_Extensions.pas', 45 45 _MetaTypes in 'FileClasses\_MetaTypes.pas', 46 _TreeElement in 'FileClasses\_TreeElement.pas', 47 _Unlinked in 'FileClasses\_Unlinked.pas'; 46 _TreeElement in 'FileClasses\_TreeElement.pas'; 48 47 49 48 {$R *.res} -
oup/current/Tools/BinEdit.dfm
r231 r241 19 19 end 20 20 inherited tab_meta: TTabSheet 21 ExplicitLeft = 0 22 ExplicitTop = 0 23 ExplicitWidth = 0 24 ExplicitHeight = 0 21 inherited filelist_meta: TVirtualStringTree 22 Height = 443 23 end 25 24 end 26 25 end -
oup/current/Tools/MetaEditor.dfm
r239 r241 40 40 Header.Font.Style = [] 41 41 Header.Options = [hoColumnResize, hoDrag, hoVisible] 42 HintAnimation = hatNone 43 HintMode = hmHint 44 ParentShowHint = False 45 ShowHint = True 42 46 TabOrder = 0 43 47 TreeOptions.AutoOptions = [toAutoDropExpand, toAutoScrollOnExpand, toAutoDeleteMovedNodes] … … 47 51 OnGetText = VSTGetText 48 52 OnPaintText = VSTPaintText 53 OnGetHint = VSTGetHint 49 54 OnGetPopupMenu = VSTGetPopupMenu 50 55 OnInitChildren = VSTInitChildren … … 53 58 Position = 0 54 59 Width = 250 55 WideText = ' FName'60 WideText = 'Name' 56 61 end 57 62 item 58 63 Position = 1 59 WideText = 'FType' 64 Width = 100 65 WideText = 'Type' 60 66 end 61 67 item 62 68 Position = 2 63 WideText = 'FID'64 end65 item66 Position = 367 69 Width = 150 68 WideText = ' Data'70 WideText = 'Value' 69 71 end> 70 72 end … … 74 76 Width = 400 75 77 Height = 424 76 ActivePage = tab_ hex78 ActivePage = tab_meta 77 79 Align = alRight 78 80 TabOrder = 1 -
oup/current/Tools/MetaEditor.pas
r240 r241 53 53 procedure vst_setRootClick(Sender: TObject); 54 54 procedure vst_newRootClick(Sender: TObject); 55 procedure VSTGetHint(Sender: TBaseVirtualTree; Node: PVirtualNode; 56 Column: TColumnIndex; var LineBreakStyle: TVTTooltipLineBreakStyle; 57 var HintText: WideString); 55 58 private 56 59 root: TTreeElement; … … 63 66 implementation 64 67 {$R *.dfm} 65 uses _MetaManager, _MetaTypes, ConnectionManager, Data, _FileTypes, Main; 68 uses _MetaManager, _MetaTypes, ConnectionManager, Data, _FileTypes, Main, 69 TypeDefs; 66 70 67 71 type … … 88 92 if ID >= 0 then 89 93 SetRoot(ConManager.Connection[FConnectionID].MetaData.Root); 94 //SetRoot(ConManager.Connection[FConnectionID].MetaData.FileById[454]); 90 95 end; 91 96 … … 119 124 newnode: PVirtualNode; 120 125 i: Integer; 121 Meta: TMetaManager;122 126 begin 123 127 data := Sender.GetNodeData(node); 124 Meta := ConManager.Connection[ConnectionID].MetaData;125 128 126 129 if data.Field.ChildCount > 0 then … … 152 155 if data.Field is TFile then 153 156 ffile := TFile(data.Field); 154 if data.Field is TDatLink then155 if Assigned( TDatLink(data.Field).TargetFile) then156 ffile := TFile( TDatLink(data.Field).TargetFile);157 if data.Field is _MetaTypes.TDatLink then 158 if Assigned(_MetaTypes.TDatLink(data.Field).TargetFile) then 159 ffile := TFile(_MetaTypes.TDatLink(data.Field).TargetFile); 157 160 if Assigned(ffile) then 158 161 begin … … 214 217 begin 215 218 case Column of 216 0: 217 begin 218 CellText := Data.Field.GetCaption; 219 end; 220 1: 221 begin 222 if Data.Field is TFile then 223 CellText := TFile(Data.Field).FileInfo.Extension; 224 end; 219 0: CellText := Data.Field.Caption; 220 1: CellText := data.Field.VType; 225 221 2: 226 begin227 if Data.Field is TFile then228 CellText := IntToStr(TFile(Data.Field).FileInfo.ID);229 end;230 3:231 222 begin 232 223 if Data.Field is TDataField then … … 264 255 265 256 257 procedure TForm_Meta.VSTGetHint(Sender: TBaseVirtualTree; Node: PVirtualNode; 258 Column: TColumnIndex; var LineBreakStyle: TVTTooltipLineBreakStyle; 259 var HintText: WideString); 260 var 261 data: PNodeData; 262 CellText: WideString; 263 264 i: Integer; 265 links: TStrings; 266 begin 267 inherited; 268 if Assigned(Node) then 269 begin 270 VSTGetText(Sender, Node, Column, ttNormal, CellText); 271 if Length(CellText) > 0 then 272 begin 273 data := Sender.GetNodeData(Node); 274 if data.Field is TDataField then 275 begin 276 case Column of 277 0,1: HintText := TDataField(data.Field).Description; 278 2: HintText := ''; 279 end; 280 end; 281 if (data.Field is _MetaTypes.TDatLink) and (Column = 2) then 282 begin 283 links := nil; 284 links := ConManager.Connection[FConnectionID].GetFilesList(_MetaTypes.TDatLink(data.Field).PosExts, '', False, ST_NameAsc); 285 HintText := IntToStr(links.Count); 286 for i := 0 to Min(links.Count - 1, 99) do 287 begin 288 if (i mod 5) = 0 then 289 HintText := HintText + #13+#10; 290 HintText := HintText + links.Strings[i] + ' '; 291 end; 292 end; 293 end; 294 end 295 else 296 HintText := ''; 297 end; 298 266 299 procedure TForm_Meta.VSTGetPopupMenu(Sender: TBaseVirtualTree; 267 300 Node: PVirtualNode; Column: TColumnIndex; const P: TPoint; … … 279 312 if Column = 0 then 280 313 begin 281 if TTreeElement(data.Field). GetChildCount > 0 then314 if TTreeElement(data.Field).ChildCount > 0 then 282 315 PopupMenu := vst_popup 283 316 else -
oup/current/Tools/_TemplateFileList.dfm
r233 r241 33 33 Margins.Right = 1 34 34 Margins.Bottom = 0 35 ActivePage = tab_ meta35 ActivePage = tab_files 36 36 Align = alClient 37 37 TabOrder = 0 … … 261 261 Align = alClient 262 262 ItemHeight = 13 263 PopupMenu = filepopup 263 264 TabOrder = 1 264 265 OnClick = listClick … … 269 270 Caption = 'Tree' 270 271 ImageIndex = 1 271 ExplicitLeft = 0272 ExplicitTop = 0273 ExplicitWidth = 0274 ExplicitHeight = 0275 272 object filelist_meta: TVirtualStringTree 276 273 Left = 0 … … 309 306 end 310 307 object filepopup: TPopupMenu 308 OnPopup = filepopupPopup 311 309 Left = 72 312 310 Top = 216 … … 316 314 object popup_linkshere: TMenuItem 317 315 Caption = 'What links here? Where does this file link to?' 316 OnClick = popup_linkshereClick 318 317 end 319 318 object popup_separator: TMenuItem … … 322 321 object popup_import: TMenuItem 323 322 Caption = 'Import binary .dat-file' 323 OnClick = popup_importClick 324 324 end 325 325 object popup_export: TMenuItem 326 326 Caption = 'Export binary .dat-file' 327 OnClick = popup_exportClick 327 328 end 328 329 end
Note:
See TracChangeset
for help on using the changeset viewer.