Changeset 313 for trunk/LocalPlayer
- Timestamp:
- Mar 17, 2021, 11:11:55 AM (4 years ago)
- Location:
- trunk/LocalPlayer
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Battle.pas
r205 r313 108 108 FanaticColor); 109 109 BitBltCanvas(ca, xm - 12, ym - 12, 24, 24, 110 GrExt[HGrSystem].Mask.Canvas, 26, 146, SRCAND);110 HGrSystem.Mask.Canvas, 26, 146, SRCAND); 111 111 BitBltCanvas(ca, xm - 12, ym - 12, 24, 24, 112 GrExt[HGrSystem].Data.Canvas, 26, 146, SRCPAINT);112 HGrSystem.Data.Canvas, 26, 146, SRCPAINT); 113 113 114 114 LabelText := Format('%d', [Forecast.AStr]); … … 133 133 begin 134 134 BitBltCanvas(ca, xm + 9 + LDDamage - 7, ym - 6, 14, 17, 135 GrExt[HGrSystem].Mask.Canvas, 51, 153, SRCAND);135 HGrSystem.Mask.Canvas, 51, 153, SRCAND); 136 136 BitBltCanvas(ca, xm + 8 + LDDamage - 7, ym - 7, 14, 17, 137 GrExt[HGrSystem].Mask.Canvas, 51, 153, SRCAND);137 HGrSystem.Mask.Canvas, 51, 153, SRCAND); 138 138 BitBltCanvas(ca, xm + 8 + LDDamage - 7, ym - 7, 14, 17, 139 GrExt[HGrSystem].Data.Canvas, 51, 153, SRCPAINT);139 HGrSystem.Data.Canvas, 51, 153, SRCPAINT); 140 140 end; 141 141 LabelText := Format('%d', [DDamage]); … … 153 153 begin 154 154 BitBltCanvas(ca, xm - 6, ym + 9 + LADamage - 7, 14, 17, 155 GrExt[HGrSystem].Mask.Canvas, 51, 153, SRCAND);155 HGrSystem.Mask.Canvas, 51, 153, SRCAND); 156 156 BitBltCanvas(ca, xm - 7, ym + 8 + LADamage - 7, 14, 17, 157 GrExt[HGrSystem].Mask.Canvas, 51, 153, SRCAND);157 HGrSystem.Mask.Canvas, 51, 153, SRCAND); 158 158 BitBltCanvas(ca, xm - 7, ym + 8 + LADamage - 7, 14, 17, 159 GrExt[HGrSystem].Data.Canvas, 51, 153, SRCPAINT);159 HGrSystem.Data.Canvas, 51, 153, SRCPAINT); 160 160 end; 161 161 LabelText := Format('%d', [MyUn[uix].Health - Forecast.EndHealthAtt]); -
trunk/LocalPlayer/CityScreen.pas
r295 r313 387 387 if Kind = 3 then 388 388 begin 389 Tex.clBevelLight := GrExt[HGrSystem].Data.Canvas.Pixels[104, 36];389 Tex.clBevelLight := HGrSystem.Data.Canvas.Pixels[104, 36]; 390 390 Tex.clBevelShade := Tex.clBevelLight; 391 391 end; … … 624 624 xGr := 141; 625 625 BitBltCanvas(offscreen.Canvas, xmArea - 192 + 5 + i * d, ymArea - 96 - 29, 626 27, 30, GrExt[HGrSystem].Mask.Canvas, xGr, 171, SRCAND); { shadow }626 27, 30, HGrSystem.Mask.Canvas, xGr, 171, SRCAND); { shadow } 627 627 Sprite(offscreen, HGrSystem, xmArea - 192 + 4 + i * d, ymArea - 96 - 30, 27, 628 628 30, xGr, 171); … … 636 636 xGr := 1 + 112; 637 637 BitBltCanvas(offscreen.Canvas, xmArea + 192 - 27 + 1 - i * d, 29 + 1, 27, 638 30, GrExt[HGrSystem].Mask.Canvas, xGr, 171, SRCAND); { shadow }638 30, HGrSystem.Mask.Canvas, xGr, 171, SRCAND); { shadow } 639 639 Sprite(offscreen, HGrSystem, xmArea + 192 - 27 - i * d, 29, 27, 30, 640 640 xGr, 171); … … 1052 1052 (integer(MyRO.EnemyModel[emix].mix) <> c.Project and cpIndex)) do 1053 1053 dec(emix); 1054 if Tribe[cOwner].ModelPicture[c.Project and cpIndex].HGr = 0then1054 if Tribe[cOwner].ModelPicture[c.Project and cpIndex].HGr = HGrSystem then 1055 1055 InitEnemyModel(emix); 1056 1056 end; -
trunk/LocalPlayer/Draft.pas
r295 r313 336 336 // paint cost 337 337 LightGradient(offscreen.Canvas, xFeature + 34, 338 yFeature + LinePitch * i, 50, GrExt[HGrSystem].Data.Canvas.Pixels338 yFeature + LinePitch * i, 50, HGrSystem.Data.Canvas.Pixels 339 339 [187, 137]); 340 340 if (Domain = dGround) and (code[i] = mcDefense) then -
trunk/LocalPlayer/Enhance.pas
r257 r313 97 97 if Controls[i] is TButtonC then 98 98 BitBltCanvas(Canvas, Controls[i].Left + 2, Controls[i].Top - 11, 8, 8, 99 GrExt[HGrSystem].Data.Canvas, 121 + Controls[i].Tag mod 7 * 9,99 HGrSystem.Data.Canvas, 121 + Controls[i].Tag mod 7 * 9, 100 100 1 + Controls[i].Tag div 7 * 9); 101 101 end; -
trunk/LocalPlayer/Help.pas
r304 r313 401 401 ca.FrameRect(rect(x+1,i*24+1,x+24-1,i*24+24-1)); 402 402 ca.Brush.Style:=bsClear; } 403 BitBltCanvas(ca, x, y - 4, 24, 24, GrExt[HGrSystem].Data.Canvas, 1,403 BitBltCanvas(ca, x, y - 4, 24, 24, HGrSystem.Data.Canvas, 1, 404 404 146); 405 405 BiColorTextOut(ca, $FFFFFF, $7F007F, x + 10 - ca.Textwidth(s[1]) div 2, … … 569 569 j and $FF]); 570 570 PaintLogo(OffScreen.Canvas, (InnerWidth - 122) div 2, i * 24 + 1, 571 GrExt[HGrSystem].Data.Canvas.Pixels[95, 1], $000000);571 HGrSystem.Data.Canvas.Pixels[95, 1], $000000); 572 572 Font.Assign(UniFont[ftSmall]); 573 573 BiColorTextOut(OffScreen.Canvas, $000000, $7F007F, … … 602 602 case HelpLineInfo.Picpix of 603 603 0: 604 FrameImage(OffScreen.Canvas, GrExt[HGrSystem2].Data,604 FrameImage(OffScreen.Canvas, HGrSystem2.Data, 605 605 12 + x0[i], -7 + i * 24, 56, 40, 137, 127); 606 606 1: … … 637 637 ScreenTools.Frame(OffScreen.Canvas, 8 - 1 + x0[i], 2 - 1 + i * 24, 638 638 8 + 36 + x0[i], 2 + 20 + i * 24, $000000, $000000); 639 Dump(OffScreen, HGrSystem, 8 + x0[i], 2 + i * 24, 36, 20,639 Dump(OffScreen, HGrSystem, 8 + x0[i], 2 + i * 24, 36, 20, 640 640 75 + HelpLineInfo.Picpix * 37, 295); 641 641 x0[i] := x0[i] + (8 + 8 + 36); … … 658 658 j := AdvValue[HelpLineInfo.Picpix] div 1000; 659 659 BitBltCanvas(OffScreen.Canvas, x0[i] + 4, 4 + i * 24, 14, 14, 660 GrExt[HGrSystem].Mask.Canvas, 127 + j * 15, 85, SRCAND);660 HGrSystem.Mask.Canvas, 127 + j * 15, 85, SRCAND); 661 661 Sprite(OffScreen, HGrSystem, x0[i] + 3, 3 + i * 24, 14, 14, 662 662 127 + j * 15, 85); -
trunk/LocalPlayer/IsoEngine.pas
r301 r313 51 51 procedure FillRect(x, y, Width, Height, Color: integer); 52 52 procedure Textout(x, y, Color: integer; const s: string); 53 procedure Sprite(HGr ,xDst, yDst, Width, Height, xGr, yGr: integer);53 procedure Sprite(HGr: TGrExtDescr; xDst, yDst, Width, Height, xGr, yGr: integer); 54 54 procedure TSprite(xDst, yDst, grix: integer; PureBlack: boolean = false); 55 55 … … 139 139 function ApplyTileSize(xxtNew, yytNew: integer): boolean; 140 140 var 141 i, x, y, xSrc, ySrc, HGrTerrainNew, HGrCitiesNew, age, size: integer; 141 i: Integer; 142 x: Integer; 143 y: Integer; 144 xSrc: Integer; 145 ySrc: Integer; 146 HGrTerrainNew: TGrExtDescr; 147 HGrCitiesNew: TGrExtDescr; 148 Age: Integer; 149 Size: Integer; 142 150 LandMore, OceanMore, DitherMask, Mask24: TBitmap; 143 151 MaskLine: array [0 .. 50 * 3 - 1] of TPixelPointer; // 32 = assumed maximum for yyt … … 147 155 HGrTerrainNew := LoadGraphicSet(Format('Terrain%dx%d.png', 148 156 [xxtNew * 2, yytNew * 2])); 149 if HGrTerrainNew < 0then157 if not Assigned(HGrTerrainNew) then 150 158 exit; 151 159 HGrCitiesNew := LoadGraphicSet(Format('Cities%dx%d.png', 152 160 [xxtNew * 2, yytNew * 2])); 153 if HGrCitiesNew < 0then161 if not Assigned(HGrCitiesNew) then 154 162 exit; 155 163 xxt := xxtNew; … … 196 204 DitherMask.Canvas.FillRect(0, 0, DitherMask.Width, DitherMask.Height); 197 205 BitBltCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt * 2, 198 GrExt[HGrTerrain].Mask.Canvas, 1 + 7 * (xxt * 2 + 1),206 HGrTerrain.Mask.Canvas, 1 + 7 * (xxt * 2 + 1), 199 207 1 + yyt + 15 * (yyt * 3 + 1), SRCAND); 200 208 … … 218 226 for y := -1 to 6 do 219 227 BitBltCanvas(LandPatch.Canvas, (x + 2) * (xxt * 2), (y + 2) * yyt, 220 xxt * 2, yyt, GrExt[HGrTerrain].Data.Canvas, xSrc, ySrc);228 xxt * 2, yyt, HGrTerrain.Data.Canvas, xSrc, ySrc); 221 229 for y := -2 to 6 do 222 230 BitBltCanvas(LandPatch.Canvas, (x + 2) * (xxt * 2), (y + 2) * yyt, xxt, 223 yyt, GrExt[HGrTerrain].Data.Canvas, xSrc + xxt, ySrc + yyt,231 yyt, HGrTerrain.Data.Canvas, xSrc + xxt, ySrc + yyt, 224 232 SRCPAINT); 225 233 for y := -2 to 6 do 226 234 BitBltCanvas(LandPatch.Canvas, (x + 2) * (xxt * 2) + xxt, (y + 2) * yyt, 227 xxt, yyt, GrExt[HGrTerrain].Data.Canvas, xSrc, ySrc + yyt,235 xxt, yyt, HGrTerrain.Data.Canvas, xSrc, ySrc + yyt, 228 236 SRCPAINT); 229 237 for y := -2 to 6 do … … 254 262 for x := -2 to 6 do 255 263 BitBltCanvas(LandMore.Canvas, (x + 2) * (xxt * 2), (y + 2) * yyt, 256 xxt * 2, yyt, GrExt[HGrTerrain].Data.Canvas, xSrc, ySrc);264 xxt * 2, yyt, HGrTerrain.Data.Canvas, xSrc, ySrc); 257 265 BitBltCanvas(LandMore.Canvas, xxt * 2, (y + 2) * yyt, xxt, yyt, 258 GrExt[HGrTerrain].Data.Canvas, xSrc + xxt, ySrc + yyt, SRCPAINT);266 HGrTerrain.Data.Canvas, xSrc + xxt, ySrc + yyt, SRCPAINT); 259 267 for x := 0 to 7 do 260 268 BitBltCanvas(LandMore.Canvas, (x + 2) * (xxt * 2) - xxt, (y + 2) * yyt, 261 xxt * 2, yyt, GrExt[HGrTerrain].Data.Canvas, xSrc, ySrc + yyt,269 xxt * 2, yyt, HGrTerrain.Data.Canvas, xSrc, ySrc + yyt, 262 270 SRCPAINT); 263 271 for x := -2 to 6 do … … 276 284 if (x >= 1) = (y >= 2) then 277 285 BitBltCanvas(OceanPatch.Canvas, x * (xxt * 2), y * yyt, xxt * 2, yyt, 278 GrExt[HGrTerrain].Data.Canvas, xSrc, ySrc);286 HGrTerrain.Data.Canvas, xSrc, ySrc); 279 287 if (x >= 1) and ((y < 2) or (x >= 2)) then 280 288 begin 281 289 BitBltCanvas(OceanPatch.Canvas, x * (xxt * 2), y * yyt, xxt, yyt, 282 GrExt[HGrTerrain].Data.Canvas, xSrc + xxt, ySrc + yyt,290 HGrTerrain.Data.Canvas, xSrc + xxt, ySrc + yyt, 283 291 SRCPAINT); 284 292 BitBltCanvas(OceanPatch.Canvas, x * (xxt * 2) + xxt, y * yyt, xxt, yyt, 285 GrExt[HGrTerrain].Data.Canvas, xSrc, ySrc + yyt, SRCPAINT);293 HGrTerrain.Data.Canvas, xSrc, ySrc + yyt, SRCPAINT); 286 294 end; 287 295 BitBltCanvas(OceanPatch.Canvas, x * (xxt * 2), y * yyt, xxt, yyt, … … 301 309 if (x < 1) or (y >= 2) then 302 310 BitBltCanvas(OceanMore.Canvas, x * (xxt * 2), y * yyt, xxt * 2, yyt, 303 GrExt[HGrTerrain].Data.Canvas, xSrc, ySrc);311 HGrTerrain.Data.Canvas, xSrc, ySrc); 304 312 if (x = 1) and (y < 2) or (x >= 2) and (y >= 1) then 305 313 begin 306 314 BitBltCanvas(OceanMore.Canvas, x * (xxt * 2), y * yyt, xxt, yyt, 307 GrExt[HGrTerrain].Data.Canvas, xSrc + xxt, ySrc + yyt,315 HGrTerrain.Data.Canvas, xSrc + xxt, ySrc + yyt, 308 316 SRCPAINT); 309 317 BitBltCanvas(OceanMore.Canvas, x * (xxt * 2) + xxt, y * yyt, xxt, yyt, 310 GrExt[HGrTerrain].Data.Canvas, xSrc, ySrc + yyt, SRCPAINT);318 HGrTerrain.Data.Canvas, xSrc, ySrc + yyt, SRCPAINT); 311 319 end; 312 320 BitBltCanvas(OceanMore.Canvas, x * (xxt * 2), y * yyt, xxt * 2, yyt, … … 317 325 DitherMask.Canvas, 0, 0, DSTINVERT); { invert dither mask } 318 326 BitBltCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt * 2, 319 GrExt[HGrTerrain].Mask.Canvas, 1, 1 + yyt, SRCPAINT);327 HGrTerrain.Mask.Canvas, 1, 1 + yyt, SRCPAINT); 320 328 321 329 for x := -1 to 6 do … … 351 359 end; 352 360 BitBltCanvas(DitherMask.Canvas, 0, 0, xxt * 2, yyt, 353 GrExt[HGrTerrain].Mask.Canvas, 1, 1 + yyt);361 HGrTerrain.Mask.Canvas, 1, 1 + yyt); 354 362 355 363 for x := 0 to 6 do … … 369 377 // reduce size of terrain icons 370 378 Mask24 := TBitmap.Create; 371 Mask24.Assign( GrExt[HGrTerrain].Mask);379 Mask24.Assign(HGrTerrain.Mask); 372 380 Mask24.PixelFormat := pf24bit; 373 381 Mask24.BeginUpdate; … … 526 534 end; 527 535 528 procedure TIsoMap.Sprite(HGr ,xDst, yDst, Width, Height, xGr, yGr: integer);529 begin 530 BitBltBitmap( GrExt[HGr].Mask, xDst, yDst, Width, Height, xGr, yGr, SRCAND);531 BitBltBitmap( GrExt[HGr].Data, xDst, yDst, Width, Height, xGr, yGr, SRCPAINT);536 procedure TIsoMap.Sprite(HGr: TGrExtDescr; xDst, yDst, Width, Height, xGr, yGr: integer); 537 begin 538 BitBltBitmap(HGr.Mask, xDst, yDst, Width, Height, xGr, yGr, SRCAND); 539 BitBltBitmap(HGr.Data, xDst, yDst, Width, Height, xGr, yGr, SRCPAINT); 532 540 end; 533 541 … … 579 587 else 580 588 mixShow := mix; 581 if (Tribe[Owner].ModelPicture[mixShow].HGr = 0) and589 if (Tribe[Owner].ModelPicture[mixShow].HGr = HGrSystem) and 582 590 (@OnInitEnemyModel <> nil) then 583 591 if not OnInitEnemyModel(emix) then … … 612 620 xGr := 121 + j mod 7 * 9; 613 621 yGr := 1 + j div 7 * 9; 614 BitBltBitmap( GrExt[HGrSystem].Mask, x + xsh + 3, y + ysh + 9, 8, 8, xGr,622 BitBltBitmap(HGrSystem.Mask, x + xsh + 3, y + ysh + 9, 8, 8, xGr, 615 623 yGr, SRCAND); 616 624 Sprite(HGrSystem, x + xsh + 2, y + ysh + 8, 8, 8, xGr, yGr); … … 631 639 accessory: boolean); 632 640 var 633 age, cHGr, cpix, xGr, xShield, yShield, LabelTextColor, LabelLength: integer; 641 age: Integer; 642 cHGr: TGrExtDescr; 643 cpix: Integer; 644 xGr: Integer; 645 xShield: Integer; 646 yShield: Integer; 647 LabelTextColor: Integer; 648 LabelLength: Integer; 634 649 cpic: TCityPicture; 635 650 s: string; … … 650 665 cpix := Tribe[CityInfo.Owner].cpix; 651 666 if (ciWalled and CityInfo.Flags = 0) or 652 ( GrExt[cHGr].Data.Canvas.Pixels[(xGr + 4) * 65, cpix * 49 + 48] = $00FFFF)667 (cHGr.Data.Canvas.Pixels[(xGr + 4) * 65, cpix * 49 + 48] = $00FFFF) 653 668 then 654 669 Sprite(cHGr, x - xxc, y - 2 * yyc, xxc * 2, yyc * 3, … … 819 834 exit; 820 835 821 BitBltBitmap( GrExt[HGrTerrain].Data, x + xxt div 2, y, xxt, yyt,836 BitBltBitmap(HGrTerrain.Data, x + xxt div 2, y, xxt, yyt, 822 837 1 + (Conn shr 6 + Conn and 1 shl 2) * (xxt * 2 + 1), 823 838 1 + yyt + (16 + Tile and fTerrain) * (yyt * 3 + 1), SRCPAINT); 824 BitBltBitmap( GrExt[HGrTerrain].Data, x + xxt, y + yyt div 2, xxt, yyt,839 BitBltBitmap(HGrTerrain.Data, x + xxt, y + yyt div 2, xxt, yyt, 825 840 1 + (Conn and 7) * (xxt * 2 + 1) + xxt, 826 841 1 + yyt * 2 + (16 + Tile and fTerrain) * (yyt * 3 + 1), SRCPAINT); 827 BitBltBitmap( GrExt[HGrTerrain].Data, x + xxt div 2, y + yyt, xxt, yyt,842 BitBltBitmap(HGrTerrain.Data, x + xxt div 2, y + yyt, xxt, yyt, 828 843 1 + (Conn shr 2 and 7) * (xxt * 2 + 1) + xxt, 829 844 1 + yyt + (16 + Tile and fTerrain) * (yyt * 3 + 1), SRCPAINT); 830 BitBltBitmap( GrExt[HGrTerrain].Data, x, y + yyt div 2, xxt, yyt,845 BitBltBitmap(HGrTerrain.Data, x, y + yyt div 2, xxt, yyt, 831 846 1 + (Conn shr 4 and 7) * (xxt * 2 + 1), 832 847 1 + yyt * 2 + (16 + Tile and fTerrain) * (yyt * 3 + 1), SRCPAINT); 833 848 Conn := Connection4(Loc, fTerrain, fUNKNOWN); { dither to black } 834 849 if Conn and 1 <> 0 then 835 BitBltBitmap( GrExt[HGrTerrain].Mask, x + xxt, y, xxt, yyt, 1 + 7 * (xxt * 2 + 1) +850 BitBltBitmap(HGrTerrain.Mask, x + xxt, y, xxt, yyt, 1 + 7 * (xxt * 2 + 1) + 836 851 xxt, 1 + yyt + 15 * (yyt * 3 + 1), SRCAND); 837 852 if Conn and 2 <> 0 then 838 BitBltBitmap( GrExt[HGrTerrain].Mask, x + xxt, y + yyt, xxt, yyt,853 BitBltBitmap(HGrTerrain.Mask, x + xxt, y + yyt, xxt, yyt, 839 854 1 + 7 * (xxt * 2 + 1) + xxt, 1 + yyt * 2 + 15 * (yyt * 3 + 1), SRCAND); 840 855 if Conn and 4 <> 0 then 841 BitBltBitmap( GrExt[HGrTerrain].Mask, x, y + yyt, xxt, yyt, 1 + 7 * (xxt * 2 + 1),856 BitBltBitmap(HGrTerrain.Mask, x, y + yyt, xxt, yyt, 1 + 7 * (xxt * 2 + 1), 842 857 1 + yyt * 2 + 15 * (yyt * 3 + 1), SRCAND); 843 858 if Conn and 8 <> 0 then 844 BitBltBitmap( GrExt[HGrTerrain].Mask, x, y, xxt, yyt, 1 + 7 * (xxt * 2 + 1),859 BitBltBitmap(HGrTerrain.Mask, x, y, xxt, yyt, 1 + 7 * (xxt * 2 + 1), 845 860 1 + yyt + 15 * (yyt * 3 + 1), SRCAND); 846 861 end; … … 1012 1027 1013 1028 BitBltCanvas(Borders.Canvas, 0, p1 * (yyt * 2), xxt * 2, 1014 yyt * 2, GrExt[HGrTerrain].Data.Canvas,1029 yyt * 2, HGrTerrain.Data.Canvas, 1015 1030 1 + 8 * (xxt * 2 + 1), 1 + yyt + 16 * (yyt * 3 + 1)); 1016 1031 Borders.BeginUpdate; … … 1043 1058 if p2 <> p1 then 1044 1059 begin 1045 BitBltBitmap( GrExt[HGrTerrain].Mask, x + dx * xxt, y + dy * yyt, xxt,1060 BitBltBitmap(HGrTerrain.Mask, x + dx * xxt, y + dy * yyt, xxt, 1046 1061 yyt, 1 + 8 * (xxt * 2 + 1) + dx * xxt, 1047 1062 1 + yyt + 16 * (yyt * 3 + 1) + dy * yyt, SRCAND); … … 1536 1551 bix := Aix; 1537 1552 if Aix = -1 then 1538 BitBltBitmap( GrExt[HGrTerrain].Data, x + dx * xxt, y + dy * yyt, xxt,1553 BitBltBitmap(HGrTerrain.Data, x + dx * xxt, y + dy * yyt, xxt, 1539 1554 yyt, 1 + 6 * (xxt * 2 + 1) + (dx + dy + 1) and 1 * xxt, 1 + yyt, 1540 1555 SRCCOPY) // arctic <-> ocean 1541 1556 else if bix = -1 then 1542 BitBltBitmap( GrExt[HGrTerrain].Data, x + dx * xxt, y + dy * yyt, xxt,1557 BitBltBitmap(HGrTerrain.Data, x + dx * xxt, y + dy * yyt, xxt, 1543 1558 yyt, 1 + 6 * (xxt * 2 + 1) + xxt - (dx + dy + 1) and 1 * xxt, 1544 1559 1 + yyt * 2, SRCCOPY) // arctic <-> ocean … … 1549 1564 end; 1550 1565 1551 DataCanvas := GrExt[HGrTerrain].Data.Canvas;1552 MaskCanvas := GrExt[HGrTerrain].Mask.Canvas;1566 DataCanvas := HGrTerrain.Data.Canvas; 1567 MaskCanvas := HGrTerrain.Mask.Canvas; 1553 1568 for dy := -2 to ny + 1 do 1554 1569 for dx := -1 to nx do -
trunk/LocalPlayer/MessgEx.pas
r290 r313 149 149 begin 150 150 Tribe[IconIndex].InitAge(GetAge(IconIndex)); 151 if Tribe[IconIndex].faceHGr >= 0then152 TopSpace := 64 151 if Assigned(Tribe[IconIndex].faceHGr) then 152 TopSpace := 64; 153 153 end; 154 154 mikFullControl: … … 336 336 with MyRO.EnemyModel[emix], Tribe[Owner].ModelPicture[mix] do 337 337 begin 338 BitBltCanvas(Canvas, x, y, 64, 48, GrExt[HGr].Mask.Canvas,338 BitBltCanvas(Canvas, x, y, 64, 48, HGr.Mask.Canvas, 339 339 pix mod 10 * 65 + 1, pix div 10 * 49 + 1, SRCAND); 340 BitBltCanvas(Canvas, x, y, 64, 48, GrExt[HGr].Data.Canvas,340 BitBltCanvas(Canvas, x, y, 64, 48, HGr.Data.Canvas, 341 341 pix mod 10 * 65 + 1, pix div 10 * 49 + 1, SRCPAINT); 342 342 end; … … 411 411 ySizeBig, 0, 0); 412 412 BitBltCanvas(Canvas, ClientWidth div 2 - 32, 20, 64, 44, 413 GrExt[HGr].Mask.Canvas, pix mod 10 * 65 + 1,413 HGr.Mask.Canvas, pix mod 10 * 65 + 1, 414 414 pix div 10 * 49 + 1, SRCAND); 415 415 BitBltCanvas(Canvas, ClientWidth div 2 - 32, 20, 64, 44, 416 GrExt[HGr].Data.Canvas, pix mod 10 * 65 + 1,416 HGr.Data.Canvas, pix mod 10 * 65 + 1, 417 417 pix div 10 * 49 + 1, SRCPAINT); 418 418 end; … … 421 421 MainTexture.clCover); 422 422 mikTribe: 423 if Tribe[IconIndex].faceHGr >= 0then423 if Assigned(Tribe[IconIndex].faceHGr) then 424 424 begin 425 425 Frame(Canvas, ClientWidth div 2 - 32 - 1, 24 - 1, 426 426 ClientWidth div 2 + 32, 24 + 48, $000000, $000000); 427 427 BitBltCanvas(Canvas, ClientWidth div 2 - 32, 24, 64, 48, 428 GrExt[Tribe[IconIndex].faceHGr].Data.Canvas,428 Tribe[IconIndex].faceHGr.Data.Canvas, 429 429 1 + Tribe[IconIndex].facepix mod 10 * 65, 430 430 1 + Tribe[IconIndex].facepix div 10 * 49) -
trunk/LocalPlayer/NatStat.pas
r295 r313 279 279 // show leader picture 280 280 Tribe[pView].InitAge(GetAge(pView)); 281 if Tribe[pView].faceHGr >= 0then281 if Assigned(Tribe[pView].faceHGr) then 282 282 begin 283 283 Dump(offscreen, Tribe[pView].faceHGr, 18, yIcon - 4, 64, 48, -
trunk/LocalPlayer/Nego.pas
r174 r313 149 149 with TButtonN(Components[cix]) do 150 150 begin 151 Graphic := GrExt[HGrSystem].Data;152 Mask := GrExt[HGrSystem].Mask;153 BackGraphic := GrExt[HGrSystem2].Data;151 Graphic := HGrSystem.Data; 152 Mask := HGrSystem.Mask; 153 BackGraphic := HGrSystem2.Data; 154 154 case Tag shr 8 of 155 155 1: … … 432 432 Brush.Color := $000000; 433 433 Tribe[p].InitAge(GetAge(p)); 434 if Tribe[p].faceHGr >= 0then434 if Assigned(Tribe[p].faceHGr) then 435 435 Dump(Offscreen, Tribe[p].faceHGr, X, Y, 64, 48, 436 436 1 + Tribe[p].facepix mod 10 * 65, 1 + Tribe[p].facepix div 10 * 49) -
trunk/LocalPlayer/Rates.pas
r188 r313 123 123 for i := 0 to current div 8 - 1 do 124 124 BitBltCanvas(Offscreen.Canvas, x + max - 8 - i * 8, y, 8, 7, 125 GrExt[HGrSystem].Data.Canvas, 104, 9 + 8 * 2);125 HGrSystem.Data.Canvas, 104, 9 + 8 * 2); 126 126 BitBltCanvas(Offscreen.Canvas, x + max - current, y, current - 8 * (current div 8), 7, 127 GrExt[HGrSystem].Data.Canvas, 104, 9 + 8 * 2);127 HGrSystem.Data.Canvas, 104, 9 + 8 * 2); 128 128 Brush.Color := $000000; 129 129 FillRect(Rect(x, y, x + max - current, y + 7)); -
trunk/LocalPlayer/Select.pas
r226 r313 579 579 j := AdvValue[lix] div 1000; 580 580 BitBltCanvas(offscreen.Canvas, (8 + 16 - 4), y0 + 2, 14, 14, 581 GrExt[HGrSystem].Mask.Canvas, 127 + j * 15,581 HGrSystem.Mask.Canvas, 127 + j * 15, 582 582 85, SRCAND); 583 583 Sprite(offscreen, HGrSystem, (8 + 16 - 5), y0 + 1, 14, 14, … … 1350 1350 begin 1351 1351 if Tribe[DipMem[me].pContact].ModelPicture 1352 [MyRO.EnemyModel[emix].mix].HGr = 0then1352 [MyRO.EnemyModel[emix].mix].HGr = HGrSystem then 1353 1353 InitEnemyModel(emix); 1354 1354 code[0, Lines[0]] := emix; … … 1373 1373 (MyRO.EnemyModel[code[1, Lines[0]]].mix = i)) do 1374 1374 dec(code[1, Lines[0]]); 1375 if Tribe[pView].ModelPicture[i].HGr = 0then1375 if Tribe[pView].ModelPicture[i].HGr = HGrSystem then 1376 1376 InitEnemyModel(code[1, Lines[0]]); 1377 1377 code[0, Lines[0]] := i; … … 1394 1394 PPicture := @Tribe[MyRO.EnemyModel[emix].Owner].ModelPicture 1395 1395 [MyRO.EnemyModel[emix].mix]; 1396 if PPicture.HGr = 0then1396 if PPicture.HGr = HGrSystem then 1397 1397 InitEnemyModel(emix); 1398 1398 ok := true; -
trunk/LocalPlayer/Term.pas
r312 r313 445 445 SoundPreloadDone: Integer; 446 446 MarkCityLoc: Integer; 447 HGrTerrain: Integer;448 HGrCities: Integer;447 HGrTerrain: TGrExtDescr; 448 HGrCities: TGrExtDescr; 449 449 MovieSpeed: Integer; 450 450 CityRepMask: Cardinal; … … 751 751 for emix := 0 to MyRO.nEnemyModel - 1 do 752 752 with MyRO.EnemyModel[emix] do 753 if Tribe[Owner].ModelPicture[mix].HGr = 0then753 if Tribe[Owner].ModelPicture[mix].HGr = HGrSystem then 754 754 InitEnemyModel(emix); 755 755 end; … … 834 834 while MyData.ToldModels < MyRO.nModel do 835 835 begin { new Unit class available } 836 if (ModelPicture[MyData.ToldModels].HGr > 0) and836 if (ModelPicture[MyData.ToldModels].HGr <> HGrSystem) and 837 837 (MyModel[MyData.ToldModels].Kind <> mkSelfDeveloped) then 838 838 begin // save picture of DevModel 839 839 ModelPicture[MyData.ToldModels + 1] := ModelPicture[MyData.ToldModels]; 840 840 ModelName[MyData.ToldModels + 1] := ModelName[MyData.ToldModels]; 841 ModelPicture[MyData.ToldModels].HGr := 0841 ModelPicture[MyData.ToldModels].HGr := HGrSystem 842 842 end; 843 if ModelPicture[MyData.ToldModels].HGr = 0then843 if ModelPicture[MyData.ToldModels].HGr = HGrSystem then 844 844 InitMyModel(MyData.ToldModels, true); 845 845 { only run if no researched model } … … 1042 1042 DraftDlg.ShowNewContent(wmModal); 1043 1043 if DraftDlg.ModalResult <> mrOK then 1044 Tribe[me].ModelPicture[MyRO.nModel].HGr := 01044 Tribe[me].ModelPicture[MyRO.nModel].HGr := HGrSystem 1045 1045 end; 1046 1046 until (ChosenResearch <> adMilitary) or (DraftDlg.ModalResult = mrOK); … … 1603 1603 for x := 0 to 11 do 1604 1604 for y := 0 to 1 do 1605 MiniColors[x, y] := GrExt[HGrSystem].Data.Canvas.Pixels[66 + x, 67 + y];1605 MiniColors[x, y] := HGrSystem.Data.Canvas.Pixels[66 + x, 67 + y]; 1606 1606 IsoEngine.Init(InitEnemyModel); 1607 1607 if not IsoEngine.ApplyTileSize(xxt, yyt) and ((xxt <> 48) or (yyt <> 24) or (xxt <> 72)) … … 2785 2785 ItsMeAgain(p1); 2786 2786 for mix := 0 to MyRO.nModel - 1 do 2787 if Tribe[me].ModelPicture[mix].HGr = 0then2787 if Tribe[me].ModelPicture[mix].HGr = HGrSystem then 2788 2788 InitMyModel(mix, true); 2789 2789 end; … … 3075 3075 begin 3076 3076 CurrentMoveInfo.DoShow := false; 3077 if not idle and (Tribe[Owner].ModelPicture[mix].HGr = 0) then3077 if not idle and (Tribe[Owner].ModelPicture[mix].HGr = HGrSystem) then 3078 3078 InitEnemyModel(emix); 3079 3079 … … 3270 3270 begin 3271 3271 ToLoc := dLoc(FromLoc, dx, dy); 3272 if Tribe[Owner].ModelPicture[mix].HGr = 0then3272 if Tribe[Owner].ModelPicture[mix].HGr = HGrSystem then 3273 3273 InitEnemyModel(emix); 3274 3274 … … 4073 4073 begin 4074 4074 if not Assigned(MyMap) then Exit; 4075 cmPolOcean := GrExt[HGrSystem].Data.Canvas.Pixels[101, 67];4076 cmPolNone := GrExt[HGrSystem].Data.Canvas.Pixels[102, 67];4075 cmPolOcean := HGrSystem.Data.Canvas.Pixels[101, 67]; 4076 cmPolNone := HGrSystem.Data.Canvas.Pixels[102, 67]; 4077 4077 hw := MapWidth div (xxt * 2); 4078 4078 with Mini.Canvas do begin … … 4400 4400 $FFFFFF, $B0B0B0); 4401 4401 BitBltCanvas(Panel.Canvas, ClientWidth - xPalace, yPalace, xSizeBig, 4402 ySizeBig, GrExt[HGrSystem2].Data.Canvas, 70, 123);4402 ySizeBig, HGrSystem2.Data.Canvas, 70, 123); 4403 4403 end 4404 4404 else if MyRO.NatBuilt[imPalace] > 0 then … … 4615 4615 BiColorTextWidth(Panel.Canvas, s) div 2, PanelHeight - 23, s); 4616 4616 4617 FrameImage(Panel.Canvas, GrExt[HGrSystem].Data,4617 FrameImage(Panel.Canvas, HGrSystem.Data, 4618 4618 xMidPanel + 7 + xUnitText, yTroop + 15, 12, 14, 4619 4619 121 + Exp div ExpCost * 13, 28); … … 5353 5353 MyRO.EnemyModel[emix].mix, MouseLoc) >= rExecuted) then 5354 5354 begin 5355 if Tribe[p1].ModelPicture[MyRO.EnemyModel[emix].mix].HGr = 0then5355 if Tribe[p1].ModelPicture[MyRO.EnemyModel[emix].mix].HGr = HGrSystem then 5356 5356 InitEnemyModel(emix); 5357 5357 m2 := TMenuItem.Create(m); … … 6436 6436 procedure TMainScreen.SetViewpoint(p: integer); 6437 6437 var 6438 i: integer;6438 i: Integer; 6439 6439 begin 6440 6440 if supervising and (G.RO[0].Turn > 0) and … … 6447 6447 SumCities(TaxSum, ScienceSum); 6448 6448 for i := 0 to MyRO.nModel - 1 do 6449 if Tribe[me].ModelPicture[i].HGr = 0then6450 InitMyModel(i, true);6449 if Tribe[me].ModelPicture[i].HGr = HGrSystem then 6450 InitMyModel(i, True); 6451 6451 6452 6452 SetTroopLoc(-1); 6453 6453 PanelPaint; 6454 MapValid := false;6454 MapValid := False; 6455 6455 PaintAllMaps; 6456 6456 end; -
trunk/LocalPlayer/Tribes.pas
r312 r313 14 14 15 15 TModelPicture = record 16 HGr: Integer;16 HGr: TGrExtDescr; 17 17 pix: Integer; 18 18 xShield: Integer; … … 29 29 30 30 TTribe = class 31 symHGr: Integer;31 symHGr: TGrExtDescr; 32 32 sympix: Integer; 33 faceHGr: Integer;33 faceHGr: TGrExtDescr; 34 34 facepix: Integer; 35 cHGr: Integer;35 cHGr: TGrExtDescr; 36 36 cpix: Integer; 37 37 // symbol and city graphics … … 62 62 var 63 63 Tribe: array [0 .. nPl - 1] of TTribe; 64 HGrStdUnits: Integer;64 HGrStdUnits: TGrExtDescr; 65 65 66 66 procedure Init; … … 70 70 procedure FindStdModelPicture(Code: Integer; var pix: Integer; var Name: string); 71 71 function GetTribeInfo(FileName: string; var Name: string; var Color: TColor): Boolean; 72 procedure FindPosition(HGr ,x, y, xmax, ymax: Integer; Mark: TColor;72 procedure FindPosition(HGr: TGrExtDescr; x, y, xmax, ymax: Integer; Mark: TColor; 73 73 var xp, yp: Integer); 74 74 … … 82 82 TChosenModelPictureInfo = record 83 83 Hash: Integer; 84 HGr: Integer;84 HGr: TGrExtDescr; 85 85 pix: Integer; 86 86 ModelName: ShortString; … … 328 328 end; 329 329 330 procedure FindPosition(HGr ,x, y, xmax, ymax: Integer; Mark: TColor;330 procedure FindPosition(HGr: TGrExtDescr; x, y, xmax, ymax: Integer; Mark: TColor; 331 331 var xp, yp: Integer); 332 332 begin 333 333 xp := 0; 334 while (xp < xmax) and ( GrExt[HGr].Data.Canvas.Pixels[x + 1 + xp, y] <> Mark) do334 while (xp < xmax) and (HGr.Data.Canvas.Pixels[x + 1 + xp, y] <> Mark) do 335 335 Inc(xp); 336 336 yp := 0; 337 while (yp < ymax) and ( GrExt[HGr].Data.Canvas.Pixels[x, y + 1 + yp] <> Mark) do337 while (yp < ymax) and (HGr.Data.Canvas.Pixels[x, y + 1 + yp] <> Mark) do 338 338 Inc(yp); 339 339 end; … … 447 447 end 448 448 else 449 cHGr := -1;449 cHGr := nil; 450 450 451 451 {$IFNDEF SCR} … … 454 454 Item := Get; 455 455 if Item = '' then 456 faceHGr := -1456 faceHGr := nil 457 457 else 458 458 begin 459 459 faceHGr := LoadGraphicSet(Item + '.png'); 460 460 facepix := GetNum; 461 if GrExt[faceHGr].Data.Canvas.Pixels[facepix mod 10 * 65,461 if faceHGr.Data.Canvas.Pixels[facepix mod 10 * 65, 462 462 facepix div 10 * 49 + 48] = $00FFFF then 463 463 begin // generate shield picture 464 GrExt[faceHGr].Data.Canvas.Pixels[facepix mod 10 * 65,464 faceHGr.Data.Canvas.Pixels[facepix mod 10 * 65, 465 465 facepix div 10 * 49 + 48] := $000000; 466 466 Gray := $B8B8B8; 467 ImageOp_BCC( GrExt[faceHGr].Data, Templates,467 ImageOp_BCC(faceHGr.Data, Templates, 468 468 facepix mod 10 * 65 + 1, facepix div 10 * 49 + 1, 1, 25, 64, 48, 469 469 Gray, Color); … … 500 500 HGr := LoadGraphicSet(GrName); 501 501 pix := Info.pix; 502 Inc( GrExt[HGr].pixUsed[pix]);502 Inc(HGr.pixUsed[pix]); 503 503 end; 504 504 ModelName[mix] := ''; … … 558 558 Code, Turn: Integer; ForceNew: Boolean): Boolean; 559 559 var 560 i, Cnt, HGr, Used, LeastUsed: Integer; 560 i: Integer; 561 Cnt: Integer; 562 HGr: TGrExtDescr; 563 Used: Integer; 564 LeastUsed: Integer; 561 565 TestPic: TModelPictureInfo; 562 566 ok: Boolean; … … 567 571 if Code = GetNum then 568 572 begin 569 if ForceNew or ( HGr < 0) then573 if ForceNew or (not Assigned(HGr)) then 570 574 Used := 0 571 575 else 572 576 begin 573 Used := 4 * GrExt[HGr].pixUsed[TestPic.pix];577 Used := 4 * HGr.pixUsed[TestPic.pix]; 574 578 if HGr = HGrStdUnits then 575 579 Inc(Used, 2); // prefer units not from StdUnits … … 596 600 if PictureList[i].Hash = Picture.Hash then 597 601 begin 598 Picture.GrName := GrExt[PictureList[i].HGr].Name;602 Picture.GrName := PictureList[i].HGr.Name; 599 603 Picture.pix := PictureList[i].pix; 600 604 Result := False; … … 623 627 ok := True; 624 628 TestPic.GrName := Copy(Input, 8, 255) + '.png'; 625 HGr := GrExt.Count - 1; 626 while (HGr >= 0) and (GrExt[HGr].Name <> TestPic.GrName) do 627 Dec(HGr); 629 HGr := GrExt.SearchByName(TestPic.GrName); 628 630 end 629 631 else if (Input <> '') and (Input[1] = '#') then -
trunk/LocalPlayer/UnitStat.pas
r300 r313 136 136 begin 137 137 mox := @MyRO.EnemyModel[emix]; 138 if Tribe[owner].ModelPicture[mix].HGr = 0then138 if Tribe[owner].ModelPicture[mix].HGr = HGrSystem then 139 139 InitEnemyModel(emix); 140 140 end … … 529 529 with offscreen.Canvas do 530 530 begin 531 Brush.Color := GrExt[HGrSystem].Data.Canvas.Pixels[98, 67];531 Brush.Color := HGrSystem.Data.Canvas.Pixels[98, 67]; 532 532 offscreen.Canvas.FillRect(Rect(xView, yView, xView + 64, 533 533 yView + 16)); … … 574 574 Sprite(offscreen, HGrStdUnits, xView, yView, xxu * 2, yyu * 2, 575 575 1 + 6 * (xxu * 2 + 1), 1); 576 FrameImage(offscreen.Canvas, GrExt[HGrSystem].Data, xView - 20,576 FrameImage(offscreen.Canvas, HGrSystem.Data, xView - 20, 577 577 yView + 5, 12, 14, 121 + Exp div ExpCost * 13, 28); 578 578 if Health < 100 then
Note:
See TracChangeset
for help on using the changeset viewer.