Changeset 46 for trunk/Start.pas
- Timestamp:
- Jan 11, 2017, 8:12:01 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Start.pas
r41 r46 5 5 6 6 uses 7 GameServer, Messg, ButtonBase, ButtonA, ButtonC, ButtonB, Area, 8 9 LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms, StdCtrls, 7 GameServer, Messg, ButtonBase, ButtonA, ButtonC, ButtonB, Area, Math, 8 LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms, StdCtrls, 10 9 Menus, Registry; 11 10 … … 451 450 BiColorTextOut(Canvas, Colors.Canvas.Pixels[clkAge0 - 1, cliDimmedText], 452 451 $000000, xAction, y + 21, Phrases2.Lookup(TextItem)); 453 BitBlt (LogoBuffer.Canvas.Handle, 0, 0, 50, 50, Canvas.Handle,452 BitBltCanvas(LogoBuffer.Canvas, 0, 0, 50, 50, Canvas, 454 453 xActionIcon - 2, y - 2, SRCCOPY); 455 454 GlowFrame(LogoBuffer, 8, 8, 34, 34, $202020); … … 566 565 h := ClientHeight - ActionBottomBorder - 567 566 (yAction + SelectedAction * ActionPitch - 8); 568 BitBlt (LogoBuffer.Canvas.Handle, 0, 0, w, h, Canvas.Handle,567 BitBltCanvas(LogoBuffer.Canvas, 0, 0, w, h, Canvas, 569 568 ActionSideBorder + i * wBuffer, yAction + SelectedAction * ActionPitch 570 569 - 8, SRCCOPY); … … 822 821 823 822 procedure TStartDlg.FormShow(Sender: TObject); 824 type 825 TLine = array [0 .. 99999999] of Byte; 826 var 827 i, x, y: integer; 828 PictureLine: ^TLine; 823 var 824 x, y: integer; 825 PicturePixel: PPixel32; 829 826 begin 830 827 SetMainTextureByAge(-1); … … 836 833 for y := 0 to 63 do 837 834 begin // darken texture for empty slot 838 PictureLine := EmptyPicture.ScanLine[y]; 839 for x := 0 to 64 * 3 - 1 do 840 begin 841 i := integer(PictureLine[x]) - 28; 842 if i < 0 then 843 i := 0; 844 PictureLine[x] := i; 835 for x := 0 to 64 - 1 do 836 begin 837 PicturePixel := GetBitmapPixelPtr(EmptyPicture, x, y); 838 PicturePixel^.B := Max(PicturePixel^.B - 28, 0); 839 PicturePixel^.G := Max(PicturePixel^.G - 28, 0); 840 PicturePixel^.R := Max(PicturePixel^.R - 28, 0); 845 841 end 846 842 end; … … 1004 1000 1005 1001 procedure PaintRandomMini(Brightness: integer); 1006 type1007 TLine = array [0 .. lxmax * 2, 0 .. 2] of Byte;1008 1002 var 1009 1003 i, x, y, xm, cm: integer; 1010 Mini Line: ^TLine;1004 MiniPixel: PPixel32; 1011 1005 Map: ^TTileList; 1012 1006 begin … … 1016 1010 1017 1011 Mini.PixelFormat := pf24bit; 1018 Mini.width := MiniWidth * 2; 1019 Mini.height := MiniHeight; 1012 Mini.SetSize(MiniWidth * 2, MiniHeight); 1020 1013 Mini.BeginUpdate; 1021 for y := 0 to MiniHeight - 1 do 1022 begin 1023 MiniLine := Mini.ScanLine[y]; 1024 for x := 0 to MiniWidth - 1 do 1025 for i := 0 to 1 do 1026 begin 1014 for y := 0 to MiniHeight - 1 do begin 1015 for x := 0 to MiniWidth - 1 do begin 1016 for i := 0 to 1 do begin 1027 1017 xm := (x * 2 + i + y and 1) mod (MiniWidth * 2); 1018 MiniPixel := GetBitmapPixelPtr(Mini, xm, y); 1028 1019 cm := MiniColors 1029 1020 [Map[x * lxmax div MiniWidth + lxmax * 1030 1021 ((y * (lymax - 1) + MiniHeight div 2) div (MiniHeight - 1))] and 1031 1022 fTerrain, i]; 1032 Mini Line[xm, 0] := cm shr 16* Brightness div 3;1033 Mini Line[xm, 1] := cm shr 8 and $FF* Brightness div 3;1034 Mini Line[xm, 2] := cm and $FF* Brightness div 3;1023 MiniPixel^.B := ((cm shr 16) and $FF) * Brightness div 3; 1024 MiniPixel^.G := ((cm shr 8) and $FF) * Brightness div 3; 1025 MiniPixel^.R := ((cm shr 0) and $FF) * Brightness div 3; 1035 1026 end; 1027 end; 1036 1028 end; 1037 1029 Mini.EndUpdate;
Note:
See TracChangeset
for help on using the changeset viewer.