Changeset 215 for oup/current/FileClasses
- Timestamp:
- Jun 12, 2007, 10:31:54 PM (18 years ago)
- Location:
- oup/current/FileClasses
- Files:
-
- 111 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/FileClasses/TXAN.pas
r214 r215 8 8 type 9 9 TFile_TXAN = class(TFile) 10 protected11 procedure InitDatLinks; override;12 procedure InitRawList; override;13 10 public 14 11 procedure InitDataFields; override; … … 56 53 57 54 58 procedure TFile_TXAN.InitDatLinks;59 var60 links: Integer;61 i: Integer;62 begin63 ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $1C, SizeOf(links), @links);64 SetLength(FDatLinks, links);65 for i := 0 to links - 1 do66 begin67 FDatLinks[i].SrcOffset := $20 + $4 * i;68 FDatLinks[i].DestID := GetDatLinkValue(FFileStream, FDatLinks[i].SrcOffset);69 FDatLinks[i].PosDestExts := 'TXMP';70 end;71 end;72 73 74 procedure TFile_TXAN.InitRawList;75 begin76 SetLength(FRawParts, 0);77 end;78 79 55 end. 80 56 -
oup/current/FileClasses/TXMP.pas
r214 r215 8 8 type 9 9 TFile_TXMP = class(TFile) 10 protected11 procedure InitDatLinks; override;12 procedure InitRawList; override;13 10 public 14 11 procedure InitDataFields; override; … … 109 106 110 107 111 procedure TFile_TXMP.InitDatLinks;112 begin113 SetLength(FDatLinks, 2);114 FDatLinks[0].SrcOffset := $94;115 FDatLinks[0].DestID := GetDatLinkValue(FFileStream, $94);116 FDatLinks[0].PosDestExts := '*';117 FDatLinks[1].SrcOffset := $98;118 FDatLinks[1].DestID := GetDatLinkValue(FFileStream, $98);119 FDatLinks[1].PosDestExts := 'TXMP';120 end;121 122 123 procedure TFile_TXMP.InitRawList;124 var125 link_pc: Integer;126 link_mac: Integer;127 x, y: Word;128 storetype: Byte;129 datasize: Integer;130 mipmap: Byte;131 132 function GetImgSize(w,h, storetype: Integer): Integer;133 begin134 case storetype of135 0, 1, 2:136 Result := w*h*2;137 8:138 Result := w*h*4;139 9:140 Result := Max(1, w div 4) * Max(1, h div 4) * 8;141 else142 Result := -1;143 end;144 end;145 146 begin147 ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $88, SizeOf(mipmap), @mipmap);148 ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $8C, SizeOf(x), @x);149 ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $8E, SizeOf(y), @y);150 ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $90, SizeOf(storetype), @storetype);151 ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $9C, 4, @link_pc);152 ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $A0, 4, @link_mac);153 154 datasize := GetImgSize(x, y, storetype);155 if (mipmap and $01) > 0 then156 begin157 repeat158 x := Max(x div 2, 1);159 y := Max(y div 2, 1);160 datasize := datasize + GetImgSize(x, y, storetype);161 until (x = 1) and (y = 1);162 end;163 164 SetLength(FRawParts, 1);165 if ConManager.Connection[FConnectionID].DataOS = DOS_WIN then166 begin167 FRawParts[0].SrcOffset := $9C;168 FRawParts[0].RawAddr := link_pc;169 end170 else171 begin172 FRawParts[0].SrcOffset := $A0;173 FRawParts[0].RawAddr := link_mac;174 end;175 FRawParts[0].RawSize := datasize;176 FRawParts[0].LocSep := not (ConManager.Connection[FConnectionID].DataOS = DOS_WIN);177 end;178 179 108 end. 180 109 -
oup/current/FileClasses/_EmptyFile.pas
r214 r215 8 8 type 9 9 TFile_Empty = class(TFile) 10 protected11 procedure InitDatLinks; override;12 procedure InitRawList; override;13 10 public 14 11 procedure InitDataFields; override; … … 27 24 28 25 29 procedure TFile_Empty.InitDatLinks;30 begin31 SetLength(FDatLinks, 0);32 end;33 34 35 procedure TFile_Empty.InitRawList;36 begin37 SetLength(FRawParts, 0);38 end;39 40 26 end. 41 27 -
oup/current/FileClasses/_FileTypes.pas
r214 r215 27 27 FOpened: Boolean; 28 28 29 procedure InitDatLinks; virtual; abstract;30 procedure InitRawList; virtual; abstract;29 procedure InitDatLinks; 30 procedure InitRawList; 31 31 32 32 function GetDatLinkByOffset(Offset: Integer): TDatLink; … … 101 101 FFileStream := TMemoryStream.Create; 102 102 ConManager.Connection[ConnectionID].LoadDatFile(FileID, TStream(FFileStream)); 103 end; 104 105 InitDatLinks(); 106 InitRawList(); 107 FDataFields := nil; 108 FEditor := nil; 109 110 if not (Self is TFile_Empty) then 103 104 InitDatLinks(); 105 InitRawList(); 106 FDataFields := nil; 107 FEditor := nil; 108 111 109 FFileStream.Free; 112 FFileStream := nil; 110 FFileStream := nil; 111 end 112 else 113 begin 114 SetLength(FDatLinks, 0); 115 SetLength(FRawParts, 0); 116 FEditor := nil; 117 end; 113 118 end; 114 119 … … 234 239 end; 235 240 241 procedure TFile.InitDatLinks; 242 begin 243 FDatLinks := ConManager.Connection[FConnectionID].GetDatLinks(FFileID); 244 end; 245 236 246 procedure TFile.InitEditor; 237 247 begin 238 248 Exit; 249 end; 250 251 procedure TFile.InitRawList; 252 begin 253 FRawParts := ConManager.Connection[FConnectionID].GetRawList(FFileID); 239 254 end; 240 255 -
oup/current/FileClasses/_MetaManager.pas
r214 r215 2 2 interface 3 3 4 uses _FileTypes, SUBT, TXAN, TXMP, _EmptyFile; 4 uses _FileTypes, 5 ABNA, AGDB, AGQC, AGQG, AGQM, AGQR, AISA, AITR, AIWA, AKAA, AKBA, AKBP, AKDA, 6 AKEV, AKOT, AKVA, BINA, CBPI, CBPM, CONS, CRSA, DOOR, DPge, EDIA, ENVP, FILM, 7 FXLR, GMAN, HPge, IDXA, IGHH, IGPA, IGPG, IGSA, IGSt, Impt, IPge, KeyI, M3GA, 8 M3GM, M3TA, Mtrl, NMSA, OBAN, OBDC, OBLS, OBOA, OFGA, ONCC, ONCP, ONCV, ONFA, 9 ONGS, ONIA, ONLD, ONLV, ONMA, ONOA, ONSA, ONSK, ONTA, ONVL, ONWC, OPge, OSBD, 10 OTIT, OTLF, PLEA, PNTA, PSpc, PSpL, PSUI, QTNA, QUDA, SNDD, StNA, SUBT, TMFA, 11 TMRA, TRAC, TRAM, TRAS, TRBS, TRCM, TRFT, TRGA, TRGE, TRIA, TRIG, TRMA, TRSC, 12 TRTA, TSFF, TSFL, TSFT, TSGA, TStr, TURR, TXAN, TXCA, TXMA, TXMB, TXMP, TXPC, 13 TxtC, UUEA, UVDL, VCRA, WMCL, WMDD, WMM_, WMMB, WPge, 14 _EmptyFile; 5 15 6 16 type … … 12 22 13 23 const 14 FileDescs: array[0..2] of TFileDesc = ( 24 FileDescs: array[0..112] of TFileDesc = ( 25 (ext: 'ABNA'; ftype: TFile_ABNA), 26 (ext: 'AGDB'; ftype: TFile_AGDB), 27 (ext: 'AGQC'; ftype: TFile_AGQC), 28 (ext: 'AGQG'; ftype: TFile_AGQG), 29 (ext: 'AGQM'; ftype: TFile_AGQM), 30 (ext: 'AGQR'; ftype: TFile_AGQR), 31 (ext: 'AISA'; ftype: TFile_AISA), 32 (ext: 'AITR'; ftype: TFile_AITR), 33 (ext: 'AIWA'; ftype: TFile_AIWA), 34 (ext: 'AKAA'; ftype: TFile_AKAA), 35 (ext: 'AKBA'; ftype: TFile_AKBA), 36 (ext: 'AKBP'; ftype: TFile_AKBP), 37 (ext: 'AKDA'; ftype: TFile_AKDA), 38 (ext: 'AKEV'; ftype: TFile_AKEV), 39 (ext: 'AKOT'; ftype: TFile_AKOT), 40 (ext: 'AKVA'; ftype: TFile_AKVA), 41 (ext: 'BINA'; ftype: TFile_BINA), 42 (ext: 'CBPI'; ftype: TFile_CBPI), 43 (ext: 'CBPM'; ftype: TFile_CBPM), 44 (ext: 'CONS'; ftype: TFile_CONS), 45 (ext: 'CRSA'; ftype: TFile_CRSA), 46 (ext: 'DOOR'; ftype: TFile_DOOR), 47 (ext: 'DPge'; ftype: TFile_DPge), 48 (ext: 'EDIA'; ftype: TFile_EDIA), 49 (ext: 'ENVP'; ftype: TFile_ENVP), 50 (ext: 'FILM'; ftype: TFile_FILM), 51 (ext: 'FXLR'; ftype: TFile_FXLR), 52 (ext: 'GMAN'; ftype: TFile_GMAN), 53 (ext: 'HPge'; ftype: TFile_HPge), 54 (ext: 'IDXA'; ftype: TFile_IDXA), 55 (ext: 'IGHH'; ftype: TFile_IGHH), 56 (ext: 'IGPA'; ftype: TFile_IGPA), 57 (ext: 'IGPG'; ftype: TFile_IGPG), 58 (ext: 'IGSA'; ftype: TFile_IGSA), 59 (ext: 'IGSt'; ftype: TFile_IGSt), 60 (ext: 'Impt'; ftype: TFile_Impt), 61 (ext: 'IPge'; ftype: TFile_IPge), 62 (ext: 'KeyI'; ftype: TFile_KeyI), 63 (ext: 'M3GA'; ftype: TFile_M3GA), 64 (ext: 'M3GM'; ftype: TFile_M3GM), 65 (ext: 'M3TA'; ftype: TFile_M3TA), 66 (ext: 'Mtrl'; ftype: TFile_Mtrl), 67 (ext: 'NMSA'; ftype: TFile_NMSA), 68 (ext: 'OBAN'; ftype: TFile_OBAN), 69 (ext: 'OBDC'; ftype: TFile_OBDC), 70 (ext: 'OBLS'; ftype: TFile_OBLS), 71 (ext: 'OBOA'; ftype: TFile_OBOA), 72 (ext: 'OFGA'; ftype: TFile_OFGA), 73 (ext: 'ONCC'; ftype: TFile_ONCC), 74 (ext: 'ONCP'; ftype: TFile_ONCP), 75 (ext: 'ONCV'; ftype: TFile_ONCV), 76 (ext: 'ONFA'; ftype: TFile_ONFA), 77 (ext: 'ONGS'; ftype: TFile_ONGS), 78 (ext: 'ONIA'; ftype: TFile_ONIA), 79 (ext: 'ONLD'; ftype: TFile_ONLD), 80 (ext: 'ONLV'; ftype: TFile_ONLV), 81 (ext: 'ONMA'; ftype: TFile_ONMA), 82 (ext: 'ONOA'; ftype: TFile_ONOA), 83 (ext: 'ONSA'; ftype: TFile_ONSA), 84 (ext: 'ONSK'; ftype: TFile_ONSK), 85 (ext: 'ONTA'; ftype: TFile_ONTA), 86 (ext: 'ONVL'; ftype: TFile_ONVL), 87 (ext: 'ONWC'; ftype: TFile_ONWC), 88 (ext: 'OPge'; ftype: TFile_OPge), 89 (ext: 'OSBD'; ftype: TFile_OSBD), 90 (ext: 'OTIT'; ftype: TFile_OTIT), 91 (ext: 'OTLF'; ftype: TFile_OTLF), 92 (ext: 'PLEA'; ftype: TFile_PLEA), 93 (ext: 'PNTA'; ftype: TFile_PNTA), 94 (ext: 'PSpc'; ftype: TFile_PSpc), 95 (ext: 'PSpL'; ftype: TFile_PSpL), 96 (ext: 'PSUI'; ftype: TFile_PSUI), 97 (ext: 'QTNA'; ftype: TFile_QTNA), 98 (ext: 'QUDA'; ftype: TFile_QUDA), 99 (ext: 'SNDD'; ftype: TFile_SNDD), 100 (ext: 'StNA'; ftype: TFile_StNA), 15 101 (ext: 'SUBT'; ftype: TFile_SUBT), 102 (ext: 'TMFA'; ftype: TFile_TMFA), 103 (ext: 'TMRA'; ftype: TFile_TMRA), 104 (ext: 'TRAC'; ftype: TFile_TRAC), 105 (ext: 'TRAM'; ftype: TFile_TRAM), 106 (ext: 'TRAS'; ftype: TFile_TRAS), 107 (ext: 'TRBS'; ftype: TFile_TRBS), 108 (ext: 'TRCM'; ftype: TFile_TRCM), 109 (ext: 'TRFT'; ftype: TFile_TRFT), 110 (ext: 'TRGA'; ftype: TFile_TRGA), 111 (ext: 'TRGE'; ftype: TFile_TRGE), 112 (ext: 'TRIA'; ftype: TFile_TRIA), 113 (ext: 'TRIG'; ftype: TFile_TRIG), 114 (ext: 'TRMA'; ftype: TFile_TRMA), 115 (ext: 'TRSC'; ftype: TFile_TRSC), 116 (ext: 'TRTA'; ftype: TFile_TRTA), 117 (ext: 'TSFF'; ftype: TFile_TSFF), 118 (ext: 'TSFL'; ftype: TFile_TSFL), 119 (ext: 'TSFT'; ftype: TFile_TSFT), 120 (ext: 'TSGA'; ftype: TFile_TSGA), 121 (ext: 'TStr'; ftype: TFile_TStr), 122 (ext: 'TURR'; ftype: TFile_TURR), 16 123 (ext: 'TXAN'; ftype: TFile_TXAN), 17 (ext: 'TXMP'; ftype: TFile_TXMP) 124 (ext: 'TXCA'; ftype: TFile_TXCA), 125 (ext: 'TXMA'; ftype: TFile_TXMA), 126 (ext: 'TXMB'; ftype: TFile_TXMB), 127 (ext: 'TXMP'; ftype: TFile_TXMP), 128 (ext: 'TXPC'; ftype: TFile_TXPC), 129 (ext: 'TxtC'; ftype: TFile_TxtC), 130 (ext: 'UUEA'; ftype: TFile_UUEA), 131 (ext: 'UVDL'; ftype: TFile_UVDL), 132 (ext: 'VCRA'; ftype: TFile_VCRA), 133 (ext: 'WMCL'; ftype: TFile_WMCL), 134 (ext: 'WMDD'; ftype: TFile_WMDD), 135 (ext: 'WMM_'; ftype: TFile_WMM_), 136 (ext: 'WMMB'; ftype: TFile_WMMB), 137 (ext: 'WPge'; ftype: TFile_WPge) 18 138 ); 19 139
Note:
See TracChangeset
for help on using the changeset viewer.