git-svn-id: svn://db.shs.com.ru/libs@636 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -274,7 +274,6 @@ void Scene::removeMaterial(Material * m) {
|
||||
if (o->material_ == m)
|
||||
o->setMaterial(0);
|
||||
materials.removeAll(m);
|
||||
materials_used.remove(m);
|
||||
changed_materials.removeAll(m);
|
||||
mat_changed = true;
|
||||
}
|
||||
@@ -388,9 +387,10 @@ void Scene::prepareTree(ObjectBase * o) {
|
||||
foreach (ObjectBase * co, o->children_) {
|
||||
if (co->isHidden()) continue;
|
||||
switch (co->type_) {
|
||||
case ObjectBase::glLight:
|
||||
lights_used << globject_cast<Light * >(co);
|
||||
break;
|
||||
case ObjectBase::glLight: {
|
||||
Light * l = globject_cast<Light * >(co);
|
||||
lights_used[l->light_type] << l;
|
||||
} break;
|
||||
case ObjectBase::glMesh:
|
||||
if (co->mesh()) {
|
||||
geometries_used[co->mesh()] << co;
|
||||
@@ -427,15 +427,7 @@ bool Scene::prepare() {
|
||||
lights_used.clear();
|
||||
prepareTree(root_);
|
||||
}
|
||||
if (mat_changed) {
|
||||
mat_changed = false;
|
||||
materials_used.clear();
|
||||
foreach (ObjectBase * o, aol) {
|
||||
Material * m = o->material();
|
||||
if (!m) continue;
|
||||
materials_used << m;
|
||||
}
|
||||
}
|
||||
mat_changed = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user