- Timestamp:
- Jan 13, 2017, 6:51:27 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/BaseWin.pas
r40 r60 191 191 SmartInvalidate; 192 192 if ImmUpdate then 193 Update 194 end 193 Update; 194 end; 195 195 end; 196 196 -
trunk/LocalPlayer/CityScreen.pas
r52 r60 6 6 uses 7 7 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; 12 10 13 11 const … … 237 235 procedure TCityDlg.FormDestroy(Sender: TObject); 238 236 begin 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); 246 244 end; 247 245 … … 352 350 procedure TCityDlg.InitZoomCityMap; 353 351 begin 352 // TODO: FillRect should not be needed as BitBlt is with SRCCOPY 353 ZoomCityMap.Canvas.FillRect(0, 0, ZoomCityMap.Width, ZoomCityMap.Height); 354 354 355 bitblt(ZoomCityMap.Canvas.Handle, 0, 0, wZoomMap, hZoomMap, 355 356 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 359 359 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 363 362 ImageOp_B(ZoomCityMap, CityMapTemplate, 0, 0, 376 * SizeClass + 216, 364 363 112 * (ZoomArea - 3), wZoomMap - wZoomEnvironment, hZoomMap); -
trunk/Protocol.pas
r59 r60 1196 1196 mcLine = 26; 1197 1197 mcFirstNonCap = mcNav; 1198 AutoFeature: 1199 Set of mcFirstNonCap .. nFeature - 1 = [mcNav, mcSE, mcNP, mcJet,mcAcademy];1198 AutoFeature: set of mcFirstNonCap .. nFeature - 1 = [mcNav, mcSE, mcNP, mcJet, 1199 mcAcademy]; 1200 1200 // unit class advances, automatically applied if available 1201 1201 1202 Feature: 1203 array [0 .. nFeature - 1] of { unit model features } 1202 Feature: array [0 .. nFeature - 1] of { unit model features } 1204 1203 record Domains, Preq, Weight, Cost: integer; 1205 1204 end … … 1232 1231 (Domains: 7; Preq: adMassProduction; Weight: 0; Cost: 0)); { mcLine } 1233 1232 1234 WeightPreq7: 1235 array [0 .. nDomains - 1] of integer = (adHorsebackRiding, adSeafaring, 1233 WeightPreq7: array [0 .. nDomains - 1] of integer = (adHorsebackRiding, adSeafaring, 1236 1234 adAdvancedFlight); 1237 WeightPreq10: 1238 array [0 .. nDomains - 1] of integer = (adAutomobile, adSteel, preNA); 1235 WeightPreq10: array [0 .. nDomains - 1] of integer = (adAutomobile, adSteel, preNA); 1239 1236 1240 1237 INFIN = 999999; … … 1333 1330 Exp, { micro experience, the level is Exp div ExpCost } 1334 1331 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 1338 1337 SavedStatus: LongInt; // for server internal use only 1339 1338 Owner, // last known owner, even if not alive anymore! … … 1398 1397 1399 1398 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, 1402 1404 ProdRep, Trade, PollRep, Corruption, Tax, Lux, Science, Support, Eaten, 1403 1405 ProdCost, Storage, Deployed: integer; … … 1432 1434 TGetCityData = record 1433 1435 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; 1436 1441 end; 1437 1442 … … 1461 1466 Ship1Change, Ship2Change: array [0 .. nShipPart - 1] of integer; 1462 1467 end; 1463 TOffer = record nDeliver, nCost: integer; 1468 TOffer = record 1469 nDeliver, nCost: integer; 1464 1470 Price: array [0 .. 11] of Cardinal; 1465 1471 end; … … 1627 1633 1628 1634 procedure MakeUnitInfo(p: integer; const u: TUn; var ui: TUnitInfo); 1629 1630 1631 1635 procedure MakeModelInfo(p, mix: integer; const m: TModel; var mi: TModelInfo); 1636 function IsSameModel(const mi1, mi2: TModelInfo): boolean; 1637 function SpecialTile(Loc, TerrType, lx: integer): integer; 1632 1638 1633 1639 implementation -
trunk/ScreenTools.pas
r52 r60 653 653 // X channel = background amp (old Dst content), 128=original brightness 654 654 var 655 i, Brightness, test: integer; 655 X, Y: Integer; 656 Brightness, test: integer; 656 657 PixelSrc: ^Byte; 657 658 PixelDst: PPixel32; 658 659 begin 659 {TODO assert(Src.PixelFormat = pf8bit);}660 assert(dst.PixelFormat = pf24bit);660 //TODO Assert(Src.PixelFormat = pf8bit); 661 Assert(dst.PixelFormat = pf24bit); 661 662 if xDst < 0 then 662 663 begin … … 680 681 dst.BeginUpdate; 681 682 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 689 687 Brightness := PixelSrc^; 690 688 test := (PixelDst^.R * Brightness) shr 7; … … 700 698 PixelDst^.B := test; // Blue 701 699 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; 706 702 end; 707 703 src.EndUpdate;
Note:
See TracChangeset
for help on using the changeset viewer.