Changeset 193 for oup/current


Ignore:
Timestamp:
May 26, 2007, 4:24:55 PM (18 years ago)
Author:
alloc
Message:
 
Location:
oup/current
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • oup/current/DataAccess/DataAccess.pas

    r116 r193  
    6161    function AppendRawFile(LocSep: Boolean; Src: TStream): Integer; overload; virtual;
    6262    function AppendRawFile(LocSep: Boolean; Src: TByteData): Integer; overload;
    63     function AppendRawFile(LocSep: Boolean; Size: Integer; Src: Pointer): Integer; overload;
     63//    function AppendRawFile(LocSep: Boolean; Size: Integer; Src: Pointer): Integer; overload;
    6464  published
    6565  end;
     
    277277  data.Free;
    278278end;
    279 
     279{
    280280function TDataAccess.AppendRawFile(LocSep: Boolean; Size: Integer; Src: Pointer): Integer;
    281281var
     
    288288  data.Free;
    289289end;
    290 
     290}
    291291
    292292
  • oup/current/Global/OniImgClass.pas

    r192 r193  
    5656begin
    5757  InitImage(singleimg);
    58   CloneImage(FImages[Index], singleimg);
     58  CloneImage(FImages[Index-1], singleimg);
    5959  ConvertImage(singleimg, ifX8R8G8B8);
    6060  rect.Left := 0;
     
    424424  else
    425425    ConManager.Connection[ConnectionID].LoadRawFile(fileid, $A0, TStream(data));
     426
     427//  data.Seek(0, soFromBeginning);
     428//  data.SaveToFile('m:\test.txmp');
     429
    426430  data.Seek(0, soFromBeginning);
    427431  result := LoadMultiImageFromStream(data, FImages);
    428432  data.Free;
    429 
     433{
     434  if result then
     435  begin
     436    for i := 0 to High(FImages) do
     437    begin
     438      data := TMemoryStream.Create;
     439      data.Write(FImages[i].Bits^, FImages[i].Size);
     440      data.Seek(0, soFromBeginning);
     441      data.SaveToFile('m:\test.txmp.'+IntToStr(i));
     442      data.Free;
     443    end;
     444  end;
     445}
    430446  if not result then
    431447  begin
  • oup/current/Tools/Preview.pas

    r192 r193  
    9191procedure TForm_Preview.DrawImage(index: Integer);
    9292begin
    93   bitmaps[index].DrawOnCanvas(img.Canvas, 0);
     93  bitmaps[index].DrawOnCanvas(img.Canvas, 1);
    9494end;
    9595
  • oup/current/Tools/TxmpReplace.pas

    r192 r193  
    5757  OniImage_Old.LoadFromTXMP(ConnectionID, fileid);
    5858  old_size := OniImage_Old.GetImageSize(True);
    59   OniImage_Old.DrawOnCanvas(image_txmppreview.Canvas, 0);
     59  OniImage_Old.DrawOnCanvas(image_txmppreview.Canvas, 2);
    6060
    6161  check_fading.Checked := OniImage_Old.HasMipMaps;
     
    7474  begin
    7575    OniImage_New.LoadFromFile(opend.FileName);
    76     OniImage_New.DrawOnCanvas(image_bmppreview.Canvas, 0);
     76    OniImage_New.DrawOnCanvas(image_bmppreview.Canvas, 1);
    7777    group_options.Enabled := True;
    7878  end;
     
    8989  datbyte: Word;
    9090  mem: TMemoryStream;
     91  new_storetype: Byte;
    9192begin
    9293  if filelist.ItemIndex >= 0 then
     
    115116    mem := TMemoryStream.Create;
    116117
     118    case OniImage_New.Format of
     119      ifA1R5G5B5: new_storetype := 2;
     120      ifA4R4G4B4: new_storetype := 0;
     121      ifA8R8G8B8:
     122        begin
     123          new_storetype := 8;
     124          OniImage_New.Format := ifX8R8G8B8;
     125        end;
     126      ifX8R8G8B8: new_storetype := 8;
     127      ifDXT1: new_storetype := 9;
     128    else
     129      OniImage_New.Format := ifX8R8G8B8;
     130      new_storetype := 8;
     131    end;
     132
    117133    OniImage_New.SaveDataToStream(check_fading.Checked, TStream(mem));
    118134
     
    122138    if (newsize > old_size) and (ConManager.Connection[ConnectionID].Backend = DB_ONI) then
    123139      new_rawaddr := ConManager.Connection[ConnectionID].AppendRawFile(
    124         not (ConManager.Connection[ConnectionID].DataOS = DOS_WIN),
    125         mem.Size, mem)
     140        not (ConManager.Connection[ConnectionID].DataOS = DOS_WIN), mem)
    126141    else
    127142    begin
     
    142157    datbyte := OniImage_New.Height[1];
    143158    ConManager.Connection[ConnectionID].UpdateDatFilePart(fileid, $8E, 2, @datbyte);
    144     case OniImage_New.Format of
    145       ifA1R5G5B5: datbyte := 2;
    146       ifA4R4G4B4: datbyte := 0;
    147       ifA8R8G8B8:
    148         begin
    149           datbyte := 8;
    150           OniImage_New.Format := ifX8R8G8B8;
    151         end;
    152       ifX8R8G8B8: datbyte := 8;
    153       ifDXT1: datbyte := 9;
    154     else
    155       OniImage_New.Format := ifX8R8G8B8;
    156       datbyte := 8;
    157     end;
    158     ConManager.Connection[ConnectionID].UpdateDatFilePart(fileid, $90, 1, @datbyte);
     159    ConManager.Connection[ConnectionID].UpdateDatFilePart(fileid, $90, 1, @new_storetype);
    159160    if not (ConManager.Connection[ConnectionID].DataOS = DOS_WIN) then
    160161      ConManager.Connection[ConnectionID].UpdateDatFilePart(fileid, $A0, 4, @new_rawaddr)
Note: See TracChangeset for help on using the changeset viewer.