- Timestamp:
- Sep 19, 2018, 5:28:58 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormClient.pas
r231 r234 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, 9 UGame, LCLType, Menus, ActnList, ComCtrls, dateutils, XMLConf, DOM, 9 UGame, LCLType, Menus, ActnList, ComCtrls, dateutils, XMLConf, DOM, Math, 10 10 UGeometry, UGameClient, UGameProtocol, UThreading, UPlayer, UClientGUI; 11 11 … … 167 167 var 168 168 DrawStart: TDateTime; 169 R: TRect; 170 StartP: TPoint; 171 VS: TPoint; 172 CountP: TPoint; 173 X, Y: Integer; 174 TempView: TView; 169 175 const 170 176 BackgroundColor = $404040; … … 185 191 PaintBox1.Canvas.FillRect(0, 0, PaintBox1.Width, PaintBox1.Height); 186 192 {$endif} 187 Client.Paint(PaintBox1.Canvas, View) 193 194 { if Game.CyclicMap then begin 195 VS := View.CellToCanvasPos(Game.Map.Size); 196 TempView := TView.Create; 197 TempView.Game := Game; 198 R := TRect.Create(View.CellToCanvasPos(Game.Map.Cells.First.PosPx), 199 View.CellToCanvasPos(Game.Map.Cells.Last.PosPx)); 200 StartP := TPoint.Create(Ceil(R.P1.X / R.Size.X) * R.Size.X, 201 Ceil(R.P1.Y / R.Size.Y) * R.Size.Y); 202 CountP := TPoint.Create(Ceil(View.DestRect.Size.X / R.Size.X), 203 Ceil(View.DestRect.Size.X / R.Size.Y)); 204 for Y := 0 to CountP.Y do begin 205 for X := 0 to CountP.X do begin 206 TempView.Zoom := View.Zoom; 207 TempView.SourceRect := View.SourceRect; 208 TempView.DestRect := TRect.Create( 209 TPoint.Create( 210 -StartP.X + R.Size.X * X, 211 -StartP.Y + R.Size.Y * Y), 212 TPoint.Create( 213 -StartP.X + R.Size.X * X + View.DestRect.Size.X, 214 -StartP.Y + R.Size.Y * Y + View.DestRect.Size.Y) 215 ); 216 Client.Paint(PaintBox1.Canvas, TempView); 217 end; 218 end; 219 TempView.Free; 220 end else 221 }Client.Paint(PaintBox1.Canvas, View); 188 222 end; 189 223 end; -
trunk/Languages/xtactics.cs.po
r231 r234 410 410 #: tformnew.checkboxcyclicmap.caption 411 411 msgid "Cyclic map" 412 msgstr " "412 msgstr "Cyklická mapa" 413 413 414 414 #: tformnew.checkboxfogofwar.caption … … 758 758 #: uclientgui.swrongarrowangle 759 759 msgid "Wrong arrow angle %s" 760 msgstr " "760 msgstr "Nesprávný úhel šipky %s" 761 761 762 762 #: uclientgui.szerozoomnotalowed 763 #, fuzzy764 763 msgctxt "uclientgui.szerozoomnotalowed" 765 764 msgid "Zero zoom not allowed" … … 1014 1013 1015 1014 #: umap.scellremoveneighborerror 1016 #, fuzzy1017 1015 msgctxt "umap.scellremoveneighborerror" 1018 1016 msgid "Can't remove cell from neighbour cell" … … 1020 1018 1021 1019 #: umap.snegativecellpowernotallowed 1022 #, fuzzy1023 1020 msgctxt "umap.snegativecellpowernotallowed" 1024 1021 msgid "Not allowed to substract power under zero to negative value" … … 1026 1023 1027 1024 #: uplayer.sattackerpowerpositive 1028 #, fuzzy1029 1025 msgctxt "uplayer.sattackerpowerpositive" 1030 1026 msgid "Attacker power have to be higher then 0." … … 1032 1028 1033 1029 #: uplayer.sdefenderpowerpositive 1034 #, fuzzy1035 1030 msgctxt "uplayer.sdefenderpowerpositive" 1036 1031 msgid "Defender power have to be higher then or equal to 0." … … 1038 1033 1039 1034 #: uplayer.sunfinishedbattle 1040 #, fuzzy1041 1035 msgctxt "uplayer.sunfinishedbattle" 1042 1036 msgid "Unfinished battle" … … 1058 1052 msgid "64-bit UInt read overflow." 1059 1053 msgstr "Přetečení při čtení 64-bit UInt" 1060 -
trunk/UClientGUI.pas
r233 r234 347 347 function TView.CanvasToCellPos(Pos: TPoint): TPoint; 348 348 begin 349 Result := TPoint.Create(Trunc( Pos.X/ Zoom + SourceRect.P1.X),350 Trunc( Pos.Y/ Zoom + SourceRect.P1.Y));349 Result := TPoint.Create(Trunc((Pos.X - DestRect.P1.X) / Zoom + SourceRect.P1.X), 350 Trunc((Pos.Y - DestRect.P1.Y) / Zoom + SourceRect.P1.Y)); 351 351 end; 352 352 353 353 function TView.CellToCanvasPos(Pos: TPoint): TPoint; 354 354 begin 355 Result := TPoint.Create(Trunc((Pos.X - SourceRect.P1.X) * Zoom) ,356 Trunc((Pos.Y - SourceRect.P1.Y) * Zoom) );355 Result := TPoint.Create(Trunc((Pos.X - SourceRect.P1.X) * Zoom) + DestRect.P1.X, 356 Trunc((Pos.Y - SourceRect.P1.Y) * Zoom) + DestRect.P1.Y); 357 357 end; 358 358 … … 449 449 (RectPolygon.P2.Y > RectView.P1.Y) 450 450 ); 451 Result := True; 451 452 end; 452 453 -
trunk/UGeometry.pas
r232 r234 53 53 procedure SetEmpty; 54 54 procedure Normalize; 55 procedure Move(P: T); 55 56 class operator Equal(const A, B: TGRect<T>): Boolean; 56 57 constructor Create(const P1, P2: T); … … 521 522 end; 522 523 524 procedure TGRect<T>.Move(P: T); 525 begin 526 P1 := P1 + P; 527 P2 := P2 + P; 528 end; 529 523 530 constructor TGRect<T>.Create(const P1, P2: T); 524 531 begin
Note:
See TracChangeset
for help on using the changeset viewer.