Changeset 251
- Timestamp:
- May 22, 2020, 11:52:44 PM (4 years ago)
- Location:
- branches/highdpi
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/LocalPlayer/Term.pas
r246 r251 532 532 533 533 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; 535 535 MainMap: TIsoMap; 536 536 CurrentMoveInfo: record AfterMovePaintRadius, AfterAttackExpeller: integer; -
branches/highdpi/Packages/CevoComponents/ScreenTools.pas
r249 r251 981 981 var 982 982 P: TColor; 983 X, Y, Light, Shade: Integer; 983 X, Y: Integer; 984 Light, Shade: TColor32; 984 985 PixelPtr: TPixelPointer; 985 986 begin 986 987 if InitOrnamentDone then Exit; 987 Light := MainTexture.clBevelLight;988 Light := ColorToColor32(MainTexture.clBevelLight); 988 989 // 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); 991 992 GrExt[HGrSystem2].Data.BeginUpdate; 992 993 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; 1001 1014 end; 1002 1015 InitOrnamentDone := True; -
branches/highdpi/Packages/CevoComponents/UPixelPointer.pas
r249 r251 9 9 TColor32 = type Cardinal; 10 10 TColor32Component = (ccBlue, ccGreen, ccRed, ccAlpha); 11 12 { TPixel32 } 13 11 14 TPixel32 = packed record 15 procedure SetRGB(Color: TColor32); 16 function GetRGB: TColor32; 12 17 case Integer of 13 18 0: (B, G, R, A: Byte); … … 42 47 43 48 implementation 49 50 { TPixel32 } 51 52 procedure TPixel32.SetRGB(Color: TColor32); 53 begin 54 B := Color and $ff; 55 G := (Color shr 8) and $ff; 56 R := (Color shr 16) and $ff; 57 end; 58 59 function TPixel32.GetRGB: TColor32; 60 begin 61 Result := ARGB and $ffffff; 62 end; 44 63 45 64 { TPixelPointer }
Note:
See TracChangeset
for help on using the changeset viewer.