Changeset 316


Ignore:
Timestamp:
Mar 18, 2021, 11:31:20 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Some Templates items used as TGraphicSetItem.
Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/MessgEx.pas

    r315 r316  
    233233  hScrewed = 27;
    234234var
    235   ix, iy, xDst, yDst, dx, dy, xIcon, yIcon, xb, yb, wb, hb: integer;
     235  ix, iy, xDst, yDst, dx, dy, xIcon, yIcon: integer;
     236  BookRect: TRect;
    236237  x1, xR, yR, share: single;
    237238  Screwed: array [0 .. wScrewed - 1, 0 .. hScrewed - 1, 0 .. 3] of single;
     
    282283    end;
    283284    BigImp.EndUpdate;
    284     xb := xBBook;
    285     yb := yBBook;
    286     wb := wBBook;
    287     hb := hBBook;
     285    BookRect := BigBook.BoundsRect;
    288286  end
    289287  else
    290288  begin
    291     xb := xSBook;
    292     yb := ySBook;
    293     wb := wSBook;
    294     hb := hSBook;
    295   end;
    296   x := x - wb div 2;
     289    BookRect := SmallBook.BoundsRect;
     290  end;
     291  x := x - BookRect.Width div 2;
    297292
    298293  // paint
    299294  // TODO: Explicitly clear background to black but in fact BitBlt SRCCOPY should do it
    300295  LogoBuffer.Canvas.FillRect(0, 0, LogoBuffer.Width, LogoBuffer.Height);
    301   BitBltCanvas(LogoBuffer.Canvas, 0, 0, wb, hb, ca, x, y);
     296  BitBltCanvas(LogoBuffer.Canvas, 0, 0, BookRect.Width, BookRect.Height, ca, x, y);
    302297
    303298  if IconIndex >= 0 then
     
    310305            Trunc(Screwed[ix, iy, 0] / Screwed[ix, iy, 3]) shl 16;
    311306
    312   ImageOp_BCC(LogoBuffer, Templates.Data, 0, 0, xb, yb, wb, hb, clCover, clPage);
    313 
    314   BitBltCanvas(ca, x, y, wb, hb, LogoBuffer.Canvas, 0, 0);
     307  ImageOp_BCC(LogoBuffer, Templates.Data, Point(0, 0), BookRect, clCover, clPage);
     308
     309  BitBltCanvas(ca, x, y, BookRect.Width, BookRect.Height, LogoBuffer.Canvas, 0, 0);
    315310end;
    316311
  • trunk/LocalPlayer/Term.pas

    r315 r316  
    48434843  end;
    48444844  if GameMode <> cMovie then
    4845     ImageOp_BCC(TopBar, Templates.Data, 2, 1, 145, 38, 36, 36, $BFBF20, $4040DF);
     4845    ImageOp_BCC(TopBar, Templates.Data, Point(2, 1), MenuLogo.BoundsRect, $BFBF20, $4040DF);
    48464846  if MyRO.nCity > 0 then
    48474847  begin
  • trunk/Packages/CevoComponents/ScreenTools.pas

    r315 r316  
    4949procedure MakeRed(Dst: TBitmap; X, Y, Width, Height: Integer);
    5050procedure ImageOp_B(dst, Src: TBitmap; xDst, yDst, xSrc, ySrc, Width, Height: Integer);
    51 procedure ImageOp_BCC(dst, Src: TBitmap;
    52   xDst, yDst, xSrc, ySrc, Width, Height, Color1, Color2: Integer);
     51procedure ImageOp_BCC(Dst, Src: TBitmap;
     52  xDst, yDst, xSrc, ySrc, Width, Height, Color1, Color2: Integer); overload;
     53procedure ImageOp_BCC(Dst, Src: TBitmap;
     54  DstPos: TPoint; SrcRect: TRect; Color1, Color2: Integer); overload;
    5355procedure ImageOp_CBC(Dst, Src: TBitmap; xDst, yDst, xSrc, ySrc, Width, Height,
    5456  Color0, Color2: Integer);
     
    115117
    116118  // template positions in Templates.png
    117   xLogo = 1;
    118   yLogo = 1;
    119   wLogo = 122;
    120   hLogo = 23; // logo
    121   xBBook = 1;
    122   yBBook = 74;
    123   wBBook = 143;
    124   hBBook = 73; // big book
    125   xSBook = 72;
    126   ySBook = 37;
    127   wSBook = 72;
    128   hSBook = 36; // small book
    129119  xNation = 1;
    130120  yNation = 25;
     
    177167  Ornament: TGraphicSetItem;
    178168  Logo: TGraphicSetItem;
     169  BigBook: TGraphicSetItem;
     170  SmallBook: TGraphicSetItem;
     171  MenuLogo: TGraphicSetItem;
    179172  ClickFrameColor: Integer;
    180173  MainTextureAge: Integer;
     
    734727  Src.EndUpdate;
    735728  dst.EndUpdate;
     729end;
     730
     731procedure ImageOp_BCC(Dst, Src: TBitmap; DstPos: TPoint; SrcRect: TRect;
     732  Color1, Color2: Integer);
     733begin
     734  ImageOp_BCC(Dst, Src, DstPos.X, DstPos.Y, SrcRect.Left, SrcRect.Top,
     735    SrcRect.Width, SrcRect.Height, Color1, Color2);
    736736end;
    737737
     
    14981498  // TODO: Explicitly clear background to black but in fact BitBlt SRCCOPY should do it
    14991499  LogoBuffer.Canvas.FillRect(0, 0, LogoBuffer.Width, LogoBuffer.Height);
    1500   BitBltCanvas(LogoBuffer.Canvas, 0, 0, wLogo, hLogo, ca, x, y);
    1501   ImageOp_BCC(LogoBuffer, Templates.Data, 0, 0, 1, 1, wLogo, hLogo,
     1500  BitBltCanvas(LogoBuffer.Canvas, 0, 0, Logo.Width, Logo.Height, ca, x, y);
     1501  ImageOp_BCC(LogoBuffer, Templates.Data, Point(0, 0), Logo.BoundsRect,
    15021502    clLight, clShade);
    1503   BitBltCanvas(ca, x, y, wLogo, hLogo, LogoBuffer.Canvas, 0, 0);
     1503  BitBltCanvas(ca, x, y, Logo.Width, Logo.Height, LogoBuffer.Canvas, 0, 0);
    15041504end;
    15051505
     
    16821682  LoadFonts;
    16831683  Templates := LoadGraphicSet2('Templates.png');
     1684  Logo := Templates.GetItem('Logo');
     1685  BigBook := Templates.GetItem('BigBook');
     1686  SmallBook := Templates.GetItem('SmallBook');
     1687  MenuLogo := Templates.GetItem('MenuLogo');
    16841688  LoadGraphicFile(Colors, GetGraphicsDir + DirectorySeparator + 'Colors.png');
    16851689  LoadGraphicFile(Paper, GetGraphicsDir + DirectorySeparator + 'Paper.jpg');
     
    16981702  ResolutionChanged := False;
    16991703  {$ENDIF}
    1700 
    1701   LogoBuffer := TBitmap.Create;
    1702   LogoBuffer.PixelFormat := pf24bit;
    1703   LogoBuffer.SetSize(wBBook, hBBook);
    17041704
    17051705  for Section := Low(TFontType) to High(TFontType) do
     
    17281728
    17291729  LoadAssets;
     1730
     1731  LogoBuffer := TBitmap.Create;
     1732  LogoBuffer.PixelFormat := pf24bit;
     1733  LogoBuffer.SetSize(BigBook.Width, BigBook.Height);
    17301734end;
    17311735
  • trunk/Start.pas

    r315 r316  
    827827      TabOffset + (Integer(Tab) + 1) * TabSize + 2, TabHeight, MainTexture.clBevelShade,
    828828      MainTexture.clBevelShade); // Tab shadow
     829
     830  // Paint menu logo
    829831  // TODO: Explicitly clear background to black but in fact BitBlt SRCCOPY should do it
    830832  LogoBuffer.Canvas.FillRect(0, 0, LogoBuffer.Width, LogoBuffer.Height);
    831   BitBltCanvas(LogoBuffer.Canvas, 0, 0, 36, 36, Canvas, 6,
     833  BitBltCanvas(LogoBuffer.Canvas, 0, 0, MenuLogo.Width, MenuLogo.Height, Canvas, 6,
    832834    3 + 2 * integer(Tab <> tbMain));
    833835
    834   ImageOp_BCC(LogoBuffer, Templates.Data, 0, 0, 145, 38, 36, 27, $BFBF20, $4040DF);
    835   // logo part 1
    836   ImageOp_BCC(LogoBuffer, Templates.Data, 10, 27, 155, 38 + 27, 26, 9, $BFBF20,
    837     $4040DF); // logo part 2
    838   BitBltCanvas(Canvas, 6, 3 + 2 * integer(Tab <> tbMain), 36, 36,
     836  ImageOp_BCC(LogoBuffer, Templates.Data, 0, 0, MenuLogo.Left, MenuLogo.Top,
     837    MenuLogo.Width, MenuLogo.Height - 9, $BFBF20, $4040DF); // logo part 1
     838  ImageOp_BCC(LogoBuffer, Templates.Data, 10, 27, MenuLogo.Left + 10,
     839    MenuLogo.Top + 27, MenuLogo.Width - 10, 9, $BFBF20, $4040DF); // logo part 2
     840  BitBltCanvas(Canvas, 6, 3 + 2 * integer(Tab <> tbMain), MenuLogo.Width, MenuLogo.Height,
    839841    LogoBuffer.Canvas, 0, 0);
    840842
Note: See TracChangeset for help on using the changeset viewer.