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

Comparing oup/rewrite/Tools/Preview.pas (file contents):
Revision 94 by alloc, Thu Jan 18 17:18:19 2007 UTC vs.
Revision 101 by alloc, Tue Feb 20 20:43:29 2007 UTC

# Line 3 | Line 3 | interface
3   uses
4    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
5    Dialogs, StdCtrls, Template, ExtCtrls, Math, StrUtils,
6 <  ConnectionManager, {OniImgClass,} Data, TypeDefs, Menus, Buttons;
6 >  ConnectionManager, OniImgClass, Data, TypeDefs, Menus, Buttons;
7  
8   type
9    TForm_Preview = class(TForm_ToolTemplate)
# Line 83 | Line 83 | end;
83  
84   procedure TForm_Preview.LoadImage(fileid, index: Integer);
85   var
86  Data:      TByteArray;
86    memstream: TMemoryStream;
87    OniImage:  TOniImage;
89
88   begin
89    OniImage := TOniImage.Create;
90 <  OniImage.Load(Connection, fileid);
93 <  Data := OniImage.GetAsBMP;
94 <  OniImage.Free;
95 <
90 >  OniImage.Load(ConnectionID, fileid);
91    memstream := TMemoryStream.Create;
92 <  memstream.Write(Data[0], Length(Data));
93 <  memstream.Seek(0, soFromBeginning);
92 >  OniImage.GetAsBMP(TStream(memstream));
93 >  OniImage.Free;
94    bitmaps[index].LoadFromStream(memstream);
95    memstream.Free;
96   end;
# Line 146 | Line 141 | var
141    link: LongWord;
142    i:    Byte;
143   begin
144 <  Connection.LoadDatFilePart(_fileid, $14, SizeOf(loop_speed), @loop_speed);
145 <  Connection.LoadDatFilePart(_fileid, $1C, SizeOf(linkcount), @linkcount);
144 >  ConManager.Connection[ConnectionID].LoadDatFilePart(_fileid, $14, SizeOf(loop_speed), @loop_speed);
145 >  ConManager.Connection[ConnectionID].LoadDatFilePart(_fileid, $1C, SizeOf(linkcount), @linkcount);
146    SetBitmapCount(linkcount);
147    for i := 0 to linkcount - 1 do
148    begin
149 <    Connection.LoadDatFilePart(_fileid, $20 + i * 4, SizeOf(link), @link);
149 >    ConManager.Connection[ConnectionID].LoadDatFilePart(_fileid, $20 + i * 4, SizeOf(link), @link);
150      link := link div 256;
151      if link = 0 then
152        link := _fileid - 1;
# Line 189 | Line 184 | begin
184      Dec(actualimg)
185    else
186      actualimg := High(bitmaps);
187 <  Self.Caption := 'Preview ' + Connection.GetFileInfo(_fileid).FileName +
187 >  Self.Caption := 'Preview ' + ConManager.Connection[ConnectionID].GetFileInfo(_fileid).Name +
188      ' (' + IntToStr(actualimg + 1) + '/' + IntToStr(Length(bitmaps)) + ')';
189    DrawImage(actualimg);
190   end;
# Line 201 | Line 196 | begin
196      Inc(actualimg)
197    else
198      actualimg := 0;
199 <  Self.Caption := 'Preview ' + Connection.GetFileInfo(_fileid).FileName +
199 >  Self.Caption := 'Preview ' + ConManager.Connection[ConnectionID].GetFileInfo(_fileid).Name +
200      ' (' + IntToStr(actualimg + 1) + '/' + IntToStr(Length(bitmaps)) + ')';
201    DrawImage(actualimg);
202   end;

Diff Legend

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