Changeset 313
- Timestamp:
- Mar 17, 2021, 11:11:55 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 17 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 -
trunk/Packages/CevoComponents/DrawDlg.pas
r297 r313 202 202 if Components[cix] is TButtonBase then 203 203 begin 204 TButtonBase(Components[cix]).Graphic := GrExt[HGrSystem].Data;204 TButtonBase(Components[cix]).Graphic := HGrSystem.Data; 205 205 // if ButtonDownSound <> '*' then 206 206 // DownSound := GetSoundsDir + DirectorySeparator + ButtonDownSound + '.wav'; … … 210 210 TButtonA(Components[cix]).Font := UniFont[ftButton]; 211 211 if Components[cix] is TButtonB then 212 TButtonB(Components[cix]).Mask := GrExt[HGrSystem].Mask;212 TButtonB(Components[cix]).Mask := HGrSystem.Mask; 213 213 end; 214 214 end; -
trunk/Packages/CevoComponents/ScreenTools.pas
r312 r313 25 25 TLoadGraphicFileOptions = set of TLoadGraphicFileOption; 26 26 27 { TGrExtDescr } 28 29 TGrExtDescr = class 30 Name: string; 31 Data: TBitmap; 32 Mask: TBitmap; 33 pixUsed: array of Byte; 34 procedure ResetPixUsed; 35 constructor Create; 36 destructor Destroy; override; 37 end; 38 39 { TGrExtDescrs } 40 41 TGrExtDescrs = class(TFPGObjectList<TGrExtDescr>) 42 function SearchByName(Name: string): TGrExtDescr; 43 function AddNew(Name: string): TGrExtDescr; 44 end; 45 46 TFontType = (ftNormal, ftSmall, ftTiny, ftCaption, ftButton); 27 47 28 48 {$IFDEF WINDOWS} … … 38 58 function HexStringToColor(S: string): integer; 39 59 function LoadGraphicFile(Bmp: TBitmap; FileName: string; Options: TLoadGraphicFileOptions = []): boolean; 40 function LoadGraphicSet(const Name: string): integer;41 procedure Dump(dst: TBitmap; HGr ,xDst, yDst, Width, Height, xGr, yGr: integer);42 procedure Sprite(Canvas: TCanvas; HGr ,xDst, yDst, Width, Height, xGr, yGr: integer);60 function LoadGraphicSet(const Name: string): TGrExtDescr; 61 procedure Dump(dst: TBitmap; HGr: TGrExtDescr; xDst, yDst, Width, Height, xGr, yGr: integer); 62 procedure Sprite(Canvas: TCanvas; HGr: TGrExtDescr; xDst, yDst, Width, Height, xGr, yGr: integer); 43 63 overload; 44 procedure Sprite(dst: TBitmap; HGr ,xDst, yDst, Width, Height, xGr, yGr: integer);64 procedure Sprite(dst: TBitmap; HGr: TGrExtDescr; xDst, yDst, Width, Height, xGr, yGr: integer); 45 65 overload; 46 66 procedure MakeBlue(Dst: TBitmap; X, Y, Width, Height: Integer); … … 168 188 cliWater = 4; 169 189 170 type171 172 { TGrExtDescr }173 174 TGrExtDescr = class175 Name: string;176 Data: TBitmap;177 Mask: TBitmap;178 pixUsed: array of Byte;179 procedure ResetPixUsed;180 constructor Create;181 destructor Destroy; override;182 end;183 184 { TGrExtDescrs }185 186 TGrExtDescrs = class(TFPGObjectList<TGrExtDescr>)187 function SearchByName(Name: string): TGrExtDescr;188 function AddNew(Name: string): TGrExtDescr;189 end;190 191 TFontType = (ftNormal, ftSmall, ftTiny, ftCaption, ftButton);192 193 190 var 194 191 Phrases: TStringTable; 195 192 Phrases2: TStringTable; 196 193 GrExt: TGrExtDescrs; 197 HGrSystem: Integer;198 HGrSystem2: Integer;194 HGrSystem: TGrExtDescr; 195 HGrSystem2: TGrExtDescr; 199 196 ClickFrameColor: Integer; 200 197 MainTextureAge: Integer; … … 495 492 end; 496 493 497 function LoadGraphicSet(const Name: string): Integer; 498 var 499 I: Integer; 494 function LoadGraphicSet(const Name: string): TGrExtDescr; 495 var 500 496 x: Integer; 501 497 y: Integer; … … 505 501 DataPixel: TPixelPointer; 506 502 MaskPixel: TPixelPointer; 507 NewGrExt: TGrExtDescr; 508 begin 509 NewGrExt := GrExt.SearchByName(Name); 510 if not Assigned(NewGrExt) then begin 511 NewGrExt := GrExt.AddNew(Name); 503 begin 504 Result := GrExt.SearchByName(Name); 505 if not Assigned(Result) then begin 506 Result := GrExt.AddNew(Name); 512 507 FileName := GetGraphicsDir + DirectorySeparator + Name; 513 if not LoadGraphicFile( NewGrExt.Data, FileName) then begin514 Result := -1;508 if not LoadGraphicFile(Result.Data, FileName) then begin 509 Result := nil; 515 510 Exit; 516 511 end; 517 512 518 NewGrExt.ResetPixUsed;519 520 xmax := NewGrExt.Data.Width - 1; // allows 4-byte access even for last pixel513 Result.ResetPixUsed; 514 515 xmax := Result.Data.Width - 1; // allows 4-byte access even for last pixel 521 516 // Why there was that limit? 522 517 //if xmax > 970 then 523 518 // xmax := 970; 524 519 525 NewGrExt.Mask.SetSize(NewGrExt.Data.Width, NewGrExt.Data.Height);526 527 NewGrExt.Data.BeginUpdate;528 NewGrExt.Mask.BeginUpdate;529 DataPixel := PixelPointer( NewGrExt.Data);530 MaskPixel := PixelPointer( NewGrExt.Mask);531 for y := 0 to ScaleToNative( NewGrExt.Data.Height) - 1 do begin520 Result.Mask.SetSize(Result.Data.Width, Result.Data.Height); 521 522 Result.Data.BeginUpdate; 523 Result.Mask.BeginUpdate; 524 DataPixel := PixelPointer(Result.Data); 525 MaskPixel := PixelPointer(Result.Mask); 526 for y := 0 to ScaleToNative(Result.Data.Height) - 1 do begin 532 527 for x := 0 to ScaleToNative(xmax) - 1 do begin 533 528 OriginalColor := DataPixel.Pixel^.ARGB and $FFFFFF; … … 548 543 MaskPixel.NextLine; 549 544 end; 550 NewGrExt.Data.EndUpdate; 551 NewGrExt.Mask.EndUpdate; 552 end; 553 Result := GrExt.IndexOf(NewGrExt); 554 end; 555 556 procedure Dump(dst: TBitmap; HGr, xDst, yDst, Width, Height, xGr, yGr: integer); 545 Result.Data.EndUpdate; 546 Result.Mask.EndUpdate; 547 end; 548 end; 549 550 procedure Dump(dst: TBitmap; HGr: TGrExtDescr; xDst, yDst, Width, Height, xGr, yGr: integer); 557 551 begin 558 552 BitBltCanvas(dst.Canvas, xDst, yDst, Width, Height, 559 GrExt[HGr].Data.Canvas, xGr, yGr);553 HGr.Data.Canvas, xGr, yGr); 560 554 end; 561 555 … … 820 814 end; 821 815 822 procedure Sprite(Canvas: TCanvas; HGr ,xDst, yDst, Width, Height, xGr, yGr: integer);816 procedure Sprite(Canvas: TCanvas; HGr: TGrExtDescr; xDst, yDst, Width, Height, xGr, yGr: integer); 823 817 begin 824 818 BitBltCanvas(Canvas, xDst, yDst, Width, Height, 825 GrExt[HGr].Mask.Canvas, xGr, yGr, SRCAND);819 HGr.Mask.Canvas, xGr, yGr, SRCAND); 826 820 BitBltCanvas(Canvas, xDst, yDst, Width, Height, 827 GrExt[HGr].Data.Canvas, xGr, yGr, SRCPAINT);828 end; 829 830 procedure Sprite(dst: TBitmap; HGr ,xDst, yDst, Width, Height, xGr, yGr: integer);821 HGr.Data.Canvas, xGr, yGr, SRCPAINT); 822 end; 823 824 procedure Sprite(dst: TBitmap; HGr: TGrExtDescr; xDst, yDst, Width, Height, xGr, yGr: integer); 831 825 begin 832 826 BitBltCanvas(dst.Canvas, xDst, yDst, Width, Height, 833 GrExt[HGr].Mask.Canvas, xGr, yGr, SRCAND);827 HGr.Mask.Canvas, xGr, yGr, SRCAND); 834 828 BitBltCanvas(dst.Canvas, xDst, yDst, Width, Height, 835 GrExt[HGr].Data.Canvas, xGr, yGr, SRCPAINT);829 HGr.Data.Canvas, xGr, yGr, SRCPAINT); 836 830 end; 837 831 … … 1010 1004 for x := 0 to wOrna - 1 do 1011 1005 for y := 0 to hOrna - 1 do begin 1012 p := GrExt[HGrSystem2].Data.Canvas.Pixels[xOrna + x, yOrna + y];1006 p := HGrSystem2.Data.Canvas.Pixels[xOrna + x, yOrna + y]; 1013 1007 if p = $0000FF then 1014 GrExt[HGrSystem2].Data.Canvas.Pixels[xOrna + x, yOrna + y] := Light1008 HGrSystem2.Data.Canvas.Pixels[xOrna + x, yOrna + y] := Light 1015 1009 else if p = $FF0000 then 1016 GrExt[HGrSystem2].Data.Canvas.Pixels[xOrna + x, yOrna + y] := Shade;1010 HGrSystem2.Data.Canvas.Pixels[xOrna + x, yOrna + y] := Shade; 1017 1011 end; 1018 1012 InitOrnamentDone := True; … … 1025 1019 for x := 0 to 9 do 1026 1020 for y := 0 to 9 do 1027 if GrExt[HGrSystem].Mask.Canvas.Pixels[66 + x, 47 + y] = 0 then1021 if HGrSystem.Mask.Canvas.Pixels[66 + x, 47 + y] = 0 then 1028 1022 begin 1029 intensity := GrExt[HGrSystem].Data.Canvas.Pixels[66 +1023 intensity := HGrSystem.Data.Canvas.Pixels[66 + 1030 1024 x, 47 + y] and $FF; 1031 GrExt[HGrSystem].Data.Canvas.Pixels[77 + x, 47 + y] :=1025 HGrSystem.Data.Canvas.Pixels[77 + x, 47 + y] := 1032 1026 T.clMark and $FF * intensity div $FF + T.clMark shr 8 and 1033 1027 $FF * intensity div $FF shl 8 + T.clMark shr 16 and 1034 1028 $FF * intensity div $FF shl 16; 1035 1029 end; 1036 BitBltCanvas( GrExt[HGrSystem].Mask.Canvas, 77, 47, 10, 10,1037 GrExt[HGrSystem].Mask.Canvas, 66, 47);1030 BitBltCanvas(HGrSystem.Mask.Canvas, 77, 47, 10, 10, 1031 HGrSystem.Mask.Canvas, 66, 47); 1038 1032 end; 1039 1033 … … 1144 1138 procedure PaintIcon(x, y, Kind: Integer); 1145 1139 begin 1146 BitBltCanvas(ca, x, y + 6, 10, 10, GrExt[HGrSystem].Mask.Canvas,1140 BitBltCanvas(ca, x, y + 6, 10, 10, HGrSystem.Mask.Canvas, 1147 1141 66 + Kind mod 11 * 11, 115 + Kind div 11 * 11, SRCAND); 1148 BitBltCanvas(ca, x, y + 6, 10, 10, GrExt[HGrSystem].Data.Canvas,1142 BitBltCanvas(ca, x, y + 6, 10, 10, HGrSystem.Data.Canvas, 1149 1143 66 + Kind mod 11 * 11, 115 + Kind div 11 * 11, SRCPAINT); 1150 1144 end; … … 1286 1280 (16, 12, 8, 4, 0, -4, -8, -12 - 24, -16 + 16, -20, -24, -28, -32, -36, -40, -44); 1287 1281 begin 1288 Gradient(ca, x, y, 0, 1, Width, 0, GrExt[HGrSystem].Data.Canvas.Pixels1282 Gradient(ca, x, y, 0, 1, Width, 0, HGrSystem.Data.Canvas.Pixels 1289 1283 [187, 137 + Kind], Brightness); 1290 1284 end; … … 1304 1298 begin 1305 1299 Gradient(ca, x, y, 1, 0, 0, Height, 1306 GrExt[HGrSystem].Data.Canvas.Pixels[187, 137 + Kind], Brightness);1300 HGrSystem.Data.Canvas.Pixels[187, 137 + Kind], Brightness); 1307 1301 end; 1308 1302 … … 1366 1360 begin 1367 1361 BitBltCanvas(dst.Canvas, xIcon + 4 + i * (14 * ld div sd), yIcon + 2 + 1, 14, 1368 14, GrExt[HGrSystem].Mask.Canvas, 67 + Kind mod 8 * 15,1362 14, HGrSystem.Mask.Canvas, 67 + Kind mod 8 * 15, 1369 1363 70 + Kind div 8 * 15, SRCAND); 1370 1364 Sprite(dst, HGrSystem, xIcon + 3 + i * (14 * ld div sd), yIcon + 2, … … 1375 1369 BitBltCanvas(dst.Canvas, xIcon + 4 + (val mod 10) * 1376 1370 (14 * ld div sd) + i * (14 * ld div sd), yIcon + 3, 14, 14, 1377 GrExt[HGrSystem].Mask.Canvas, 67 + 7 mod 8 * 15,1371 HGrSystem.Mask.Canvas, 67 + 7 mod 8 * 15, 1378 1372 70 + 7 div 8 * 15, SRCAND); 1379 1373 Sprite(dst, HGrSystem, xIcon + 3 + (val mod 10) * … … 1399 1393 begin 1400 1394 BitBltCanvas(dst.Canvas, xIcon + 4 + i * (14 * ld div sd), yIcon + 3, 14, 14, 1401 GrExt[HGrSystem].Mask.Canvas, 67 + Kind mod 8 * 15,1395 HGrSystem.Mask.Canvas, 67 + Kind mod 8 * 15, 1402 1396 70 + Kind div 8 * 15, SRCAND); 1403 1397 Sprite(dst, HGrSystem, xIcon + 3 + i * (14 * ld div sd), yIcon + 2, … … 1408 1402 BitBltCanvas(dst.Canvas, xIcon + 4 + (val div 10) * 1409 1403 (14 * ld div sd) + i * (10 * ld div sd), yIcon + 7, 10, 10, 1410 GrExt[HGrSystem].Mask.Canvas, 66 + Kind mod 11 * 11,1404 HGrSystem.Mask.Canvas, 66 + Kind mod 11 * 11, 1411 1405 115 + Kind div 11 * 11, SRCAND); 1412 1406 Sprite(dst, HGrSystem, xIcon + 3 + (val div 10) * … … 1444 1438 for i := 0 to pos div 8 - 1 do 1445 1439 BitBltCanvas(ca, x + i * 8, y, 8, 7, 1446 GrExt[HGrSystem].Data.Canvas, 104, 9 + 8 * Kind);1440 HGrSystem.Data.Canvas, 104, 9 + 8 * Kind); 1447 1441 BitBltCanvas(ca, x + 8 * (pos div 8), y, pos - 8 * (pos div 8), 7, 1448 GrExt[HGrSystem].Data.Canvas, 104, 9 + 8 * Kind);1442 HGrSystem.Data.Canvas, 104, 9 + 8 * Kind); 1449 1443 if Growth > 0 then 1450 1444 begin 1451 1445 for i := 0 to Growth div 8 - 1 do 1452 1446 BitBltCanvas(ca, x + pos + i * 8, y, 8, 7, 1453 GrExt[HGrSystem].Data.Canvas, 112, 9 + 8 * Kind);1447 HGrSystem.Data.Canvas, 112, 9 + 8 * Kind); 1454 1448 BitBltCanvas(ca, x + pos + 8 * (Growth div 8), y, 1455 Growth - 8 * (Growth div 8), 7, GrExt[HGrSystem].Data.Canvas,1449 Growth - 8 * (Growth div 8), 7, HGrSystem.Data.Canvas, 1456 1450 112, 9 + 8 * Kind); 1457 1451 end … … 1460 1454 for i := 0 to -Growth div 8 - 1 do 1461 1455 BitBltCanvas(ca, x + pos + i * 8, y, 8, 7, 1462 GrExt[HGrSystem].Data.Canvas, 104, 1);1456 HGrSystem.Data.Canvas, 104, 1); 1463 1457 BitBltCanvas(ca, x + pos + 8 * (-Growth div 8), y, -Growth - 1464 1458 8 * (-Growth div 8), 7, 1465 GrExt[HGrSystem].Data.Canvas, 104, 1);1459 HGrSystem.Data.Canvas, 104, 1); 1466 1460 end; 1467 1461 Brush.Color := $000000; … … 1712 1706 MainTexture.Image := TBitmap.Create; 1713 1707 MainTextureAge := -2; 1714 ClickFrameColor := GrExt[HGrSystem].Data.Canvas.Pixels[187, 175];1708 ClickFrameColor := HGrSystem.Data.Canvas.Pixels[187, 175]; 1715 1709 InitOrnamentDone := False; 1716 1710 GenerateNames := True; -
trunk/Start.pas
r304 r313 236 236 for X := 0 to 11 do 237 237 for Y := 0 to 1 do 238 Colors[x, y] := GrExt[HGrSystem].Data.Canvas.Pixels[66 + x, 67 + y];238 Colors[x, y] := HGrSystem.Data.Canvas.Pixels[66 + x, 67 + y]; 239 239 end; 240 240 … … 381 381 PrevMiniPixel: TPixelPointer; 382 382 begin 383 OwnColor := GrExt[HGrSystem].Data.Canvas.Pixels[95, 67];384 EnemyColor := GrExt[HGrSystem].Data.Canvas.Pixels[96, 67];383 OwnColor := HGrSystem.Data.Canvas.Pixels[95, 67]; 384 EnemyColor := HGrSystem.Data.Canvas.Pixels[96, 67]; 385 385 Bitmap.PixelFormat := pf24bit; 386 386 Bitmap.SetSize(Size.X * 2, Size.Y); … … 479 479 with PlayerSlots[i] do begin 480 480 DiffUpBtn := TButtonC.Create(self); 481 DiffUpBtn.Graphic := GrExt[HGrSystem].Data;481 DiffUpBtn.Graphic := HGrSystem.Data; 482 482 DiffUpBtn.left := xBrain[i] - 18; 483 483 DiffUpBtn.top := yBrain[i] + 39; … … 486 486 DiffUpBtn.OnClick := DiffBtnClick; 487 487 DiffDownBtn := TButtonC.Create(self); 488 DiffDownBtn.Graphic := GrExt[HGrSystem].Data;488 DiffDownBtn.Graphic := HGrSystem.Data; 489 489 DiffDownBtn.left := xBrain[i] - 18; 490 490 DiffDownBtn.top := yBrain[i] + 51; … … 496 496 with PlayerSlots[i] do begin 497 497 MultiBtn := TButtonC.Create(self); 498 MultiBtn.Graphic := GrExt[HGrSystem].Data;498 MultiBtn.Graphic := HGrSystem.Data; 499 499 MultiBtn.left := xBrain[i] - 18; 500 500 MultiBtn.top := yBrain[i]; … … 511 511 CustomizeBtn.ButtonIndex := 2; 512 512 513 BitBltBitmap(BrainNoTerm.Picture, 0, 0, 64, 64, GrExt[HGrSystem2].Data, 1, 111);514 BitBltBitmap(BrainSuperVirtual.Picture, 0, 0, 64, 64, GrExt[HGrSystem2].Data, 66, 111);515 BitBltBitmap(BrainTerm.Picture, 0, 0, 64, 64, GrExt[HGrSystem2].Data, 131, 111);516 BitBltBitmap(BrainRandom.Picture, 0, 0, 64, 64, GrExt[HGrSystem2].Data, 131, 46);513 BitBltBitmap(BrainNoTerm.Picture, 0, 0, 64, 64, HGrSystem2.Data, 1, 111); 514 BitBltBitmap(BrainSuperVirtual.Picture, 0, 0, 64, 64, HGrSystem2.Data, 66, 111); 515 BitBltBitmap(BrainTerm.Picture, 0, 0, 64, 64, HGrSystem2.Data, 131, 111); 516 BitBltBitmap(BrainRandom.Picture, 0, 0, 64, 64, HGrSystem2.Data, 131, 46); 517 517 LoadAiBrainsPictures; 518 518 … … 907 907 begin 908 908 BitBltCanvas(Canvas, 9 + i * 27, yLogo - 2, wOrna, hOrna, 909 GrExt[HGrSystem2].Mask.Canvas, xOrna, yOrna, SRCAND);909 HGrSystem2.Mask.Canvas, xOrna, yOrna, SRCAND); 910 910 BitBltCanvas(Canvas, 9 + i * 27, yLogo - 2, wOrna, hOrna, 911 GrExt[HGrSystem2].Data.Canvas, xOrna, yOrna, SRCPAINT);911 HGrSystem2.Data.Canvas, xOrna, yOrna, SRCPAINT); 912 912 end; 913 913 PaintLogo(Canvas, 69 + 11 * 27, yLogo, MainTexture.clBevelLight, … … 926 926 begin 927 927 BitBltCanvas(Canvas, xBrain[i] - 18, yBrain[i] + 19, 12, 14, 928 GrExt[HGrSystem].Data.Canvas, 134 + (Difficulty[i] - 1) *928 HGrSystem.Data.Canvas, 134 + (Difficulty[i] - 1) * 929 929 13, 28); 930 930 Frame(Canvas, xBrain[i] - 19, yBrain[i] + 18, xBrain[i] - 18 + 12, … … 946 946 MainTexture.clBevelShade, MainTexture.clBevelLight); 947 947 BitBltCanvas(Canvas, xBrain[i] - 31, yBrain[i], 13, 12, 948 GrExt[HGrSystem].Data.Canvas, 88, 47);948 HGrSystem.Data.Canvas, 88, 47); 949 949 end; 950 950 end; … … 991 991 begin 992 992 BitBltCanvas(Canvas, 9 + i * 27, yLogo - 2, wOrna, hOrna, 993 GrExt[HGrSystem2].Mask.Canvas, xOrna, yOrna, SRCAND);993 HGrSystem2.Mask.Canvas, xOrna, yOrna, SRCAND); 994 994 BitBltCanvas(Canvas, 9 + i * 27, yLogo - 2, wOrna, hOrna, 995 GrExt[HGrSystem2].Data.Canvas, xOrna, yOrna, SRCPAINT);995 HGrSystem2.Data.Canvas, xOrna, yOrna, SRCPAINT); 996 996 end; 997 997 PaintLogo(Canvas, 69, yLogo, MainTexture.clBevelLight,
Note:
See TracChangeset
for help on using the changeset viewer.