Changeset 10 for trunk/Database.pas
- Timestamp:
- Jan 7, 2017, 2:33:20 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Database.pas
r9 r10 79 79 TVicinity21Loc = array [0 .. 27] of integer; 80 80 81 procedure MaskD(var x ; Count, Mask: Cardinal);81 procedure MaskD(var x: array of Cardinal; Count, Mask: Cardinal); 82 82 procedure IntServer(Command, Player, Subject: integer; var Data); 83 83 procedure CompactLists(p: integer); … … 171 171 UnBuilt: array [0 .. nPl - 1] of integer; { number of units built } 172 172 173 procedure MaskD(var x; Count, Mask: Cardinal); 174 begin 175 { TODO 176 sub eax,4 177 @r: and [eax+edx*4],ecx 178 dec edx 179 jnz @r 180 } 173 procedure MaskD(var x: array of Cardinal; Count, Mask: Cardinal); 174 var 175 I: Integer; 176 begin 177 for I := 0 to Count - 1 do 178 x[I] := x[I] and Mask; 181 179 end; 182 180 … … 1659 1657 RealMap[Loc1]:=RealMap[Loc1] or fPoll; } 1660 1658 1661 FillChar(Occupant, MapSize, -1);1659 FillChar(Occupant, MapSize, Byte(-1)); 1662 1660 FillChar(ZoCMap, MapSize, 0); 1663 1661 FillChar(ObserveLevel, MapSize * 4, 0); 1664 FillChar(UsedByCity, MapSize * 4, -1);1662 FillChar(UsedByCity, MapSize * 4, Byte(-1)); 1665 1663 GTestFlags := 0; 1666 1664 GInitialized := GAlive or GWatching; … … 1681 1679 GetMem(Map, 4 * MapSize); 1682 1680 GetMem(MapObservedLast, 2 * MapSize); 1683 FillChar(MapObservedLast^, 2 * MapSize, -1);1681 FillChar(MapObservedLast^, 2 * MapSize, Byte(-1)); 1684 1682 GetMem(Territory, MapSize); 1685 1683 FillChar(Territory^, MapSize, $FF); … … 1708 1706 GetMem(EnemyReport[p1], SizeOf(TEnemyReport) - 2 * 1709 1707 (INFIN + 1 - nmmax)); 1710 FillChar(EnemyReport[p1].Tech, nAdv, tsNA);1708 FillChar(EnemyReport[p1].Tech, nAdv, Byte(tsNA)); 1711 1709 EnemyReport[p1].TurnOfContact := -1; 1712 1710 EnemyReport[p1].TurnOfCivilReport := -1; … … 1731 1729 for Loc1 := 0 to MapSize - 1 do 1732 1730 Map[Loc1] := fUNKNOWN; 1733 FillChar(Tech, nAdv, tsNA);1731 FillChar(Tech, nAdv, Byte(tsNA)); 1734 1732 FillChar(NatBuilt, SizeOf(NatBuilt), 0); 1735 1733 end; … … 1820 1818 begin 1821 1819 CalculatePrimitive; 1822 FillChar(Occupant, MapSize, -1);1820 FillChar(Occupant, MapSize, Byte(-1)); 1823 1821 FillChar(ObserveLevel, MapSize * 4, 0); 1824 1822 with RW[0] do … … 1827 1825 GetMem(Map, 4 * MapSize); 1828 1826 GetMem(MapObservedLast, 2 * MapSize); 1829 FillChar(MapObservedLast^, 2 * MapSize, -1);1827 FillChar(MapObservedLast^, 2 * MapSize, Byte(-1)); 1830 1828 GetMem(Territory, MapSize); 1831 1829 FillChar(Territory^, MapSize, $FF); … … 2693 2691 if Mode = moLoading_Fast then 2694 2692 exit; 2695 MaskD(RW[p].Map^, MapSize, not Cardinal(fInEnemyZoC));2693 MaskD(RW[p].Map^, MapSize, Cardinal(not Cardinal(fInEnemyZoC))); 2696 2694 ObserveMask := 3 shl (2 * p); 2697 2695 for Loc := 0 to MapSize - 1 do … … 2721 2719 if Mode <> moPlaying then 2722 2720 exit; 2723 MaskD(RW[p].Map^, MapSize, not Cardinal(fPeace));2721 MaskD(RW[p].Map^, MapSize, Cardinal(not Cardinal(fPeace))); 2724 2722 for p1 := -1 to nPl - 1 do 2725 2723 PeacePlayer[p1] := (p1 >= 0) and (p1 <> p) and (1 shl p1 and GAlive <> 0) … … 2829 2827 end; 2830 2828 2831 FillChar(Country, MapSize, -1);2829 FillChar(Country, MapSize, Byte(-1)); 2832 2830 for Loc := 0 to MapSize - 1 do 2833 2831 Dist[Loc] := CountryRadius + 1;
Note:
See TracChangeset
for help on using the changeset viewer.