Changeset 209 for oup/current/FileClasses
- Timestamp:
- Jun 5, 2007, 12:07:29 AM (17 years ago)
- Location:
- oup/current/FileClasses
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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.
Note:
See TracChangeset
for help on using the changeset viewer.