Changeset 28


Ignore:
Timestamp:
Jan 8, 2017, 7:14:56 PM (7 years ago)
Author:
chronos
Message:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/CityScreen.pas

    r20 r28  
    216216  Back.Height := ClientHeight;
    217217  Template := TBitmap.Create;
    218   LoadGraphicFile(Template, HomeDir + 'Graphics' + DirectorySeparator + 'City', gfNoGamma);
     218  LoadGraphicFile(Template, HomeDir + 'Graphics\City', gfNoGamma);
    219219  Template.PixelFormat := pf8bit;
    220220  CityMapTemplate := TBitmap.Create;
    221   LoadGraphicFile(CityMapTemplate, HomeDir + 'Graphics' + DirectorySeparator + 'BigCityMap', gfNoGamma);
     221  LoadGraphicFile(CityMapTemplate, HomeDir + 'Graphics\BigCityMap', gfNoGamma);
    222222  CityMapTemplate.PixelFormat := pf8bit;
    223223  SmallCityMapTemplate := TBitmap.Create;
    224   LoadGraphicFile(SmallCityMapTemplate, HomeDir + 'Graphics' + DirectorySeparator + 'SmallCityMap',
     224  LoadGraphicFile(SmallCityMapTemplate, HomeDir + 'Graphics\SmallCityMap',
    225225    gfNoGamma);
    226226  SmallCityMapTemplate.PixelFormat := pf24bit;
     
    447447        line[i, 1] := 0;
    448448        line[i, 2] := gray; // 255-(255-gray) div 2;
    449       end
     449      end;
    450450    end;
    451451
     
    453453    i: integer;
    454454  begin
     455    Offscreen.BeginUpdate;
    455456    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;
    457459  end;
    458460
  • trunk/LocalPlayer/Help.pas

    r21 r28  
    375375      (SystemIconLines + woEiffel div 7) * ySizeBig + dy];
    376376
     377  BigImp.BeginUpdate;
     378  Offscreen.BeginUpdate;
    377379  xSrc := iix mod 7 * xSizeBig;
    378380  ySrc := (iix div 7 + 1) * ySizeBig;
     
    408410          PaintLine[x0 + x, 1] := PaintLine[x0 + x, 1] * sum shr 22;
    409411          PaintLine[x0 + x, 2] := PaintLine[x0 + x, 2] * sum shr 22;
    410         end
    411       end
     412        end;
     413      end;
    412414    end;
     415  Offscreen.EndUpdate;
     416  BigImp.EndUpdate;
    413417end;
    414418
  • trunk/LocalPlayer/IsoEngine.pas

    r21 r28  
    343343  Mask24.Assign(GrExt[HGrTerrain].Mask);
    344344  Mask24.PixelFormat := pf24bit;
     345  Mask24.BeginUpdate;
    345346  for ySrc := 0 to TerrainIconLines - 1 do
    346347  begin
     
    358359            Border := false;
    359360        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
    368392              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;
     409end;
    404410
    405411        procedure Done;
     
    10081014                    1 + 8 * (xxt * 2 + 1),
    10091015                    1 + yyt + 16 * (yyt * 3 + 1), SRCCOPY);
     1016                  Borders.BeginUpdate;
    10101017                  for dy := 0 to yyt * 2 - 1 do
    10111018                  begin
     
    10191026                      end
    10201027                  end;
     1028                  Borders.EndUpdate;
    10211029                  BordersOK := BordersOK or 1 shl p1;
    10221030                end;
     
    13401348            Line: ^TLine;
    13411349          begin
     1350            FOutput.BeginUpdate;
    13421351            for y := y0 to y1 - 1 do
    13431352            begin
     
    13531362              else
    13541363                MakeDark(@Line[x0], x1 - x0);
    1355             end
     1364            end;
     1365            FOutput.EndUpdate;
    13561366          end;
    13571367
  • trunk/LocalPlayer/MessgEx.pas

    r21 r28  
    247247    // prepare screwed icon
    248248    fillchar(Screwed, sizeof(Screwed), 0);
     249    BigImp.BeginUpdate;
    249250    for iy := 0 to 39 do
    250251    begin
     
    278279            Screwed[xDst + dx, yDst + dy, 3] := Screwed[xDst + dx, yDst + dy,
    279280              3] + share;
    280           end
     281          end;
    281282      end;
    282283    end;
     284    BigImp.EndUpdate;
    283285    xb := xBBook;
    284286    yb := yBBook;
  • trunk/LocalPlayer/TechTree.pas

    r20 r28  
    166166
    167167    // texturize background
     168    Image.BeginUpdate;
    168169    TexWidth := Paper.width;
    169170    TexHeight := Paper.height;
     
    176177        if Cardinal((@DstLine[X])^) and $FFFFFF = $7F007F then // transparent
    177178          DstLine[X] := SrcLine[X mod TexWidth];
    178       end
    179     end
     179      end;
     180    end;
     181    Image.EndUpdate;
    180182  end;
    181183
  • trunk/LocalPlayer/Term.pas

    r21 r28  
    437437
    438438{$R *.lfm}
    439 // TODO {$R Res1.res}
     439{TODO {$R Res1.res}
    440440
    441441const
     
    522522  GetMem(resampled, nx * ny * 12);
    523523  FillChar(resampled^, nx * ny * 12, 0);
     524  BigImp.BeginUpdate;
    524525  for ix := 0 to BigImp.width div xSizeBig - 1 do
    525526    for iy := 0 to BigImp.height div ySizeBig - 1 do
     
    553554              inc(resampled[ir + nx + 1, ch], c * (xSizeSmall - xdivider) *
    554555                (ySizeSmall - ydivider));
    555           end
    556         end
     556          end;
     557        end;
    557558      end;
     559  BigImp.EndUpdate;
    558560
    559561  // sharpen resampled icons
    560562  SmallImp.width := nx;
    561563  SmallImp.height := ny;
     564  SmallImp.BeginUpdate;
    562565  for y := 0 to ny - 1 do
    563566  begin
     
    587590      end;
    588591  end;
     592  SmallImp.EndUpdate;
    589593  FreeMem(resampled);
    590594  // smallimp.savetofile(homedir+'smallimp.bmp'); //!!!
     
    40884092    end;
    40894093    MiniLine := nil;
     4094    Mini.BeginUpdate;
    40904095    for y := 0 to G.ly - 1 do
    40914096    begin
     
    41594164            MiniLine[xm, 2] := cm and $FF;
    41604165          end;
    4161         end
    4162     end;
     4166        end;
     4167    end;
     4168    Mini.EndUpdate;
    41634169  end;
    41644170
  • trunk/LocalPlayer/Wonders.pas

    r21 r28  
    157157  Offscreen.Canvas.Font.Assign(UniFont[ftNormal]);
    158158
     159  Offscreen.BeginUpdate;
    159160  xm := ClientWidth div 2;
    160161  ym := ClientHeight div 2;
     
    184185            else
    185186              Line[i][xm - 1 - X][ch] := c;
    186           end
    187     end;
    188   end;
     187          end;
     188    end;
     189  end;
     190  Offscreen.EndUpdate;
    189191
    190192  HaveWonder := false;
  • trunk/ScreenTools.pas

    r21 r28  
    439439  if (Options and gfNoGamma = 0) and (Gamma <> 100) then
    440440  begin
     441    bmp.BeginUpdate;
    441442    FirstLine := bmp.ScanLine[0];
    442443    LastLine := bmp.ScanLine[bmp.Height - 1];
     
    444445      ApplyGamma(pointer(FirstLine), @LastLine[bmp.Width])
    445446    else
    446       ApplyGamma(pointer(LastLine), @FirstLine[bmp.Width])
     447      ApplyGamma(pointer(LastLine), @FirstLine[bmp.Width]);
     448    bmp.EndUpdate;
    447449  end
    448450end;
     
    497499  if (Options and gfNoGamma = 0) and (Gamma <> 100) then
    498500  begin
     501    bmp.BeginUpdate;
    499502    FirstLine := bmp.ScanLine[0];
    500503    LastLine := bmp.ScanLine[bmp.Height - 1];
     
    502505      ApplyGamma(pointer(FirstLine), @LastLine[bmp.Width])
    503506    else
    504       ApplyGamma(pointer(LastLine), @FirstLine[bmp.Width])
     507      ApplyGamma(pointer(LastLine), @FirstLine[bmp.Width]);
     508    bmp.EndUpdate;
    505509  end
    506510end;
     
    546550    GrExt[nGrExt].Mask.Height := Source.Height;
    547551
     552    GrExt[nGrExt].Data.BeginUpdate;
     553    GrExt[nGrExt].Mask.BeginUpdate;
    548554    for y := 0 to Source.Height - 1 do
    549555    begin
     
    570576      end
    571577    end;
     578    GrExt[nGrExt].Data.EndUpdate;
     579    GrExt[nGrExt].Mask.EndUpdate;
    572580
    573581    FillChar(GrExt[nGrExt].pixUsed, GrExt[nGrExt].Data.Height div 49 * 10, 0);
    574     inc(nGrExt)
     582    inc(nGrExt);
    575583  end
    576584end;
     
    602610  i: integer;
    603611begin
     612  dst.BeginUpdate;
    604613  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;
    606616end;
    607617
     
    638648    exit;
    639649
     650  dst.BeginUpdate;
    640651  h := yDst + h;
    641652  while yDst < h do
     
    666677    inc(yDst);
    667678    inc(ySrc);
    668   end
     679  end;
     680  dst.EndUpdate;
    669681end;
    670682
     
    681693  SrcLine, DstLine: ^TLine;
    682694begin
    683   if xDst < 0 then
    684   begin
     695  if xDst < 0 then begin
    685696    w := w + xDst;
    686697    xSrc := xSrc - xDst;
    687698    xDst := 0;
    688699  end;
    689   if yDst < 0 then
    690   begin
     700  if yDst < 0 then begin
    691701    h := h + yDst;
    692702    ySrc := ySrc - yDst;
     
    700710    exit;
    701711
     712  dst.BeginUpdate;
    702713  for iy := 0 to h - 1 do
    703714  begin
     
    732743    end
    733744  end;
     745  dst.EndUpdate;
    734746end;
    735747
     
    746758  Pixel: ^TPixel;
    747759begin
     760  bmp.BeginUpdate;
    748761  assert(bmp.PixelFormat = pf24bit);
    749762  h := y + h;
     
    766779    end;
    767780    inc(y);
    768   end
     781  end;
     782  bmp.EndUpdate;
    769783end;
    770784
     
    884898  DstLine: ^TLine;
    885899begin
     900  dst.BeginUpdate;
    886901  for y := -GlowRange + 1 to Height - 1 + GlowRange - 1 do
    887902  begin
     
    917932            (GlowRange - r)) div (GlowRange - 1);
    918933    end;
    919   end
     934  end;
     935  dst.EndUpdate;
    920936end;
    921937
  • trunk/Start.pas

    r20 r28  
    830830  SetMainTextureByAge(-1);
    831831  List.Font.Color := MainTexture.clMark;
     832  EmptyPicture.BeginUpdate;
     833
    832834  Fill(EmptyPicture.Canvas, 0, 0, 64, 64, (wMaintexture - 64) div 2,
    833835    (hMaintexture - 64) div 2);
     
    843845    end
    844846  end;
     847  EmptyPicture.EndUpdate;
    845848
    846849  Difficulty[0] := Diff0;
     
    10171020    Mini.width := MiniWidth * 2;
    10181021    Mini.height := MiniHeight;
     1022    Mini.BeginUpdate;
    10191023    for y := 0 to MiniHeight - 1 do
    10201024    begin
     
    10331037        end;
    10341038    end;
     1039    Mini.EndUpdate;
    10351040  end;
    10361041
     
    10531058    begin
    10541059      MiniLine := nil;
     1060      Mini.BeginUpdate;
    10551061      for y := 0 to MiniHeight - 1 do
    10561062      begin
     
    10881094            MiniLine[xm, 2] := cm and $FF;
    10891095          end;
    1090       end
     1096        Mini.EndUpdate;
     1097      end;
    10911098    end;
    10921099  end;
Note: See TracChangeset for help on using the changeset viewer.