- Timestamp:
- Jun 5, 2007, 12:07:29 AM (18 years ago)
- Location:
- oup/current
- Files:
-
- 3 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/DataAccess/Access_OniArchive.pas
r192 r209 16 16 FRawOpened: Boolean; 17 17 FSepOpened: Boolean; 18 procedure SetUnloadWhenUnused(doit: Boolean); 18 19 protected 19 20 public 20 property UnloadWhenUnused: Boolean Read FUnloadWhenUnused Write FUnloadWhenUnused;21 property UnloadWhenUnused: Boolean Read FUnloadWhenUnused Write SetUnloadWhenUnused; 21 22 22 23 constructor Create(DatFilename: String; ConnectionID: Integer; var Msg: TStatusMessages); override; … … 161 162 FChangeRights := [CR_EditDat, CR_EditRaw, CR_AppendRaw]; 162 163 end; 164 165 166 167 168 procedure TAccess_OniArchive.SetUnloadWhenUnused(doit: Boolean); 169 begin 170 FUnloadWhenUnused := doit; 171 if FUnloadWhenUnused then 172 begin 173 if FDatOpened then 174 begin 175 FDatOpened := False; 176 Fdat_file.Free; 177 end; 178 if FRawOpened then 179 begin 180 FRawOpened := False; 181 Fraw_file.Free; 182 end; 183 if FSepOpened then 184 begin 185 FSepOpened := False; 186 Fsep_file.Free; 187 end; 188 end 189 else 190 begin 191 if not FDatOpened then 192 begin 193 Fdat_file := TFileStream.Create(FFileName, fmOpenReadWrite); 194 FDatOpened := True; 195 end; 196 if not FRawOpened then 197 begin 198 Fraw_file := TFileStream.Create(AnsiReplaceStr(FFileName, '.dat', '.raw'), 199 fmOpenReadWrite); 200 FRawOpened := True; 201 end; 202 if (not FSepOpened) and (FDataOS <> DOS_WIN) then 203 begin 204 Fsep_file := TFileStream.Create(AnsiReplaceStr(FFileName, '.dat', '.sep'), 205 fmOpenReadWrite); 206 FSepOpened := True; 207 end; 208 end; 209 end; 210 163 211 164 212 -
oup/current/FileClasses/TXMP.pas
r207 r209 4 4 5 5 uses 6 TypeDefs, _FileTypes, _DataTypes;6 _FileTypes; 7 7 8 8 type … … 17 17 18 18 uses 19 ConnectionManager, Math, Classes ;19 ConnectionManager, Math, Classes, TypeDefs, _DataTypes; 20 20 21 { TFile_SNDD } 22 23 procedure TFile_TXMP.InitDatLinks; 24 begin 25 SetLength(FDatLinks, 2); 26 FDatLinks[0].SrcOffset := $94; 27 FDatLinks[0].DestID := -1; 28 FDatLinks[0].PosDestExts := '*'; 29 FDatLinks[1].SrcOffset := $98; 30 FDatLinks[1].DestID := -1; 31 FDatLinks[1].PosDestExts := 'TXMP'; 32 end; 33 21 { TFile_TXMP } 34 22 35 23 procedure TFile_TXMP.InitDataFields; … … 119 107 120 108 109 procedure TFile_TXMP.InitDatLinks; 110 begin 111 SetLength(FDatLinks, 2); 112 FDatLinks[0].SrcOffset := $94; 113 FDatLinks[0].DestID := GetDatLinkValue(FFile, $94); 114 FDatLinks[0].PosDestExts := '*'; 115 FDatLinks[1].SrcOffset := $98; 116 FDatLinks[1].DestID := GetDatLinkValue(FFile, $98); 117 FDatLinks[1].PosDestExts := 'TXMP'; 118 end; 119 120 121 121 procedure TFile_TXMP.InitRawList; 122 122 var -
oup/current/FileClasses/_FileTypes.pas
r207 r209 12 12 FConnectionID: Integer; 13 13 FFileID: Integer; 14 FFileName: String; 14 15 FFile: TMemoryStream; 15 16 … … 34 35 property FileStream: TMemoryStream read FFile; 35 36 property FileID: Integer read FFileID; 37 property FileName: String read FFileName; 36 38 property ConnectionID: Integer read FConnectionID; 37 39 … … 50 52 51 53 54 function GetDatLinkValue(stream: TStream; offset: Integer): Integer; 55 56 57 52 58 implementation 53 59 … … 63 69 FConnectionID := ConnectionID; 64 70 FFileID := FileID; 65 FFile := nil;71 FFileName := ConManager.Connection[ConnectionID].GetFileInfo(FileID).Name; 66 72 67 73 FFile := TMemoryStream.Create; … … 71 77 InitDataFields(); 72 78 InitRawList(); 73 74 if FDataFields.FieldCount > 0 then75 begin76 for i := 0 to FDataFields.FieldCount - 1 do77 begin78 ShowMessage(FDataFields.FieldByIndex[i].ValueAsString);79 end;80 end;81 79 82 80 FFile.Free; … … 171 169 end; 172 170 171 172 173 function GetDatLinkValue(stream: TStream; offset: Integer): Integer; 174 begin 175 stream.Seek(Offset, soFromBeginning); 176 stream.Read(Result, 4); 177 if Result > 0 then 178 Result := Result div 256 179 else 180 Result := -1; 181 end; 182 173 183 end. -
oup/current/Global/RawList.pas
r178 r209 200 200 Result[0].SrcOffset := $0C; 201 201 Result[0].RawAddr := link; 202 if link > 0 then 203 Result[0].RawSize := frames * 4 204 else 205 Result[0].RawSize := 0; 202 Result[0].RawSize := frames * 4; 206 203 {y-pos} 207 204 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $10, 4, @link); 208 205 Result[1].SrcOffset := $10; 209 206 Result[1].RawAddr := link; 210 if link > 0 then 211 Result[1].RawSize := frames * 8 212 else 213 Result[1].RawSize := 0; 207 Result[1].RawSize := frames * 8; 214 208 {attacks} 215 209 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $182, 1, @tempb); … … 240 234 Result[6].SrcOffset := $24; 241 235 Result[6].RawAddr := link; 242 if link > 0 then 243 Result[6].RawSize := 24 244 else 245 Result[6].RawSize := 0; 236 Result[6].RawSize := 24; 246 237 {footstep} 247 238 ConManager.Connection[ConnectionID].LoadDatFilePart(fileid, $186, 1, @tempb); … … 410 401 Break; 411 402 end; 403 if Length(Result) > 0 then 404 for i := 0 to High(Result) do 405 if Result[i].RawAddr = 0 then 406 Result[i].RawSize := 0; 412 407 end; 413 408 -
oup/current/Main.dfm
r105 r209 6 6 Caption = 'Form_Main' 7 7 ClientHeight = 571 8 ClientWidth = 7428 ClientWidth = 842 9 9 Color = clBtnFace 10 10 Constraints.MinHeight = 500 … … 26 26 Left = 0 27 27 Top = 554 28 Width = 74228 Width = 842 29 29 Height = 17 30 30 BiDiMode = bdLeftToRight … … 43 43 end> 44 44 ParentBiDiMode = False 45 ExplicitWidth = 742 45 46 end 46 47 object DockTop: TTBDock 47 48 Left = 0 48 49 Top = 0 49 Width = 74250 Width = 842 50 51 Height = 75 52 ExplicitWidth = 742 51 53 object MainMenu: TTBToolbar 52 54 Left = 0 … … 135 137 object menu_meta: TTBItem 136 138 Caption = '&Meta editor' 137 Enabled = False138 139 ImageIndex = 11 139 140 ShortCut = 16461 … … 353 354 end 354 355 object DockRight: TTBDock 355 Left = 733356 Left = 833 356 357 Top = 75 357 358 Width = 9 358 359 Height = 470 359 360 Position = dpRight 361 ExplicitLeft = 733 360 362 end 361 363 object DockBottom: TTBDock 362 364 Left = 0 363 365 Top = 545 364 Width = 742366 Width = 842 365 367 Height = 9 366 368 Position = dpBottom 369 ExplicitWidth = 742 367 370 end 368 371 object opend: TOpenDialog -
oup/current/Main.pas
r197 r209 136 136 137 137 uses 138 LevelDB ;138 LevelDB, MetaEditor; 139 139 140 140 {$R *.dfm} … … 415 415 tb_txmpreplacer.Enabled := active; 416 416 tb_extractor.Enabled := active; 417 tb_meta.Enabled := active; 417 418 // tb_compare.Enabled := active; 418 419 // tb_structure.Enabled := active; … … 605 606 606 607 procedure TForm_Main.menu_metaClick(Sender: TObject); 607 begin 608 ShowMessage('TBD'); 608 var 609 toolform: TForm_Meta; 610 i: Integer; 611 tag: Integer; 612 iconindex: Integer; 613 begin 614 tag := 1; 615 if MDIChildCount > 0 then 616 for i := 0 to MDIChildCount - 1 do 617 if MDIChildren[i].Tag >= tag then 618 tag := MDIChildren[i].Tag + 1; 619 620 iconindex := -1; 621 622 toolform := nil; 623 624 toolform := TForm_Meta.Create(Self); 625 toolform.Caption := 'MetaEditor' + ' ' + IntToStr(tag) + ' '; 626 iconindex := 11; 627 628 if Assigned(toolform) then 629 begin 630 toolform.Name := 'meta' + IntToStr(tag); 631 toolform.Tag := tag; 632 MDITab.AddTab(TForm(toolform), iconindex); 633 toolform.Caption := AnsiReplaceStr(toolform.Caption, ' ', ''); 634 end; 609 635 end; 610 636 -
oup/current/OniUnPacker.bdsproj
r206 r209 176 176 <Language Name="ProjectLang">$00000000</Language> 177 177 <Language Name="RootDir"></Language> 178 </Language> 179 180 181 182 <Excluded_Packages> 178 </Language> <Excluded_Packages> 183 179 <Excluded_Packages Name="d:\programme\borland\bds\3.0\Bin\dbwebxprt.bpl">Borland Web Wizard Package</Excluded_Packages> 184 180 </Excluded_Packages> -
oup/current/OniUnPacker.dpr
r206 r209 32 32 LevelDB in 'Helper\LevelDB.pas' {Form_LevelDB}, 33 33 Img_DDSTypes in 'Global\Img_DDSTypes.pas', 34 TXMP in 'FileClasses\TXMP.pas'; 34 TXMP in 'FileClasses\TXMP.pas', 35 MetaEditor in 'Tools\MetaEditor.pas' {Form_Meta}, 36 _FileManager in 'FileClasses\_FileManager.pas'; 35 37 36 38 {$R *.res} -
oup/current/Tools/Preview.dfm
r194 r209 27 27 end 28 28 object img: TImage 29 Left = 0 30 Top = 20 31 Width = 283 32 Height = 403 29 AlignWithMargins = True 30 Left = 3 31 Top = 23 32 Width = 277 33 Height = 397 33 34 Align = alClient 35 ExplicitLeft = 0 36 ExplicitTop = 20 34 37 ExplicitWidth = 313 35 38 ExplicitHeight = 453 -
oup/current/Tools/TxmpReplace.dfm
r196 r209 84 84 TabOrder = 0 85 85 object image_bmppreview: TImage 86 Left = 2 87 Top = 45 88 Width = 279 89 Height = 297 86 AlignWithMargins = True 87 Left = 5 88 Top = 48 89 Width = 273 90 Height = 291 90 91 Align = alClient 92 ExplicitLeft = 2 93 ExplicitTop = 45 91 94 ExplicitWidth = 182 92 95 ExplicitHeight = 302 -
oup/current/Tools/TxmpReplace.pas
r206 r209 234 234 Self.OnNewFileSelected := SelectFile; 235 235 opend.Filter := saved.Filter; 236 237 TXMP := TFile_TXMP.Create(ConnectionID, 8552);238 TXMP.Free;239 236 end; 240 237
Note:
See TracChangeset
for help on using the changeset viewer.