Changeset 60 for trunk


Ignore:
Timestamp:
Jan 13, 2017, 6:51:27 PM (8 years ago)
Author:
chronos
Message:
  • Fixed: City mini map was drawn incorrectly.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/BaseWin.pas

    r40 r60  
    191191    SmartInvalidate;
    192192    if ImmUpdate then
    193       Update
    194   end
     193      Update;
     194  end;
    195195end;
    196196
  • trunk/LocalPlayer/CityScreen.pas

    r52 r60  
    66uses
    77  Protocol, ClientTools, Term, ScreenTools, IsoEngine, BaseWin,
    8 
    9   LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls,
    10   ButtonA,
    11   ButtonB, ButtonBase, ButtonC, Area;
     8  LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls,
     9  ButtonA, ButtonC, Area;
    1210
    1311const
     
    237235procedure TCityDlg.FormDestroy(Sender: TObject);
    238236begin
    239   AreaMap.Free;
    240   SmallCityMap.Free;
    241   ZoomCityMap.Free;
    242   SmallCityMapTemplate.Free;
    243   CityMapTemplate.Free;
    244   Template.Free;
    245   Back.Free;
     237  FreeAndNil(AreaMap);
     238  FreeAndNil(SmallCityMap);
     239  FreeAndNil(ZoomCityMap);
     240  FreeAndNil(SmallCityMapTemplate);
     241  FreeAndNil(CityMapTemplate);
     242  FreeAndNil(Template);
     243  FreeAndNil(Back);
    246244end;
    247245
     
    352350procedure TCityDlg.InitZoomCityMap;
    353351begin
     352  // TODO: FillRect should not be needed as BitBlt is with SRCCOPY
     353  ZoomCityMap.Canvas.FillRect(0, 0, ZoomCityMap.Width, ZoomCityMap.Height);
     354
    354355  bitblt(ZoomCityMap.Canvas.Handle, 0, 0, wZoomMap, hZoomMap,
    355356    Back.Canvas.Handle, xZoomMap, yZoomMap, SRCCOPY);
    356   if Mode = mImp then
    357   begin
    358     if ZoomArea < 3 then
     357  if Mode = mImp then begin
     358    if ZoomArea < 3 then begin
    359359      ImageOp_B(ZoomCityMap, CityMapTemplate, 0, 0, 376 * SizeClass,
    360         112 * ZoomArea, wZoomMap, hZoomMap)
    361     else
    362     begin
     360        112 * ZoomArea, wZoomMap, hZoomMap);
     361    end else begin
    363362      ImageOp_B(ZoomCityMap, CityMapTemplate, 0, 0, 376 * SizeClass + 216,
    364363        112 * (ZoomArea - 3), wZoomMap - wZoomEnvironment, hZoomMap);
  • trunk/Protocol.pas

    r59 r60  
    11961196mcLine = 26;
    11971197mcFirstNonCap = mcNav;
    1198 AutoFeature:
    1199 Set of mcFirstNonCap .. nFeature - 1 = [mcNav, mcSE, mcNP, mcJet, mcAcademy];
     1198AutoFeature: set of mcFirstNonCap .. nFeature - 1 = [mcNav, mcSE, mcNP, mcJet,
     1199  mcAcademy];
    12001200// unit class advances, automatically applied if available
    12011201
    1202 Feature:
    1203 array [0 .. nFeature - 1] of { unit model features }
     1202Feature: array [0 .. nFeature - 1] of { unit model features }
    12041203  record Domains, Preq, Weight, Cost: integer;
    12051204end
     
    12321231  (Domains: 7; Preq: adMassProduction; Weight: 0; Cost: 0)); { mcLine }
    12331232
    1234 WeightPreq7:
    1235 array [0 .. nDomains - 1] of integer = (adHorsebackRiding, adSeafaring,
     1233WeightPreq7: array [0 .. nDomains - 1] of integer = (adHorsebackRiding, adSeafaring,
    12361234  adAdvancedFlight);
    1237 WeightPreq10:
    1238 array [0 .. nDomains - 1] of integer = (adAutomobile, adSteel, preNA);
     1235WeightPreq10: array [0 .. nDomains - 1] of integer = (adAutomobile, adSteel, preNA);
    12391236
    12401237INFIN = 999999;
     
    13331330    Exp, { micro experience, the level is Exp div ExpCost }
    13341331    Load: Byte; { number of transported units }
    1335     Flags: word end;
    1336 
    1337     TCityInfo = packed record Loc, Status, // free for AI use
     1332    Flags: word;
     1333  end;
     1334
     1335  TCityInfo = packed record
     1336    Loc, Status, // free for AI use
    13381337    SavedStatus: LongInt; // for server internal use only
    13391338    Owner, // last known owner, even if not alive anymore!
     
    13981397
    13991398  TTileInfo = record
    1400     Food, Prod, Trade, ExplCity: integer end;
    1401     TCityReport = record HypoTiles, HypoTax, HypoLux, Working, Happy, FoodRep,
     1399    Food, Prod, Trade, ExplCity: integer;
     1400  end;
     1401
     1402  TCityReport = record
     1403    HypoTiles, HypoTax, HypoLux, Working, Happy, FoodRep,
    14021404      ProdRep, Trade, PollRep, Corruption, Tax, Lux, Science, Support, Eaten,
    14031405      ProdCost, Storage, Deployed: integer;
     
    14321434  TGetCityData = record
    14331435    Owner: integer;
    1434     c: TCity end;
    1435     TCityAreaInfo = record Available: array [0 .. 26] of integer;
     1436    c: TCity;
     1437  end;
     1438
     1439  TCityAreaInfo = record
     1440    Available: array [0 .. 26] of integer;
    14361441  end;
    14371442
     
    14611466    Ship1Change, Ship2Change: array [0 .. nShipPart - 1] of integer;
    14621467  end;
    1463   TOffer = record nDeliver, nCost: integer;
     1468  TOffer = record
     1469    nDeliver, nCost: integer;
    14641470    Price: array [0 .. 11] of Cardinal;
    14651471  end;
     
    16271633
    16281634procedure MakeUnitInfo(p: integer; const u: TUn; var ui: TUnitInfo);
    1629   procedure MakeModelInfo(p, mix: integer; const m: TModel; var mi: TModelInfo);
    1630     function IsSameModel(const mi1, mi2: TModelInfo): boolean;
    1631       function SpecialTile(Loc, TerrType, lx: integer): integer;
     1635procedure MakeModelInfo(p, mix: integer; const m: TModel; var mi: TModelInfo);
     1636function IsSameModel(const mi1, mi2: TModelInfo): boolean;
     1637function SpecialTile(Loc, TerrType, lx: integer): integer;
    16321638
    16331639implementation
  • trunk/ScreenTools.pas

    r52 r60  
    653653// X channel = background amp (old Dst content), 128=original brightness
    654654var
    655   i, Brightness, test: integer;
     655  X, Y: Integer;
     656  Brightness, test: integer;
    656657  PixelSrc: ^Byte;
    657658  PixelDst: PPixel32;
    658659begin
    659   {TODO assert(Src.PixelFormat = pf8bit);}
    660   assert(dst.PixelFormat = pf24bit);
     660  //TODO Assert(Src.PixelFormat = pf8bit);
     661  Assert(dst.PixelFormat = pf24bit);
    661662  if xDst < 0 then
    662663  begin
     
    680681  dst.BeginUpdate;
    681682  Src.BeginUpdate;
    682   h := yDst + h;
    683   while yDst < h do
    684   begin
    685     PixelDst := GetBitmapPixelPtr(dst, xDst, yDst);
    686     PixelSrc := Src.ScanLine[ySrc] + xSrc;
    687     for i := 0 to w - 1 do
    688     begin
     683  for Y := 0 to h - 1 do begin
     684    PixelDst := GetBitmapPixelPtr(dst, xDst, yDst + Y);
     685    PixelSrc := Pointer(GetBitmapPixelPtr(Src, xSrc, ySrc + Y));
     686    for X := 0 to w - 1 do begin
    689687      Brightness := PixelSrc^;
    690688      test := (PixelDst^.R * Brightness) shr 7;
     
    700698        PixelDst^.B := test; // Blue
    701699      PixelDst := Pointer(PixelDst) + (Dst.RawImage.Description.BitsPerPixel shr 3);
    702       PixelSrc := Pointer(PixelSrc) + 1;
    703     end;
    704     inc(yDst);
    705     inc(ySrc);
     700      PixelSrc := Pointer(PixelSrc) + (Src.RawImage.Description.BitsPerPixel shr 3);
     701    end;
    706702  end;
    707703  src.EndUpdate;
Note: See TracChangeset for help on using the changeset viewer.