Changeset 251


Ignore:
Timestamp:
May 22, 2020, 11:52:44 PM (5 years ago)
Author:
chronos
Message:
  • Fixed: Drawing start screen ornament under Windows.
Location:
branches/highdpi
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/LocalPlayer/Term.pas

    r246 r251  
    532532
    533533  SaveOption: array [0 .. nSaveOption - 1] of integer;
    534   MiniColors: array [0 .. 11, 0 .. 1] of TColor;
     534  MiniColors: array [0 .. $1f, 0 .. 1] of TColor;
    535535  MainMap: TIsoMap;
    536536  CurrentMoveInfo: record AfterMovePaintRadius, AfterAttackExpeller: integer;
  • branches/highdpi/Packages/CevoComponents/ScreenTools.pas

    r249 r251  
    981981var
    982982  P: TColor;
    983   X, Y, Light, Shade: Integer;
     983  X, Y: Integer;
     984  Light, Shade: TColor32;
    984985  PixelPtr: TPixelPointer;
    985986begin
    986987  if InitOrnamentDone then Exit;
    987   Light := MainTexture.clBevelLight;
     988  Light := ColorToColor32(MainTexture.clBevelLight);
    988989  // and $FCFCFC shr 2*3+MainTexture.clBevelShade and $FCFCFC shr 2;
    989   Shade := MainTexture.clBevelShade and $FCFCFC shr 2 * 3 +
    990     MainTexture.clBevelLight and $FCFCFC shr 2;
     990  Shade := ColorToColor32(MainTexture.clBevelShade and $FCFCFC shr 2 * 3 +
     991    MainTexture.clBevelLight and $FCFCFC shr 2);
    991992  GrExt[HGrSystem2].Data.BeginUpdate;
    992993  PixelPtr := PixelPointer(GrExt[HGrSystem2].Data, ScaleToNative(xOrna), ScaleToNative(yOrna));
    993   for Y := 0 to ScaleToNative(hOrna) - 1 do begin
    994     for X := 0 to ScaleToNative(wOrna) - 1 do begin
    995       P := Color32ToColor(PixelPtr.Pixel^.ARGB);
    996       if P = $0000FF then PixelPtr.Pixel^.ARGB := ColorToColor32(Light)
    997       else if P = $FF0000 then PixelPtr.Pixel^.ARGB := ColorToColor32(Shade);
    998       PixelPtr.NextPixel;
    999     end;
    1000     PixelPtr.NextLine;
     994  if PixelPtr.BytesPerPixel = 3 then begin
     995    for Y := 0 to ScaleToNative(hOrna) - 1 do begin
     996      for X := 0 to ScaleToNative(wOrna) - 1 do begin
     997        P := Color32ToColor(PixelPtr.Pixel^.GetRGB);
     998        if P = $0000FF then PixelPtr.Pixel^.SetRGB(Light)
     999        else if P = $FF0000 then PixelPtr.Pixel^.SetRGB(Shade);
     1000        PixelPtr.NextPixel;
     1001      end;
     1002      PixelPtr.NextLine;
     1003    end;
     1004  end else begin
     1005    for Y := 0 to ScaleToNative(hOrna) - 1 do begin
     1006      for X := 0 to ScaleToNative(wOrna) - 1 do begin
     1007        P := Color32ToColor(PixelPtr.Pixel^.ARGB);
     1008        if P = $0000FF then PixelPtr.Pixel^.ARGB := Light
     1009        else if P = $FF0000 then PixelPtr.Pixel^.ARGB := Shade;
     1010        PixelPtr.NextPixel;
     1011      end;
     1012      PixelPtr.NextLine;
     1013    end;
    10011014  end;
    10021015  InitOrnamentDone := True;
  • branches/highdpi/Packages/CevoComponents/UPixelPointer.pas

    r249 r251  
    99  TColor32 = type Cardinal;
    1010  TColor32Component = (ccBlue, ccGreen, ccRed, ccAlpha);
     11
     12  { TPixel32 }
     13
    1114  TPixel32 = packed record
     15    procedure SetRGB(Color: TColor32);
     16    function GetRGB: TColor32;
    1217    case Integer of
    1318      0: (B, G, R, A: Byte);
     
    4247
    4348implementation
     49
     50{ TPixel32 }
     51
     52procedure TPixel32.SetRGB(Color: TColor32);
     53begin
     54  B := Color and $ff;
     55  G := (Color shr 8) and $ff;
     56  R := (Color shr 16) and $ff;
     57end;
     58
     59function TPixel32.GetRGB: TColor32;
     60begin
     61  Result := ARGB and $ffffff;
     62end;
    4463
    4564{ TPixelPointer }
Note: See TracChangeset for help on using the changeset viewer.