- Timestamp:
- Feb 27, 2014, 7:43:00 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UFormMain.pas
r18 r19 210 210 procedure TFormMain.PaintBox1MouseWheelDown(Sender: TObject; 211 211 Shift: TShiftState; MousePos: TPoint; var Handled: Boolean); 212 begin 213 with Game.CurrentPlayer do 212 var 213 D: TPoint; 214 begin 215 with Game.CurrentPlayer do begin 216 D := Point(Trunc(MousePos.X - Game.CurrentPlayer.View.Left / ViewZoom), 217 Trunc(MousePos.Y - Game.CurrentPlayer.View.Top / ViewZoom)); 214 218 ViewZoom := ViewZoom / ZoomFactor; 219 //View := Bounds(Trunc((D.X - MousePos.X) * ViewZoom), 220 // Trunc((D.Y - MousePos.Y) * ViewZoom), 221 // View.Right - View.Left, 222 // View.Bottom - View.Top); 223 end; 215 224 Redraw; 216 225 end; -
trunk/UFormNew.pas
r18 r19 114 114 CheckBoxVoid.Checked := Game.VoidEnabled; 115 115 for I := 0 to Players.Count - 1 do 116 TPlayer(Players[I]).Free;116 Players[I] := nil; 117 117 Players.Count := Game.Players.Count; 118 118 for I := 0 to Game.Players.Count - 1 do begin -
trunk/UGame.pas
r18 r19 66 66 procedure ClearCellMoves; 67 67 procedure ComputePlayerStats; 68 function GetPixelSize: TPoint; 68 69 property Size: TPoint read FSize write SetSize; 69 70 end; … … 445 446 StartCell.Power := TPlayer(Players[I]).StartUnits; 446 447 end; 448 ViewZoom := 1; 449 // Center board 450 View := Bounds(-(View.Right - View.Left) div 2 + Map.GetPixelSize.X div 2, 451 -(View.Bottom - View.Top) div 2 + Map.GetPixelSize.Y div 2, 452 View.Right - View.Left, 453 View.Bottom - View.Top); 447 454 end; 448 455 CurrentPlayer := TPlayer(Players[0]); … … 667 674 end; 668 675 676 function THexMap.GetPixelSize: TPoint; 677 begin 678 Result := Point(Size.X * DefaultCellSize.X, Size.Y * DefaultCellSize.Y); 679 end; 680 669 681 end. 670 682
Note:
See TracChangeset
for help on using the changeset viewer.