Changeset 357 for trunk/LocalPlayer
- Timestamp:
- Apr 8, 2021, 10:07:02 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/CityScreen.pas
r356 r357 74 74 CityAreaInfo: TCityAreaInfo; 75 75 AreaMap: TIsoMap; 76 NoMap: TIsoMap; 76 77 CityMapTemplate: TBitmap; 77 78 SmallCityMapTemplate: TBitmap; … … 198 199 RedTex := TTexture.Create; 199 200 BarTex := TTexture.Create; 201 NoMap := TIsoMap.Create; 200 202 AreaMap := TIsoMap.Create; 201 203 AreaMap.SetOutput(offscreen); … … 253 255 procedure TCityDlg.FormDestroy(Sender: TObject); 254 256 begin 257 FreeAndNil(NoMap); 255 258 FreeAndNil(AreaMap); 256 259 FreeAndNil(SmallCityMap); … … 594 597 595 598 with AreaMap do begin 596 rx := (192 + xxt * 2 - 1) div (xxt * 2); 597 ry := (96 + yyt * 2 - 1) div (yyt * 2); 598 AreaMap.Paint(xmArea - xxt * 2 * rx, ymArea - yyt * 2 * ry - 3 * yyt, 599 dLoc(cLoc, -2 * rx + 1, -2 * ry - 1), 4 * rx - 1, 4 * ry + 1, cLoc, cOwner, 600 false, AllowChange and IsCityAlive and 601 (c.Status and csResourceWeightsMask = 0)); 602 BitBltCanvas(offscreen.Canvas, xmArea + 102, 42, 90, 33, Back.Canvas, 603 xmArea + 102, 42); 604 605 if IsCityAlive then 606 for dy := -3 to 3 do 607 for dx := -3 to 3 do 608 if ((dx + dy) and 1 = 0) and (dx * dx * dy * dy < 81) then 609 begin 610 Loc1 := dLoc(cLoc, dx, dy); 611 av := CityAreaInfo.Available[(dy + 3) shl 2 + (dx + 3) shr 1]; 612 if ((av = faNotAvailable) or (av = faTreaty) or (av = faInvalid)) and 613 ((Loc1 < 0) or (Loc1 >= G.lx * G.ly) or (MyMap[Loc1] and fCity = 0)) 614 then 615 Sprite(offscreen, HGrTerrain, xmArea - xxt + xxt * dx, 616 ymArea - yyt + yyt * dy, xxt * 2, yyt * 2, 1 + 5 * (xxt * 2 + 1), 617 1 + yyt + 15 * (yyt * 3 + 1)); 618 if (1 shl ((dy + 3) shl 2 + (dx + 3) shr 1) and c.Tiles <> 0) then 619 PaintResources(xmArea - xxt + xxt * dx, ymArea - yyt + yyt * dy, 620 Loc1, (dx = 0) and (dy = 0)); 621 end; 599 rx := (192 + xxt * 2 - 1) div (xxt * 2); 600 ry := (96 + yyt * 2 - 1) div (yyt * 2); 601 AreaMap.Paint(xmArea - xxt * 2 * rx, ymArea - yyt * 2 * ry - 3 * yyt, 602 dLoc(cLoc, -2 * rx + 1, -2 * ry - 1), 4 * rx - 1, 4 * ry + 1, cLoc, cOwner, 603 false, AllowChange and IsCityAlive and 604 (c.Status and csResourceWeightsMask = 0)); 605 BitBltCanvas(offscreen.Canvas, xmArea + 102, 42, 90, 33, Back.Canvas, 606 xmArea + 102, 42); 607 608 if IsCityAlive then 609 for dy := -3 to 3 do 610 for dx := -3 to 3 do 611 if ((dx + dy) and 1 = 0) and (dx * dx * dy * dy < 81) then begin 612 Loc1 := dLoc(cLoc, dx, dy); 613 av := CityAreaInfo.Available[(dy + 3) shl 2 + (dx + 3) shr 1]; 614 if ((av = faNotAvailable) or (av = faTreaty) or (av = faInvalid)) and 615 ((Loc1 < 0) or (Loc1 >= G.lx * G.ly) or (MyMap[Loc1] and fCity = 0)) 616 then 617 Sprite(offscreen, HGrTerrain, xmArea - xxt + xxt * dx, 618 ymArea - yyt + yyt * dy, xxt * 2, yyt * 2, 1 + 5 * (xxt * 2 + 1), 619 1 + yyt + 15 * (yyt * 3 + 1)); 620 if (1 shl ((dy + 3) shl 2 + (dx + 3) shr 1) and c.Tiles <> 0) then 621 PaintResources(xmArea - xxt + xxt * dx, ymArea - yyt + yyt * dy, 622 Loc1, (dx = 0) and (dy = 0)); 623 end; 622 624 end; 623 625 … … 915 917 Imp5Area.Hint := ''; 916 918 end 917 else { if SmallMapMode =smSupportedUnits then }919 else { if SmallMapMode = smSupportedUnits then } 918 920 begin 919 921 LoweredTextout(offscreen.Canvas, -1, MainTexture, xZoomMap + 6, … … 932 934 y := ((Cnt - 6 * Page) div 3) * 52 + yZoomMap + 20; 933 935 MakeUnitInfo(me, MyUn[i], UnitInfo); 934 AreaMap.SetOutput(offscreen);935 AreaMap.PaintUnit(x, y, UnitInfo, MyUn[i].Status);936 NoMap.SetOutput(offscreen); 937 NoMap.PaintUnit(x, y, UnitInfo, MyUn[i].Status); 936 938 937 939 for j := 0 to UnitReport.FoodSupport - 1 do … … 1319 1321 else if (x >= xmArea - 192) and (x < xmArea + 192) and (y >= ymArea - 96) 1320 1322 and (y < ymArea + 96) then 1321 with AreaMap do 1322 begin 1323 with AreaMap do begin 1323 1324 qx := ((4000 * xxt * yyt) + (x - xmArea) * (yyt * 2) + (y - ymArea + yyt) 1324 1325 * (xxt * 2)) div (xxt * yyt * 4) - 1000;
Note:
See TracChangeset
for help on using the changeset viewer.