Skip to content

Commit

Permalink
CHANGED mapview to cap complete view at specified render height
Browse files Browse the repository at this point in the history
UPDATED debug renderer to draw collision information instead of bbox
  • Loading branch information
ksterker committed Jun 20, 2010
1 parent ac42ece commit 42cd99f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
16 changes: 8 additions & 8 deletions src/world/mapview.cc
Expand Up @@ -249,12 +249,12 @@ void mapview::draw (const s_int16 & x, const s_int16 & y, const gfx::drawing_are
if ((*i)->Min.z() > zn->max().z())
{
// object inside zone boundaries? --> discard
if (!((*i)->Max.x() < zn->min().x() || (*i)->Min.x() > zn->max().x() ||
(*i)->Max.y() < zn->min().y() || (*i)->Min.y() > zn->max().y()))
{
// if (!((*i)->Max.x() < zn->min().x() || (*i)->Min.x() > zn->max().x() ||
// (*i)->Max.y() < zn->min().y() || (*i)->Min.y() > zn->max().y()))
// {
i = objectlist.erase (i);
continue;
}
// }
}
i++;
}
Expand All @@ -272,11 +272,11 @@ void mapview::draw (const s_int16 & x, const s_int16 & y, const gfx::drawing_are
if ((*i)->Min.z() > (*zn)->max().z())
{
// object inside zone boundaries? --> discard
if (!((*i)->Max.x() < (*zn)->min().x() || (*i)->Min.x() > (*zn)->max().x() ||
(*i)->Max.y() < (*zn)->min().y() || (*i)->Min.y() > (*zn)->max().y()))
{
// if (!((*i)->Max.x() < (*zn)->min().x() || (*i)->Min.x() > (*zn)->max().x() ||
// (*i)->Max.y() < (*zn)->min().y() || (*i)->Min.y() > (*zn)->max().y()))
// {
continue;
}
// }
}

discard = false;
Expand Down
11 changes: 9 additions & 2 deletions src/world/renderer.cc
Expand Up @@ -350,8 +350,15 @@ void debug_renderer::draw (const s_int16 & x, const s_int16 & y, const render_in

if (DrawBBox)
{
cube3 bbox (obj.Shape->length(), obj.Shape->width(), obj.Shape->height());
bbox.draw (x + obj.x(), y + obj.y() - obj.z(), &da, target);
// draw detailed collision information
for (std::vector<world::cube3*>::const_iterator i = obj.Shape->begin(); i != obj.Shape->end(); i++)
{
(*i)->draw (x + obj.Pos.x(), y + obj.Pos.y() - obj.Pos.z(), &da, target);
}

// draw complete bbox around placeable
// cube3 bbox (obj.Shape->length(), obj.Shape->width(), obj.Shape->height());
// bbox.draw (x + obj.x(), y + obj.y() - obj.z(), &da, target);
}

if (Print)
Expand Down

0 comments on commit 42cd99f

Please sign in to comment.