Changeset 52 for trunk/UEngine.pas
- Timestamp:
- Dec 20, 2021, 7:47:26 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UEngine.pas
r51 r52 823 823 begin 824 824 with Engine.FBitmapLower do begin 825 //Brush.Color := SurfaceMatterColors[smRock];826 //FillRect(ScreenFrame);827 for Y := ScreenFrame.Top to ScreenFrame.Bottom - 1 do828 for X := ScreenFrame.Left to ScreenFrame.Right - 1 do begin829 ItemsXY[X, Y] := 0;830 end;831 832 825 Fill(CreateIndex(ScreenFrame.Left, ScreenFrame.Top), 833 826 CreateIndex(ScreenFrame.Width, ScreenFrame.Height), 834 827 Engine.World.Matters[Integer(miRock)].Color); 835 836 828 837 829 with Engine.World do … … 861 853 for I := ScreenFrame.Left to ScreenFrame.Right - 1 do 862 854 ItemsXY[I, 0] := $010101 * I; 863 864 for Y := ScreenFrame.Top to ScreenFrame.Bottom - 1 do865 for X := ScreenFrame.Left to ScreenFrame.Right - 1 do begin866 ItemsXY[X, Y] := 0;867 end;868 855 end; 869 856 end; … … 1210 1197 BgColor: Cardinal; 1211 1198 begin 1212 if Assigned(FBitmap) then 1199 if Assigned(FBitmap) then begin 1200 Lock.Acquire; 1201 Bitmap.BeginUpdate; 1213 1202 try 1214 Lock.Acquire;1215 Bitmap.BeginUpdate;1216 1203 {$IFDEF WINDOWS} 1217 1204 Bitmap.PixelFormat := pf32bit; … … 1221 1208 BytePerRow := RawImage.Description.BytesPerLine; 1222 1209 if ClearBackground then begin 1223 BgColor := TMatter(World.Matters[Integer(miBorder)]).Color;1210 BgColor := World.Matters[Integer(miBorder)].Color; 1224 1211 BgColor := SwapBRComponent(BgColor); 1225 1212 FillDWord(RawImage.Data^, Bitmap.Height * BytePerRow div 4, BgColor); … … 1281 1268 end; 1282 1269 finally 1283 FBitmap.EndUpdate;1270 Bitmap.EndUpdate; 1284 1271 Lock.Release; 1272 end; 1285 1273 end; 1286 1274 end; … … 1594 1582 I: Integer; 1595 1583 DrawStart: TDateTime; 1584 OldCount: TBitmapTColorIndex; 1596 1585 begin 1597 1586 if FRedrawPending then begin … … 1600 1589 Lock.Acquire; 1601 1590 try 1602 //if ClearBackground then FBitmapLower.FillAll(clNavy); 1591 // TODO: Without this (re)initialization we get range error 1592 OldCount := FBitmapLower.Count; 1593 FBitmapLower.Count := FBitmapLower.CreateIndex(0, 0); 1594 FBitmapLower.Count := OldCount; 1595 1596 if ClearBackground then FBitmapLower.FillAll(clNavy); 1603 1597 for I := 0 to Players.Count - 1 do 1604 1598 if Players[I].Enabled then begin
Note:
See TracChangeset
for help on using the changeset viewer.