Changeset 72 for trunk/Start.pas
- Timestamp:
- Jan 15, 2017, 11:47:01 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Start.pas
r64 r72 822 822 var 823 823 x, y: integer; 824 PicturePixel: PPixel32;824 PicturePixel: TPixelPointer; 825 825 begin 826 826 SetMainTextureByAge(-1); … … 830 830 Fill(EmptyPicture.Canvas, 0, 0, 64, 64, (wMaintexture - 64) div 2, 831 831 (hMaintexture - 64) div 2); 832 for y := 0 to 63 do 833 begin // darken texture for empty slot 834 for x := 0 to 64 - 1 do 835 begin 836 PicturePixel := GetBitmapPixelPtr(EmptyPicture, x, y); 837 PicturePixel^.B := Max(PicturePixel^.B - 28, 0); 838 PicturePixel^.G := Max(PicturePixel^.G - 28, 0); 839 PicturePixel^.R := Max(PicturePixel^.R - 28, 0); 840 end 832 // darken texture for empty slot 833 PicturePixel.Init(EmptyPicture); 834 for y := 0 to 63 do begin 835 for x := 0 to 64 - 1 do begin 836 PicturePixel.Pixel^.B := Max(PicturePixel.Pixel^.B - 28, 0); 837 PicturePixel.Pixel^.G := Max(PicturePixel.Pixel^.G - 28, 0); 838 PicturePixel.Pixel^.R := Max(PicturePixel.Pixel^.R - 28, 0); 839 PicturePixel.NextPixel; 840 end; 841 PicturePixel.NextLine; 841 842 end; 842 843 EmptyPicture.EndUpdate; … … 1001 1002 var 1002 1003 i, x, y, xm, cm: integer; 1003 MiniPixel: PPixel32;1004 MiniPixel: TPixelPointer; 1004 1005 Map: ^TTileList; 1005 1006 begin … … 1011 1012 Mini.SetSize(MiniWidth * 2, MiniHeight); 1012 1013 Mini.BeginUpdate; 1014 MiniPixel.Init(Mini); 1013 1015 for y := 0 to MiniHeight - 1 do begin 1014 1016 for x := 0 to MiniWidth - 1 do begin 1015 1017 for i := 0 to 1 do begin 1016 1018 xm := (x * 2 + i + y and 1) mod (MiniWidth * 2); 1017 MiniPixel := GetBitmapPixelPtr(Mini, xm, y);1019 MiniPixel.SetX(xm); 1018 1020 cm := MiniColors 1019 1021 [Map[x * lxmax div MiniWidth + lxmax * 1020 1022 ((y * (lymax - 1) + MiniHeight div 2) div (MiniHeight - 1))] and 1021 1023 fTerrain, i]; 1022 MiniPixel ^.B := ((cm shr 16) and $FF) * Brightness div 3;1023 MiniPixel ^.G := ((cm shr 8) and $FF) * Brightness div 3;1024 MiniPixel ^.R := ((cm shr 0) and $FF) * Brightness div 3;1024 MiniPixel.Pixel^.B := ((cm shr 16) and $FF) * Brightness div 3; 1025 MiniPixel.Pixel^.G := ((cm shr 8) and $FF) * Brightness div 3; 1026 MiniPixel.Pixel^.R := ((cm shr 0) and $FF) * Brightness div 3; 1025 1027 end; 1026 1028 end; 1029 MiniPixel.NextLine; 1027 1030 end; 1028 1031 Mini.EndUpdate; … … 1035 1038 var 1036 1039 i, x, y, xm, cm, Tile, OwnColor, EnemyColor: integer; 1037 MiniPixel, PrevMiniPixel: PPixel32;1040 MiniPixel, PrevMiniPixel: TPixelPointer; 1038 1041 begin 1039 1042 OwnColor := GrExt[HGrSystem].Data.Canvas.Pixels[95, 67]; … … 1045 1048 begin 1046 1049 Mini.BeginUpdate; 1050 MiniPixel.Init(Mini); 1051 PrevMiniPixel.Init(Mini, 0, -1); 1047 1052 for y := 0 to MiniHeight - 1 do begin 1048 1053 for x := 0 to MiniWidth - 1 do begin 1049 1054 for i := 0 to 1 do begin 1050 1055 xm := (x * 2 + i + y and 1) mod (MiniWidth * 2); 1051 MiniPixel := GetBitmapPixelPtr(Mini, xm, y);1056 MiniPixel.SetX(xm); 1052 1057 Tile := SaveMap[x + MiniWidth * y]; 1053 1058 if Tile and fTerrain = fUNKNOWN then … … 1061 1066 if y > 0 then begin 1062 1067 // 2x2 city dot covers two lines 1063 PrevMiniPixel := GetBitmapPixelPtr(Mini, xm, y - 1);1064 PrevMiniPixel ^.B := cm shr 16;1065 PrevMiniPixel ^.G:= cm shr 8 and $FF;1066 PrevMiniPixel ^.R := cm and $FF;1068 PrevMiniPixel.SetX(xm); 1069 PrevMiniPixel.Pixel^.B := cm shr 16; 1070 PrevMiniPixel.Pixel^.G:= cm shr 8 and $FF; 1071 PrevMiniPixel.Pixel^.R := cm and $FF; 1067 1072 end 1068 1073 end … … 1074 1079 else 1075 1080 cm := MiniColors[Tile and fTerrain, i]; 1076 MiniPixel ^.B := cm shr 16;1077 MiniPixel ^.G:= cm shr 8 and $FF;1078 MiniPixel ^.R := cm and $FF;1081 MiniPixel.Pixel^.B := cm shr 16; 1082 MiniPixel.Pixel^.G:= cm shr 8 and $FF; 1083 MiniPixel.Pixel^.R := cm and $FF; 1079 1084 end; 1080 1085 end;
Note:
See TracChangeset
for help on using the changeset viewer.