Guest User

Untitled

a guest
Jul 22nd, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.40 KB | None | 0 0
  1. # HG changeset patch
  2. # Date 1469211265 -7200
  3. #      Fri Jul 22 20:14:25 2016 +0200
  4. # Branch trunk
  5. # Node ID 1bc7ffda36094e997958d816f114ca52084b2c0e
  6. # Parent  43b291b24c055bb2274f5358a8f75706d5eb290a
  7. Fix: Prevent hidden industries from overlaping and hiding visible ones.
  8. Change: When drawing the smallmap in 'Industries' view, give highest priority to industries to preven them from being overlapped.
  9.  
  10. diff -r 43b291b24c05 -r 1bc7ffda3609 src/smallmap_gui.cpp
  11. --- a/src/smallmap_gui.cpp  Mon Jul 18 17:45:36 2016 +0000
  12. +++ b/src/smallmap_gui.cpp  Fri Jul 22 20:14:25 2016 +0200
  13. @@ -463,18 +463,6 @@
  14.   */
  15.  static inline uint32 GetSmallMapIndustriesPixels(TileIndex tile, TileType t)
  16.  {
  17. -   if (t == MP_INDUSTRY) {
  18. -       /* If industry is allowed to be seen, use its colour on the map */
  19. -       IndustryType type = Industry::GetByTile(tile)->type;
  20. -       if (_legend_from_industries[_industry_to_list_pos[type]].show_on_map &&
  21. -               (_smallmap_industry_highlight_state || type != _smallmap_industry_highlight)) {
  22. -           return (type == _smallmap_industry_highlight ? PC_WHITE : GetIndustrySpec(Industry::GetByTile(tile)->type)->map_colour) * 0x01010101;
  23. -       } else {
  24. -           /* Otherwise, return the colour which will make it disappear */
  25. -           t = (IsTileOnWater(tile) ? MP_WATER : MP_CLEAR);
  26. -       }
  27. -   }
  28. -
  29.     const SmallMapColourScheme *cs = &_heightmap_schemes[_settings_client.gui.smallmap_land_colour];
  30.     return ApplyMask(_smallmap_show_heightmap ? cs->height_colours[TileHeight(tile)] : cs->default_colour, &_smallmap_vehicles_andor[t]);
  31.  }
  32. @@ -755,6 +743,22 @@
  33.  
  34.     TILE_AREA_LOOP(ti, ta) {
  35.         TileType ttype = GetEffectiveTileType(ti);
  36. +
  37. +       /* Special handling of industries while in "Industries" smallmap view. */
  38. +       if (ttype == MP_INDUSTRY && this->map_type == SMT_INDUSTRY) {
  39. +           /* If industry is allowed to be seen, use its colour on the map */
  40. +           IndustryType type = Industry::GetByTile(ti)->type;
  41. +           if (_legend_from_industries[_industry_to_list_pos[type]].show_on_map) {
  42. +               if (type == _smallmap_industry_highlight) {
  43. +                   if (_smallmap_industry_highlight_state) return MKCOLOUR_XXXX(PC_WHITE);
  44. +               } else {
  45. +                   return GetIndustrySpec(type)->map_colour * 0x01010101;
  46. +               }
  47. +           }
  48. +           /* Otherwise make it disappear */
  49. +           ttype = IsTileOnWater(ti) ? MP_WATER : MP_CLEAR;
  50. +       }
  51. +
  52.         if (_tiletype_importance[ttype] > importance) {
  53.             importance = _tiletype_importance[ttype];
  54.             tile = ti;
Add Comment
Please, Sign In to add comment