Moin,
Ihr kennt ja alle das Spiel GTA 3 / Vice City. So und alle Models und Texturen sind in einer IMG-Datei gepackt.
Wie entpacke ich die mit Delphi?? Hab nirgends Code dazu gefunden aber Proggis die das können und in Delphi geschrieben sind.
Habe nur von einem diesen Code gefunden:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55:
| type DIRIMG_Entry = packed record StartBlock: Longword; BlockCount: Longword; Name: array[0..23] of Char; end;
function ReadGTA3IMGDIR(dirfile, imgfile: string): Integer; var ENT: DIRIMG_Entry; dirfile, imgfile, disp: string; NumE,x,totFSize,totDSize: integer; Offset, Size: int64; Dhandle: integer; begin
DHandle := FileOpen(dirfile, fmOpenRead); FHandle := FileOpen(imgfile, fmOpenRead);
if (DHandle > 0) and (FHandle > 0) then begin TotDSize := FileSeek(DHandle,0,2); TotFSize := FileSeek(FHandle,0,2); if ((TotDSize mod 32) <> 0) or ((TotFSize mod 2048) <> 0) then begin end else begin FileSeek(DHandle,0,0); FileSeek(FHandle,0,0);
NumE := TotDSize div 32;
for x := 1 to NumE do begin FileRead(DHandle,ENT,SizeOf(ENT)); disp := Strip0(ENT.Name); Per := Round((x / NumE)*100); SetPercent(Per); Offset := ENT.StartBlock * 2048; Size := ENT.BlockCount * 2048; end;
FileClose(Dhandle); FileClose(Fhandle);
end; end else begin end;
end; |
Damit kann ich aber nich viel anfangen?? Ich will bestimmte Dateien aus dem Archiv entpacken können und wieder hinzufügen können und will eine komplette Liste als StringList aller Dateien im Archiv und Größenangabe.
Wie mach ichn das?? Kann mir da einer ma Code-Snippel geben oder so damit ich wenigstens n Anfang habe?
Danke.