ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/oup/current/Global/OniImgClass.pas
(Generate patch)

Comparing oup/current/Global/OniImgClass.pas (file contents):
Revision 192 by alloc, Thu May 24 17:48:18 2007 UTC vs.
Revision 194 by alloc, Sat May 26 18:26:48 2007 UTC

# Line 15 | Line 15 | type
15      function GetHeight(MipGen: Integer): Integer;
16      function GetImageFormat: TImageFormat;
17      procedure SetImageFormat(Format: TImageFormat);
18 +    function pGetImageFormatInfo: TImageFormatInfo;
19      function GetHasMipMaps: Boolean;
20    protected
21    public
# Line 23 | Line 24 | type
24      property Width[MipGen: Integer]: Integer    read GetWidth;
25      property Height[MipGen: Integer]: Integer   read GetHeight;
26      property Format: TImageFormat read GetImageFormat write SetImageFormat;
27 +    property FormatInfo: TImageFormatInfo read pGetImageFormatInfo;
28      property HasMipMaps: Boolean read GetHasMipMaps;
29  
30      constructor Create;
# Line 55 | Line 57 | var
57    rect: TRect;
58   begin
59    InitImage(singleimg);
60 <  CloneImage(FImages[Index], singleimg);
60 >  CloneImage(FImages[Index-1], singleimg);
61    ConvertImage(singleimg, ifX8R8G8B8);
62    rect.Left := 0;
63    rect.Top := 0;
# Line 130 | Line 132 | begin
132   end;
133  
134  
135 + function TOniImage.pGetImageFormatInfo: TImageFormatInfo;
136 + begin
137 +  if Length(FImages) > 0 then
138 +    GetImageFormatInfo(FImages[0].Format, Result);
139 + end;
140 +
141 +
142   function TOniImage.GetHasMipMaps: Boolean;
143   begin
144    Result := Length(FImages) > 1;
# Line 423 | Line 432 | begin
432      ConManager.Connection[ConnectionID].LoadRawFile(fileid, $9C, TStream(data))
433    else
434      ConManager.Connection[ConnectionID].LoadRawFile(fileid, $A0, TStream(data));
435 +
436 + //  data.Seek(0, soFromBeginning);
437 + //  data.SaveToFile('m:\test.txmp');
438 +
439    data.Seek(0, soFromBeginning);
440    result := LoadMultiImageFromStream(data, FImages);
441    data.Free;
442 <
442 > {
443 >  if result then
444 >  begin
445 >    for i := 0 to High(FImages) do
446 >    begin
447 >      data := TMemoryStream.Create;
448 >      data.Write(FImages[i].Bits^, FImages[i].Size);
449 >      data.Seek(0, soFromBeginning);
450 >      data.SaveToFile('m:\test.txmp.'+IntToStr(i));
451 >      data.Free;
452 >    end;
453 >  end;
454 > }
455    if not result then
456    begin
457      ShowMessage('Error while loading file' + #13#10 + DetermineStreamFormat(data));

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)