Skip to content

Commit

Permalink
Fix: Linked shapes drawables.
Browse files Browse the repository at this point in the history
  • Loading branch information
logzero committed Jan 24, 2012
1 parent 210d8fd commit 66d88c2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/car.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,25 +207,22 @@ struct LoadBody
SCENENODE & topnode;
keyed_container<SCENENODE>::handle & bodynode;
LoadDrawable & loadDrawable;
bool damage;

LoadBody(
SCENENODE & topnode,
keyed_container<SCENENODE>::handle & bodynode,
LoadDrawable & loadDrawable,
bool damage) :
LoadDrawable & loadDrawable) :
topnode(topnode),
bodynode(bodynode),
loadDrawable(loadDrawable),
damage(damage)
loadDrawable(loadDrawable)
{
// ctor
}

bool operator()(const PTree & cfg)
{
const PTree * link;
if (damage && cfg.get("link", link))
if (cfg.get("link", link))
{
// load breakable body drawables
if (!loadDrawable(cfg, topnode)) return false;
Expand Down Expand Up @@ -545,7 +542,7 @@ bool CAR::LoadGraphics(
}

// load drawables
LoadBody loadBody(topnode, bodynode, loadDrawable, damage);
LoadBody loadBody(topnode, bodynode, loadDrawable);
for (PTree::const_iterator i = cfg.begin(); i != cfg.end(); ++i)
{
if (i->first != "body" &&
Expand Down

0 comments on commit 66d88c2

Please sign in to comment.