Changeset 207 for oup/current
- Timestamp:
- May 29, 2007, 9:39:15 PM (17 years ago)
- Location:
- oup/current/FileClasses
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/FileClasses/TXMP.pas
r206 r207 4 4 5 5 uses 6 TypeDefs, _ DataTypes, _FileTypes;6 TypeDefs, _FileTypes, _DataTypes; 7 7 8 8 type … … 17 17 18 18 uses 19 ConnectionManager, Math ;19 ConnectionManager, Math, Classes; 20 20 21 21 { TFile_SNDD } … … 37 37 tempi: Integer; 38 38 temps: String; 39 templist: TStringList; 39 40 begin 40 41 FDataFields := TBlock.Create(Self, 0, 'Base', '', nil); 42 templist := TStringList.Create; 41 43 with FDataFields do 42 44 begin 43 45 AddField(TFileID, $00, 'FileID', '', nil); 46 44 47 AddField(TLevelID, $04, 'LevelID', '', nil); 48 45 49 tempi := 128; 46 50 AddField(TString, $08, 'FileName', '', @tempi); 47 tempi := 4; 48 AddField(TInt, $88, 'Flags', '', @tempi); 51 52 templist.Add('MipMapping enabled'); 53 templist.Add('unknown'); 54 templist.Add('U wrapping disabled'); 55 templist.Add('V wrapping disabled'); 56 templist.Add('EnvMapped/EnvMap'); 57 templist.Add('unused'); 58 templist.Add('Play anim back to back'); 59 templist.Add('Random anim order + frame time'); 60 AddField(TBitSet, $88, 'Flags1', '', @templist); 61 62 templist.Clear; 63 templist.Add('Random anim time offset'); 64 templist.Add('High byte as EnvMap'); 65 templist.Add('High byte as alpha'); 66 templist.Add('Different alpha formula'); 67 templist.Add('Data swapping (always set)'); 68 templist.Add('used at runtime'); 69 templist.Add('TXAN looping on/off'); 70 templist.Add('16 bit blue'); 71 AddField(TBitSet, $89, 'Flags2', '', @templist); 72 73 templist.Clear; 74 templist.Add('16 bit alpha'); 75 templist.Add('16 bit red'); 76 templist.Add('unknown'); 77 templist.Add('unknown'); 78 templist.Add('unknown'); 79 templist.Add('unknown'); 80 templist.Add('unknown'); 81 templist.Add('unknown'); 82 AddField(TBitSet, $8A, 'Flags3', '', @templist); 83 84 templist.Clear; 85 templist.Add('unknown'); 86 templist.Add('unknown'); 87 templist.Add('unknown'); 88 templist.Add('unknown'); 89 templist.Add('unknown'); 90 templist.Add('unknown'); 91 templist.Add('unknown'); 92 templist.Add('unknown'); 93 AddField(TBitSet, $8B, 'Flags4', '', @templist); 94 49 95 tempi := 2; 50 96 AddField(TInt, $8C, 'Width', '', @tempi); 97 51 98 tempi := 2; 52 99 AddField(TInt, $8E, 'Height', '', @tempi); 100 53 101 tempi := 4; 54 102 AddField(TInt, $90, 'StoreType', '', @tempi); 55 temps := 'TXAN'; 103 104 temps := '*'; 56 105 AddField(TLinkByID, $94, 'TXAN', '', @temps); 106 57 107 temps := 'TXMP'; 58 108 AddField(TLinkByID, $98, 'TXMP', '', @temps); 109 59 110 AddField(TRawLink, $9C, 'RawLink', '', nil); 111 60 112 AddField(TRawLink, $A0, 'SepLink', '', nil); 113 61 114 tempi := $1C; 62 115 AddField(TUnused, $A4, 'Unused', '', @tempi); 63 116 end; 117 templist.Free; 64 118 end; 65 119 -
oup/current/FileClasses/_DataTypes.pas
r206 r207 2 2 3 3 interface 4 5 uses 6 Classes; 4 7 5 8 type 6 9 TDataField = class 7 pr ivate10 protected 8 11 FOffset: Integer; 9 12 FName: String; … … 28 31 TFieldType = class of TDataField; 29 32 33 30 34 TBlock = class(TDataField) 31 35 private … … 35 39 function GetFieldCount: Integer; 36 40 public 37 // ExtraArgs: Pointer auf 2 Integer: Length+Count41 // ExtraArgs: keine 38 42 constructor Create(ParentFile: TObject; Offset: Integer; 39 43 Name, Description: String; ExtraArgs: Pointer); override; … … 54 58 public 55 59 // ExtraArgs: Pointer auf Integer: Bytes of TInt 60 constructor Create(ParentFile: TObject; Offset: Integer; 61 Name, Description: String; ExtraArgs: Pointer); override; 62 procedure Update(Offset, Length: Integer); override; 63 end; 64 65 66 TBitSet = class(TDataField) 67 private 68 FBits: Byte; 69 FNames: TStringList; 70 function GetValueAsString: String; override; 71 public 72 // ExtraArgs: Pointer auf TStringList 56 73 constructor Create(ParentFile: TObject; Offset: Integer; 57 74 Name, Description: String; ExtraArgs: Pointer); override; … … 116 133 function GetFieldCount: Integer; 117 134 public 118 // ExtraArgs: Pointer auf 2 Integer: Length+Count 135 // ExtraArgs: Pointer auf 2 Integer: Length+Count (packed record...) 119 136 constructor Create(ParentFile: TObject; Offset: Integer; 120 137 Name, Description: String; ExtraArgs: Pointer); override; … … 152 169 153 170 171 172 154 173 implementation 155 174 156 175 uses 157 SysUtils, Dialogs, _FileTypes, Classes, ConnectionManager; 158 176 SysUtils, Dialogs, _FileTypes, ConnectionManager; 177 178 179 159 180 160 181 { TDataType } … … 167 188 FDescription := Description; 168 189 FParentFile := ParentFile; 169 end;170 171 172 173 { TInt32 }174 175 constructor TInt.Create(ParentFile: TObject; Offset: Integer;176 Name, Description: String; ExtraArgs: Pointer);177 var178 fstream: TMemoryStream;179 begin180 inherited Create(ParentFile, Offset, Name, Description, ExtraArgs);181 FDataLength := Integer(ExtraArgs^);182 FInt := 0;183 fstream := TFile(ParentFile).FileStream;184 fstream.Seek(Offset, soFromBeginning);185 fstream.Read(FInt, FDataLength);186 end;187 188 function TInt.GetValueAsString: String;189 begin190 Result := IntToStr(FInt);191 end;192 193 procedure TInt.Update(Offset, Length: Integer);194 begin195 Exit;196 190 end; 197 191 … … 226 220 227 221 procedure TString.Update(Offset, Length: Integer); 222 begin 223 Exit; 224 end; 225 226 227 228 { TInt } 229 230 constructor TInt.Create(ParentFile: TObject; Offset: Integer; 231 Name, Description: String; ExtraArgs: Pointer); 232 var 233 fstream: TMemoryStream; 234 begin 235 inherited Create(ParentFile, Offset, Name, Description, ExtraArgs); 236 FDataLength := Integer(ExtraArgs^); 237 FInt := 0; 238 fstream := TFile(ParentFile).FileStream; 239 fstream.Seek(Offset, soFromBeginning); 240 fstream.Read(FInt, FDataLength); 241 end; 242 243 function TInt.GetValueAsString: String; 244 begin 245 Result := IntToStr(FInt); 246 end; 247 248 procedure TInt.Update(Offset, Length: Integer); 228 249 begin 229 250 Exit; … … 466 487 end; 467 488 489 490 491 { TBitSet } 492 493 constructor TBitSet.Create(ParentFile: TObject; Offset: Integer; Name, 494 Description: String; ExtraArgs: Pointer); 495 var 496 fstream: TMemoryStream; 497 begin 498 inherited Create(ParentFile, Offset, Name, Description, ExtraArgs); 499 FNames := TStringList.Create; 500 FNames.AddStrings(TStringList(ExtraArgs^)); 501 FDataLength := 1; 502 FBits := 0; 503 fstream := TFile(ParentFile).FileStream; 504 fstream.Seek(Offset, soFromBeginning); 505 fstream.Read(FBits, FDataLength); 506 end; 507 508 function TBitSet.GetValueAsString: String; 509 begin 510 Result := IntToStr(FBits); 511 end; 512 513 procedure TBitSet.Update(Offset, Length: Integer); 514 begin 515 Exit; 516 end; 517 468 518 end. -
oup/current/FileClasses/_FileTypes.pas
r206 r207 47 47 48 48 49 TFileType = class of TFile; 50 51 49 52 implementation 50 53 … … 79 82 FFile.Free; 80 83 FFile := nil; 81 82 // FDatLinks := DatLinksManager.GetDatLinks(ConnectionID, FileID);83 // FRawParts := RawLists.GetRawList(ConnectionID, FileID);84 84 end; 85 85
Note:
See TracChangeset
for help on using the changeset viewer.