This looks good indeed. However, they look a bit like they are floating
above water. Is it possible to put their roots in the water, like
player/monster feet?
Also, maybe a few ones could still be on dry land.

2011/1/1 Jude Brown <bookofj...@users.sourceforge.net>

>       via  65f0ce5894dccc8294ddb6b8cd7cdbc108b00be3 (commit)
>      from  aad09a6bfb86ede2837eb0e515fe1b1e74352c44 (commit)
>
> -----------------------------------------------------------------------
> commit 65f0ce5894dccc8294ddb6b8cd7cdbc108b00be3
> Author: Jude Brown <bookofj...@users.sourceforge.net>
> Date:   Sat Jan 1 20:45:24 2011 +1000
>
>    Make Swamp prettier. (Tiles)
>
>    Adds a new member to the packed_cell called swamp_tree_water. This
>    boolean value triggers the following behaviour:
>
>    1. Trees in Swamp are drawn on top of TILE_DNGN_SHALLOW_WATER. The
>       reasoning here is that trees, when destroyed, are replaced by shallow
>       water. It does look a *lot* better, in my opinion, to have the water
>       underneath them.
>    2. The boolean value is stored for DNGN_TREE, DNGN_SHALLOW_WATER and
>       DNGN_DEEP_WATER in the Swamp. This value is then passed into the
>       wave/shore packing functions and is used to suppress shore overlays.
>
>    All in all, I'm very happy with the result.
>
>    I think Swamp could have further improvements by changing the tree tile
>    to be a large mangrove tile instead. The current tree looks great in the
>    dungeon, but the large amount of them in Swamp combined with the
>    background (previously floor, currently shallow water) makes them look
>    very sparse.
>
> -----------------------------------------------------------------------
>
> Summary of changes:
>  crawl-ref/source/tiledgnbuf.cc |   48
> ++++++++++++++++++++++++++-------------
>  crawl-ref/source/tiledgnbuf.h  |    7 ++++-
>  crawl-ref/source/tileview.cc   |   10 ++++++++
>  3 files changed, 47 insertions(+), 18 deletions(-)
>
> diff --git a/crawl-ref/source/tiledgnbuf.cc
> b/crawl-ref/source/tiledgnbuf.cc
> index 9fb91a2..af05377 100644
> --- a/crawl-ref/source/tiledgnbuf.cc
> +++ b/crawl-ref/source/tiledgnbuf.cc
> @@ -33,6 +33,7 @@ void packed_cell::clear ()
>     is_haloed = false;
>     is_moldy = false;
>     is_sanctuary = false;
> +    swamp_tree_water = false;
>  }
>
>  DungeonCellBuffer::DungeonCellBuffer(ImageManager *im) :
> @@ -393,49 +394,61 @@ static dungeon_feature_type _safe_feat(coord_def gc)
>     return (env.map_knowledge(gc).feat());
>  }
>
> -static bool _is_seen_land(coord_def gc)
> +static bool _is_seen_land(coord_def gc, bool swamp_trees)
>  {
> -    dungeon_feature_type feat = _safe_feat(gc);
> +    const dungeon_feature_type feat = _safe_feat(gc);
> +    if (swamp_trees && feat == DNGN_TREE)
> +        return (false);
> +
>     return (feat != DNGN_UNSEEN && !feat_is_water(feat) && feat !=
> DNGN_LAVA);
>  }
>
> -static bool _is_seen_shallow(coord_def gc)
> +static bool _is_seen_shallow(coord_def gc, bool swamp_trees)
>  {
> -    return (_safe_feat(gc) == DNGN_SHALLOW_WATER);
> +    const dungeon_feature_type feat = _safe_feat(gc);
> +    if (swamp_trees && feat == DNGN_TREE)
> +        return (true);
> +
> +    return (feat == DNGN_SHALLOW_WATER);
>  }
>
>  static void _pack_default_waves(const coord_def &gc, packed_cell *cell)
>  {
>     // Any tile on water with an adjacent solid tile will get an extra
>     // bit of shoreline.
> -    const dungeon_feature_type feat = env.map_knowledge(gc).feat();
> +    dungeon_feature_type feat = env.map_knowledge(gc).feat();
> +
> +    // Treat trees in Swamp as though they were shallow water.
> +    if (cell->swamp_tree_water && feat == DNGN_TREE)
> +        feat = DNGN_SHALLOW_WATER;
> +
>     if (!feat_is_water(feat) && feat != DNGN_LAVA || env.grid_colours(gc))
>         return;
>
>     if (feat == DNGN_DEEP_WATER)
>     {
> -        if (_is_seen_shallow(coord_def(gc.x, gc.y - 1)))
> +        if (_is_seen_shallow(coord_def(gc.x, gc.y - 1),
> cell->swamp_tree_water))
>             _add_overlay(TILE_DNGN_WAVE_N, cell);
> -        if (_is_seen_shallow(coord_def(gc.x + 1, gc.y - 1)))
> +        if (_is_seen_shallow(coord_def(gc.x + 1, gc.y - 1),
> cell->swamp_tree_water))
>             _add_overlay(TILE_DNGN_WAVE_NE, cell);
> -        if (_is_seen_shallow(coord_def(gc.x + 1, gc.y)))
> +        if (_is_seen_shallow(coord_def(gc.x + 1, gc.y),
> cell->swamp_tree_water))
>             _add_overlay(TILE_DNGN_WAVE_E, cell);
> -        if (_is_seen_shallow(coord_def(gc.x + 1, gc.y + 1)))
> +        if (_is_seen_shallow(coord_def(gc.x + 1, gc.y + 1),
> cell->swamp_tree_water))
>             _add_overlay(TILE_DNGN_WAVE_SE, cell);
> -        if (_is_seen_shallow(coord_def(gc.x, gc.y + 1)))
> +        if (_is_seen_shallow(coord_def(gc.x, gc.y + 1),
> cell->swamp_tree_water))
>             _add_overlay(TILE_DNGN_WAVE_S, cell);
> -        if (_is_seen_shallow(coord_def(gc.x - 1, gc.y + 1)))
> +        if (_is_seen_shallow(coord_def(gc.x - 1, gc.y + 1),
> cell->swamp_tree_water))
>             _add_overlay(TILE_DNGN_WAVE_SW, cell);
> -        if (_is_seen_shallow(coord_def(gc.x - 1, gc.y)))
> +        if (_is_seen_shallow(coord_def(gc.x - 1, gc.y),
> cell->swamp_tree_water))
>             _add_overlay(TILE_DNGN_WAVE_W, cell);
> -        if (_is_seen_shallow(coord_def(gc.x - 1, gc.y - 1)))
> +        if (_is_seen_shallow(coord_def(gc.x - 1, gc.y - 1),
> cell->swamp_tree_water))
>             _add_overlay(TILE_DNGN_WAVE_NW, cell);
>     }
>
>
> -    bool north = _is_seen_land(coord_def(gc.x, gc.y - 1));
> -    bool west  = _is_seen_land(coord_def(gc.x - 1, gc.y));
> -    bool east  = _is_seen_land(coord_def(gc.x + 1, gc.y));
> +    bool north = _is_seen_land(coord_def(gc.x, gc.y - 1),
> cell->swamp_tree_water);
> +    bool west  = _is_seen_land(coord_def(gc.x - 1, gc.y),
> cell->swamp_tree_water);
> +    bool east  = _is_seen_land(coord_def(gc.x + 1, gc.y),
> cell->swamp_tree_water);
>
>     if (north || west || east)
>     {
> @@ -510,6 +523,9 @@ void DungeonCellBuffer::pack_background(int x, int y,
> const packed_cell &cell)
>     const tileidx_t bg = cell.bg;
>     const tileidx_t bg_idx = cell.bg & TILE_FLAG_MASK;
>
> +    if (cell.swamp_tree_water && bg_idx > TILE_DNGN_UNSEEN)
> +        m_buf_feat.add(TILE_DNGN_SHALLOW_WATER, x, y);
> +
>     if (bg_idx >= TILE_DNGN_WAX_WALL)
>         add_dngn_tile(cell.flv.floor, x, y);
>
> diff --git a/crawl-ref/source/tiledgnbuf.h b/crawl-ref/source/tiledgnbuf.h
> index 062f8cc..46f322c 100644
> --- a/crawl-ref/source/tiledgnbuf.h
> +++ b/crawl-ref/source/tiledgnbuf.h
> @@ -25,9 +25,11 @@ struct packed_cell
>     bool is_haloed;
>     bool is_moldy;
>     bool is_sanctuary;
> +    bool swamp_tree_water;
>
>     packed_cell() : num_dngn_overlay(0), is_bloody(false),
> is_silenced(false),
> -                    is_haloed(false), is_moldy(false), is_sanctuary(false)
> {}
> +                    is_haloed(false), is_moldy(false),
> is_sanctuary(false),
> +                    swamp_tree_water (false) {}
>
>     packed_cell(const packed_cell* c) :
> num_dngn_overlay(c->num_dngn_overlay),
>                                         fg(c->fg), bg(c->bg), flv(c->flv),
> @@ -35,7 +37,8 @@ struct packed_cell
>                                         is_silenced(c->is_silenced),
>                                         is_haloed(c->is_haloed),
>                                         is_moldy(c->is_moldy),
> -                                        is_sanctuary(c->is_sanctuary) {}
> +                                        is_sanctuary(c->is_sanctuary),
> +
>  swamp_tree_water(c->swamp_tree_water) {}
>
>     void clear ();
>  };
> diff --git a/crawl-ref/source/tileview.cc b/crawl-ref/source/tileview.cc
> index 51318c2..40f383c 100644
> --- a/crawl-ref/source/tileview.cc
> +++ b/crawl-ref/source/tileview.cc
> @@ -1017,6 +1017,16 @@ void tile_apply_properties(const coord_def &gc,
> packed_cell &cell)
>
>     if (silenced(gc))
>         cell.is_silenced = true;
> +
> +    // In the Swamp, draw water underneath the trees. As trees are
> +    // replaced by water when destroyed, this matches in thematically.
> +    // This is applied to all DNGN_TREE, DNGN_SHALLOW_WATER and
> DNGN_DEEP_WATER
> +    // to allow for waves.
> +    if (player_in_branch(BRANCH_SWAMP) && (grd(gc) == DNGN_TREE
> +        || feat_is_water(grd(gc))))
> +    {
> +        cell.swamp_tree_water = true;
> +    }
>  }
>
>  void tile_clear_map(const coord_def& gc)
>
> --
> Dungeon Crawl Stone Soup
>
>
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment,
> and,
> should the need arise, upgrade to a full multi-node Oracle RAC database
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> Crawl-ref-commits mailing list
> crawl-ref-comm...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/crawl-ref-commits
>
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Crawl-ref-discuss mailing list
Crawl-ref-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/crawl-ref-discuss

Reply via email to