Changeset 199


Ignore:
Timestamp:
May 26, 2007, 10:41:34 PM (15 years ago)
Author:
alloc
Message:
 
Location:
oup/current
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • oup/current/Global/OniImgClass.pas

    r198 r199  
    184184const
    185185  PartMatch: array[0..8] of Byte = (0, 3, 6, 1, 4, 7, 2, 5, 8);
    186   stretch_x: Integer = 50;
     186  stretch_x: Integer = 1;
    187187  stretch_y: Integer = 1;
    188188var
     
    228228      if (p2[i].X > 0) or (p2[i].Y > 0) then
    229229      begin
    230         parts[part].x_txmp := p1[i].X - 1;
    231         parts[part].y_txmp := p1[i].Y - 1;
     230        parts[part].x_txmp := p1[i].X;// - 1;
     231        parts[part].y_txmp := p1[i].Y;// - 1;
    232232        parts[part].x_pspc := 0;
    233233        if col > 0 then
     
    238238          for y := 0 to row - 1 do
    239239            Inc(parts[part].y_pspc, rows[y]);
    240         parts[part].w := p2[i].X - p1[i].X + 1;
    241         parts[part].h := p2[i].Y - p1[i].Y + 1;
     240        parts[part].w := Max(p2[i].X - p1[i].X, 1);// + 1;
     241        parts[part].h := Max(p2[i].Y - p1[i].Y, 1);// + 1;
    242242        parts[part].used := True;
    243243        cols[col] := parts[part].w;
     
    279279    begin
    280280      part := row*3 + col;
    281       if (row = 1) and (col = 1) then
    282         StretchRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h,
    283             FImages[0], x, y, parts[part].w * stretch_x, parts[part].h * stretch_y, rfNearest)
     281      if parts[part].used then
     282      begin
     283        if (row = 1) and (col = 1) then
     284          StretchRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h,
     285              FImages[0], x, y, parts[part].w * stretch_x, parts[part].h * stretch_y, rfNearest)
     286        else
     287        if (row = 1) then
     288          StretchRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h,
     289              FImages[0], x, y, parts[part].w, parts[part].h * stretch_y, rfNearest)
     290        else
     291        if (col = 1) then
     292          StretchRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h,
     293              FImages[0], x, y, parts[part].w * stretch_x, parts[part].h, rfNearest)
     294        else
     295          CopyRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h,
     296              FImages[0], x, y );
     297        if row = 1 then
     298          y := y + parts[part].h * stretch_y
     299        else
     300          y := y + parts[part].h;
     301      end;
     302    end;
     303    if cols[col] > 0 then
     304    begin
     305      if (col = 1) then
     306        x := x + parts[part].w * stretch_x
    284307      else
    285       if (row = 1) then
    286         StretchRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h,
    287             FImages[0], x, y, parts[part].w, parts[part].h * stretch_y, rfNearest)
    288       else
    289       if (col = 1) then
    290         StretchRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h,
    291             FImages[0], x, y, parts[part].w * stretch_x, parts[part].h, rfNearest)
    292       else
    293         CopyRect(parts[part].imgdata, 0, 0, parts[part].w, parts[part].h,
    294             FImages[0], x, y );
    295       if row = 1 then
    296         y := y + parts[part].h * stretch_y
    297       else
    298         y := y + parts[part].h;
    299     end;
    300     if (part mod 3) = 1 then
    301       x := x + parts[part].w * stretch_x
    302     else
    303       x := x + parts[part].w;
     308        x := x + parts[part].w;
     309    end;
    304310  end;
    305311
  • oup/current/Tools/TxmpReplace.pas

    r195 r199  
    130130
    131131    case OniImage_New.Format of
     132      ifX1R5G5B5: new_storetype := 1;
    132133      ifA1R5G5B5: new_storetype := 2;
    133134      ifA4R4G4B4: new_storetype := 0;
Note: See TracChangeset for help on using the changeset viewer.