diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2017-11-06 19:58:41 +0000 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2017-11-06 19:58:41 +0000 |
commit | bdd1b10cb8d6c405de58031e1de57c7f2b24225f (patch) | |
tree | 93f08e73ca4b34b23e8bd1fbde422848eba9d7bb /src/world.cpp | |
parent | 6a82d04e2b5edffc32df44aa46d6cf60428c7b44 (diff) |
Introduce cmodels and cflags.
Diffstat (limited to 'src/world.cpp')
-rw-r--r-- | src/world.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/world.cpp b/src/world.cpp index 9a504c3..d9789ad 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -80,13 +80,13 @@ void world_t::generate(sector_t *sector, sector_index_t index, bool partial) } } -bool world_t::find_path(v2f_t src, v2f_t dst, rectf_t size, entity_t *ignore, +bool world_t::find_path(v2f_t src, v2f_t dst, cmodel_t *cmodel, entity_t *ignore, std::list<v2f_t> *path) { path_finder_t finder; rectf_t bounds; - finder.setup_nodes(src, dst); + finder.setup_nodes(src, dst, cmodel->cflags); for (size_t y = 0; y < finder.height; y++) for (size_t x = 0; x < finder.width; x++) { @@ -101,7 +101,7 @@ bool world_t::find_path(v2f_t src, v2f_t dst, rectf_t size, entity_t *ignore, for (entity_t *ent : get_entities(bounds)) if (ent != ignore) - finder.eliminate_nodes(ent->bounds); + finder.eliminate_nodes(ent->cmodel); if (!finder.find()) return false; @@ -181,7 +181,7 @@ std::list<entity_t*> world_t::get_entities(rectf_t rect) if (ent->cookie == cookie) continue; - if (!(rect && ent->bounds)) + if (!(rect && ent->cmodel.bounds)) continue; ent->cookie = cookie; @@ -235,7 +235,7 @@ void entity_t::link(world_t *world) float xlip, ylip; size_t xsecs, ysecs; - total_bounds = bounds | render_bounds; + total_bounds = cmodel.bounds | render_bounds; fx = floor(total_bounds[0][0]); fy = floor(total_bounds[0][1]); |