SGCloudField::addCloud does *not* keep a reference to SGNewCloud - so we
only need a temporary object. Also adapt to changed addCloud interface
to make things a little more obvious.
double bottom_shade = cld_def->getDoubleValue("bottom-shade", 1.0);
string texture = cld_def->getStringValue("texture", "cu.png");
- SGNewCloud *cld =
- new SGNewCloud(type,
+ SGNewCloud cld =
+ SGNewCloud(type,
texture_root,
texture,
min_width,
num_sprites,
num_textures_x,
num_textures_y);
- layer->addCloud(newpos, cld);
+ layer->addCloud(newpos, cld.genCloud());
}
}
}