Changeset 28
- Timestamp:
- Jan 8, 2017, 7:14:56 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/CityScreen.pas
r20 r28 216 216 Back.Height := ClientHeight; 217 217 Template := TBitmap.Create; 218 LoadGraphicFile(Template, HomeDir + 'Graphics ' + DirectorySeparator + 'City', gfNoGamma);218 LoadGraphicFile(Template, HomeDir + 'Graphics\City', gfNoGamma); 219 219 Template.PixelFormat := pf8bit; 220 220 CityMapTemplate := TBitmap.Create; 221 LoadGraphicFile(CityMapTemplate, HomeDir + 'Graphics ' + DirectorySeparator + 'BigCityMap', gfNoGamma);221 LoadGraphicFile(CityMapTemplate, HomeDir + 'Graphics\BigCityMap', gfNoGamma); 222 222 CityMapTemplate.PixelFormat := pf8bit; 223 223 SmallCityMapTemplate := TBitmap.Create; 224 LoadGraphicFile(SmallCityMapTemplate, HomeDir + 'Graphics ' + DirectorySeparator + 'SmallCityMap',224 LoadGraphicFile(SmallCityMapTemplate, HomeDir + 'Graphics\SmallCityMap', 225 225 gfNoGamma); 226 226 SmallCityMapTemplate.PixelFormat := pf24bit; … … 447 447 line[i, 1] := 0; 448 448 line[i, 2] := gray; // 255-(255-gray) div 2; 449 end 449 end; 450 450 end; 451 451 … … 453 453 i: integer; 454 454 begin 455 Offscreen.BeginUpdate; 455 456 for i := 0 to h - 1 do 456 RedLine(@(PLine(offscreen.ScanLine[y + i])[x]), w) 457 RedLine(@(PLine(offscreen.ScanLine[y + i])[x]), w); 458 Offscreen.EndUpdate; 457 459 end; 458 460 -
trunk/LocalPlayer/Help.pas
r21 r28 375 375 (SystemIconLines + woEiffel div 7) * ySizeBig + dy]; 376 376 377 BigImp.BeginUpdate; 378 Offscreen.BeginUpdate; 377 379 xSrc := iix mod 7 * xSizeBig; 378 380 ySrc := (iix div 7 + 1) * ySizeBig; … … 408 410 PaintLine[x0 + x, 1] := PaintLine[x0 + x, 1] * sum shr 22; 409 411 PaintLine[x0 + x, 2] := PaintLine[x0 + x, 2] * sum shr 22; 410 end 411 end 412 end; 413 end; 412 414 end; 415 Offscreen.EndUpdate; 416 BigImp.EndUpdate; 413 417 end; 414 418 -
trunk/LocalPlayer/IsoEngine.pas
r21 r28 343 343 Mask24.Assign(GrExt[HGrTerrain].Mask); 344 344 Mask24.PixelFormat := pf24bit; 345 Mask24.BeginUpdate; 345 346 for ySrc := 0 to TerrainIconLines - 1 do 346 347 begin … … 358 359 Border := false; 359 360 if Border then 360 inc(TSpriteSize[i].Left) until not Border or 361 (TSpriteSize[i].Left = xxt * 2 - 1); 362 TSpriteSize[i].Top := 0; 363 repeat 364 Border := true; 365 for x := 0 to xxt * 2 - 1 do 366 if MaskLine[TSpriteSize[i].Top]^[1 + xSrc * (xxt * 2 + 1) + x, 0] = 0 367 then 361 inc(TSpriteSize[i].Left); 362 until not Border or 363 (TSpriteSize[i].Left = xxt * 2 - 1); 364 TSpriteSize[i].Top := 0; 365 repeat 366 Border := true; 367 for x := 0 to xxt * 2 - 1 do 368 if MaskLine[TSpriteSize[i].Top]^[1 + xSrc * (xxt * 2 + 1) + x, 0] = 0 369 then 370 Border := false; 371 if Border then 372 inc(TSpriteSize[i].Top); 373 until not Border or 374 (TSpriteSize[i].Top = yyt * 3 - 1); 375 TSpriteSize[i].Right := xxt * 2; 376 repeat 377 Border := true; 378 for y := 0 to yyt * 3 - 1 do 379 if MaskLine[y]^[xSrc * (xxt * 2 + 1) + TSpriteSize[i].Right, 0] = 0 380 then 381 Border := false; 382 if Border then 383 dec(TSpriteSize[i].Right); 384 until not Border or 385 (TSpriteSize[i].Right = TSpriteSize[i].Left); 386 TSpriteSize[i].Bottom := yyt * 3; 387 repeat 388 Border := true; 389 for x := 0 to xxt * 2 - 1 do 390 if MaskLine[TSpriteSize[i].Bottom - 1]^ 391 [1 + xSrc * (xxt * 2 + 1) + x, 0] = 0 then 368 392 Border := false; 369 if Border then 370 inc(TSpriteSize[i].Top) until not Border or 371 (TSpriteSize[i].Top = yyt * 3 - 1); 372 TSpriteSize[i].Right := xxt * 2; 373 repeat 374 Border := true; 375 for y := 0 to yyt * 3 - 1 do 376 if MaskLine[y]^[xSrc * (xxt * 2 + 1) + TSpriteSize[i].Right, 0] = 0 377 then 378 Border := false; 379 if Border then 380 dec(TSpriteSize[i].Right) until not Border or 381 (TSpriteSize[i].Right = TSpriteSize[i].Left); 382 TSpriteSize[i].Bottom := yyt * 3; 383 repeat 384 Border := true; 385 for x := 0 to xxt * 2 - 1 do 386 if MaskLine[TSpriteSize[i].Bottom - 1]^ 387 [1 + xSrc * (xxt * 2 + 1) + x, 0] = 0 then 388 Border := false; 389 if Border then 390 dec(TSpriteSize[i].Bottom) until not Border or 391 (TSpriteSize[i].Bottom = TSpriteSize[i].Top); 392 end 393 end; 394 Mask24.Free; 395 396 if Borders <> nil then 397 Borders.Free; 398 Borders := TBitmap.Create; 399 Borders.PixelFormat := pf24bit; 400 Borders.Width := xxt * 2; 401 Borders.Height := (yyt * 2) * nPl; 402 BordersOK := 0; 403 end; 393 if Border then 394 dec(TSpriteSize[i].Bottom); 395 until not Border or 396 (TSpriteSize[i].Bottom = TSpriteSize[i].Top); 397 end 398 end; 399 Mask24.EndUpdate; 400 Mask24.Free; 401 402 if Borders <> nil then 403 Borders.Free; 404 Borders := TBitmap.Create; 405 Borders.PixelFormat := pf24bit; 406 Borders.Width := xxt * 2; 407 Borders.Height := (yyt * 2) * nPl; 408 BordersOK := 0; 409 end; 404 410 405 411 procedure Done; … … 1008 1014 1 + 8 * (xxt * 2 + 1), 1009 1015 1 + yyt + 16 * (yyt * 3 + 1), SRCCOPY); 1016 Borders.BeginUpdate; 1010 1017 for dy := 0 to yyt * 2 - 1 do 1011 1018 begin … … 1019 1026 end 1020 1027 end; 1028 Borders.EndUpdate; 1021 1029 BordersOK := BordersOK or 1 shl p1; 1022 1030 end; … … 1340 1348 Line: ^TLine; 1341 1349 begin 1350 FOutput.BeginUpdate; 1342 1351 for y := y0 to y1 - 1 do 1343 1352 begin … … 1353 1362 else 1354 1363 MakeDark(@Line[x0], x1 - x0); 1355 end 1364 end; 1365 FOutput.EndUpdate; 1356 1366 end; 1357 1367 -
trunk/LocalPlayer/MessgEx.pas
r21 r28 247 247 // prepare screwed icon 248 248 fillchar(Screwed, sizeof(Screwed), 0); 249 BigImp.BeginUpdate; 249 250 for iy := 0 to 39 do 250 251 begin … … 278 279 Screwed[xDst + dx, yDst + dy, 3] := Screwed[xDst + dx, yDst + dy, 279 280 3] + share; 280 end 281 end; 281 282 end; 282 283 end; 284 BigImp.EndUpdate; 283 285 xb := xBBook; 284 286 yb := yBBook; -
trunk/LocalPlayer/TechTree.pas
r20 r28 166 166 167 167 // texturize background 168 Image.BeginUpdate; 168 169 TexWidth := Paper.width; 169 170 TexHeight := Paper.height; … … 176 177 if Cardinal((@DstLine[X])^) and $FFFFFF = $7F007F then // transparent 177 178 DstLine[X] := SrcLine[X mod TexWidth]; 178 end 179 end 179 end; 180 end; 181 Image.EndUpdate; 180 182 end; 181 183 -
trunk/LocalPlayer/Term.pas
r21 r28 437 437 438 438 {$R *.lfm} 439 //TODO {$R Res1.res}439 {TODO {$R Res1.res} 440 440 441 441 const … … 522 522 GetMem(resampled, nx * ny * 12); 523 523 FillChar(resampled^, nx * ny * 12, 0); 524 BigImp.BeginUpdate; 524 525 for ix := 0 to BigImp.width div xSizeBig - 1 do 525 526 for iy := 0 to BigImp.height div ySizeBig - 1 do … … 553 554 inc(resampled[ir + nx + 1, ch], c * (xSizeSmall - xdivider) * 554 555 (ySizeSmall - ydivider)); 555 end 556 end 556 end; 557 end; 557 558 end; 559 BigImp.EndUpdate; 558 560 559 561 // sharpen resampled icons 560 562 SmallImp.width := nx; 561 563 SmallImp.height := ny; 564 SmallImp.BeginUpdate; 562 565 for y := 0 to ny - 1 do 563 566 begin … … 587 590 end; 588 591 end; 592 SmallImp.EndUpdate; 589 593 FreeMem(resampled); 590 594 // smallimp.savetofile(homedir+'smallimp.bmp'); //!!! … … 4088 4092 end; 4089 4093 MiniLine := nil; 4094 Mini.BeginUpdate; 4090 4095 for y := 0 to G.ly - 1 do 4091 4096 begin … … 4159 4164 MiniLine[xm, 2] := cm and $FF; 4160 4165 end; 4161 end 4162 end; 4166 end; 4167 end; 4168 Mini.EndUpdate; 4163 4169 end; 4164 4170 -
trunk/LocalPlayer/Wonders.pas
r21 r28 157 157 Offscreen.Canvas.Font.Assign(UniFont[ftNormal]); 158 158 159 Offscreen.BeginUpdate; 159 160 xm := ClientWidth div 2; 160 161 ym := ClientHeight div 2; … … 184 185 else 185 186 Line[i][xm - 1 - X][ch] := c; 186 end 187 end; 188 end; 187 end; 188 end; 189 end; 190 Offscreen.EndUpdate; 189 191 190 192 HaveWonder := false; -
trunk/ScreenTools.pas
r21 r28 439 439 if (Options and gfNoGamma = 0) and (Gamma <> 100) then 440 440 begin 441 bmp.BeginUpdate; 441 442 FirstLine := bmp.ScanLine[0]; 442 443 LastLine := bmp.ScanLine[bmp.Height - 1]; … … 444 445 ApplyGamma(pointer(FirstLine), @LastLine[bmp.Width]) 445 446 else 446 ApplyGamma(pointer(LastLine), @FirstLine[bmp.Width]) 447 ApplyGamma(pointer(LastLine), @FirstLine[bmp.Width]); 448 bmp.EndUpdate; 447 449 end 448 450 end; … … 497 499 if (Options and gfNoGamma = 0) and (Gamma <> 100) then 498 500 begin 501 bmp.BeginUpdate; 499 502 FirstLine := bmp.ScanLine[0]; 500 503 LastLine := bmp.ScanLine[bmp.Height - 1]; … … 502 505 ApplyGamma(pointer(FirstLine), @LastLine[bmp.Width]) 503 506 else 504 ApplyGamma(pointer(LastLine), @FirstLine[bmp.Width]) 507 ApplyGamma(pointer(LastLine), @FirstLine[bmp.Width]); 508 bmp.EndUpdate; 505 509 end 506 510 end; … … 546 550 GrExt[nGrExt].Mask.Height := Source.Height; 547 551 552 GrExt[nGrExt].Data.BeginUpdate; 553 GrExt[nGrExt].Mask.BeginUpdate; 548 554 for y := 0 to Source.Height - 1 do 549 555 begin … … 570 576 end 571 577 end; 578 GrExt[nGrExt].Data.EndUpdate; 579 GrExt[nGrExt].Mask.EndUpdate; 572 580 573 581 FillChar(GrExt[nGrExt].pixUsed, GrExt[nGrExt].Data.Height div 49 * 10, 0); 574 inc(nGrExt) 582 inc(nGrExt); 575 583 end 576 584 end; … … 602 610 i: integer; 603 611 begin 612 dst.BeginUpdate; 604 613 for i := 0 to h - 1 do 605 BlueLine(@(PLine(dst.ScanLine[y + i])[x]), w) 614 BlueLine(@(PLine(dst.ScanLine[y + i])[x]), w); 615 dst.EndUpdate; 606 616 end; 607 617 … … 638 648 exit; 639 649 650 dst.BeginUpdate; 640 651 h := yDst + h; 641 652 while yDst < h do … … 666 677 inc(yDst); 667 678 inc(ySrc); 668 end 679 end; 680 dst.EndUpdate; 669 681 end; 670 682 … … 681 693 SrcLine, DstLine: ^TLine; 682 694 begin 683 if xDst < 0 then 684 begin 695 if xDst < 0 then begin 685 696 w := w + xDst; 686 697 xSrc := xSrc - xDst; 687 698 xDst := 0; 688 699 end; 689 if yDst < 0 then 690 begin 700 if yDst < 0 then begin 691 701 h := h + yDst; 692 702 ySrc := ySrc - yDst; … … 700 710 exit; 701 711 712 dst.BeginUpdate; 702 713 for iy := 0 to h - 1 do 703 714 begin … … 732 743 end 733 744 end; 745 dst.EndUpdate; 734 746 end; 735 747 … … 746 758 Pixel: ^TPixel; 747 759 begin 760 bmp.BeginUpdate; 748 761 assert(bmp.PixelFormat = pf24bit); 749 762 h := y + h; … … 766 779 end; 767 780 inc(y); 768 end 781 end; 782 bmp.EndUpdate; 769 783 end; 770 784 … … 884 898 DstLine: ^TLine; 885 899 begin 900 dst.BeginUpdate; 886 901 for y := -GlowRange + 1 to Height - 1 + GlowRange - 1 do 887 902 begin … … 917 932 (GlowRange - r)) div (GlowRange - 1); 918 933 end; 919 end 934 end; 935 dst.EndUpdate; 920 936 end; 921 937 -
trunk/Start.pas
r20 r28 830 830 SetMainTextureByAge(-1); 831 831 List.Font.Color := MainTexture.clMark; 832 EmptyPicture.BeginUpdate; 833 832 834 Fill(EmptyPicture.Canvas, 0, 0, 64, 64, (wMaintexture - 64) div 2, 833 835 (hMaintexture - 64) div 2); … … 843 845 end 844 846 end; 847 EmptyPicture.EndUpdate; 845 848 846 849 Difficulty[0] := Diff0; … … 1017 1020 Mini.width := MiniWidth * 2; 1018 1021 Mini.height := MiniHeight; 1022 Mini.BeginUpdate; 1019 1023 for y := 0 to MiniHeight - 1 do 1020 1024 begin … … 1033 1037 end; 1034 1038 end; 1039 Mini.EndUpdate; 1035 1040 end; 1036 1041 … … 1053 1058 begin 1054 1059 MiniLine := nil; 1060 Mini.BeginUpdate; 1055 1061 for y := 0 to MiniHeight - 1 do 1056 1062 begin … … 1088 1094 MiniLine[xm, 2] := cm and $FF; 1089 1095 end; 1090 end 1096 Mini.EndUpdate; 1097 end; 1091 1098 end; 1092 1099 end;
Note:
See TracChangeset
for help on using the changeset viewer.