Guest User

Untitled

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