Ignore:
Timestamp:
Mar 25, 2021, 2:09:42 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Use enumeration type for MapOptions and game options.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/IsoEngine.pas

    r326 r327  
    6666  end;
    6767
    68 const
    69   // options switched by buttons
    70   moPolitical = 0;
    71   moCityNames = 1;
    72   moGreatWall = 4;
    73   moGrid = 5;
    74   moBareTerrain = 6;
    75 
    76   // other options
    77   moEditMode = 16;
    78   moLocCodes = 17;
    79 
    8068var
    8169  NoMap: TIsoMap;
    82   Options: Integer;
     70  MapOptions: TMapOptions;
    8371  pDebugMap: Integer; // -1 for off
    8472
     
    1004992  begin
    1005993    BehindCityInfo.Loc := Loc - 2 * G.lx;
    1006     if ShowCityNames and (Options and (1 shl moEditMode) = 0) and
     994    if ShowCityNames and not (moEditMode in MapOptions) and
    1007995      (BehindCityInfo.Loc >= 0) and (BehindCityInfo.Loc < G.lx * G.ly) and
    1008996      (MyMap[BehindCityInfo.Loc] and fCity <> 0) then
     
    10251013  procedure ShowSpacePort;
    10261014  begin
    1027     if ShowObjects and (Options and (1 shl moEditMode) = 0) and
     1015    if ShowObjects and not (moEditMode in MapOptions) and
    10281016      (Tile and fCity <> 0) and (CityInfo.Flags and ciSpacePort <> 0) then
    10291017      TSprite(x + xxt, y - 6, spSpacePort);
     
    10931081  else
    10941082    Tile := MyMap[Loc];
    1095   if ShowObjects and (Options and (1 shl moEditMode) = 0) and
     1083  if ShowObjects and not (moEditMode in MapOptions) and
    10961084    (Tile and fCity <> 0) then
    10971085    GetCityInfo(Loc, cix, CityInfo);
     
    11481136    TSprite(x, y, spMinerals + (Tile shr 25 and 3) * TerrainIconCols);
    11491137
    1150   if Options and (1 shl moEditMode) <> 0 then
     1138  if moEditMode in MapOptions then
    11511139    fog := (Loc < 0) or (Loc >= G.lx * G.ly)
    11521140    // else if CityLoc>=0 then
     
    11821170  end;
    11831171{$ENDIF}
    1184   if Options and (1 shl moEditMode) <> 0 then
     1172  if moEditMode in MapOptions then
    11851173  begin
    11861174    if Tile and fPrefStartPos <> 0 then
     
    14271415begin
    14281416  FoW := true;
    1429   ShowLoc := Options and (1 shl moLocCodes) <> 0;
     1417  ShowLoc := moLocCodes in MapOptions;
    14301418  ShowDebug := pDebugMap >= 0;
    1431   ShowObjects := (CityOwner >= 0) or (Options and (1 shl moBareTerrain) = 0);
     1419  ShowObjects := (CityOwner >= 0) or not (moBareTerrain in MapOptions);
    14321420  ShowCityNames := ShowObjects and (CityOwner < 0) and
    1433     (Options and (1 shl moCityNames) <> 0);
     1421    (moCityNames in MapOptions);
    14341422  ShowBorder := true;
    14351423  ShowMyBorder := CityOwner < 0;
    1436   ShowGrWall := (CityOwner < 0) and (Options and (1 shl moGreatWall) <> 0);
     1424  ShowGrWall := (CityOwner < 0) and (moGreatWall in MapOptions);
    14371425  if ShowDebug then
    14381426    Server(sGetDebugMap, me, pDebugMap, DebugMap)
     
    16221610  else
    16231611  begin
    1624     if ShowLoc or (Options and (1 shl moEditMode) <> 0) or
    1625       (Options and (1 shl moGrid) <> 0) then
     1612    if ShowLoc or (moEditMode in MapOptions) or
     1613      (moGrid in MapOptions) then
    16261614      PaintGrid(x, y, nx, ny);
    16271615    for dy := -2 to ny + 1 do
Note: See TracChangeset for help on using the changeset viewer.