diff --git a/src/osgPlugins/lwo/Block.cpp b/src/osgPlugins/lwo/Block.cpp index 800a257fe..4c13bd576 100644 --- a/src/osgPlugins/lwo/Block.cpp +++ b/src/osgPlugins/lwo/Block.cpp @@ -56,8 +56,8 @@ void Block::compile(const lwo2::FORM::SURF::BLOK *blok) read_common_attributes(imap->block_attributes); // read imagemap-related attributes - for (iff::Chunk_list::const_iterator i=blok->attributes.begin(); i!=blok->attributes.end(); ++i) { - const lwo2::FORM::SURF::BLOK::IMAP::TMAP *tmap = dynamic_cast(*i); + for (iff::Chunk_list::const_iterator bi=blok->attributes.begin(); bi!=blok->attributes.end(); ++bi) { + const lwo2::FORM::SURF::BLOK::IMAP::TMAP *tmap = dynamic_cast(*bi); if (tmap) { Texture_mapping mapping; for (iff::Chunk_list::const_iterator i=tmap->attributes.begin(); i!=tmap->attributes.end(); ++i) { @@ -81,43 +81,43 @@ void Block::compile(const lwo2::FORM::SURF::BLOK *blok) imap_.mapping = mapping; } - const lwo2::FORM::SURF::BLOK::IMAP::PROJ *proj = dynamic_cast(*i); + const lwo2::FORM::SURF::BLOK::IMAP::PROJ *proj = dynamic_cast(*bi); if (proj) { imap_.projection = static_cast(proj->projection_mode); } - const lwo2::FORM::SURF::BLOK::IMAP::AXIS *axis = dynamic_cast(*i); + const lwo2::FORM::SURF::BLOK::IMAP::AXIS *axis = dynamic_cast(*bi); if (axis) { imap_.axis = static_cast(axis->texture_axis); } - const lwo2::FORM::SURF::BLOK::IMAP::IMAG *imag = dynamic_cast(*i); + const lwo2::FORM::SURF::BLOK::IMAP::IMAG *imag = dynamic_cast(*bi); if (imag) { imap_.image_map = imag->texture_image.index; } - const lwo2::FORM::SURF::BLOK::IMAP::WRAP *wrap = dynamic_cast(*i); + const lwo2::FORM::SURF::BLOK::IMAP::WRAP *wrap = dynamic_cast(*bi); if (wrap) { imap_.width_wrap = static_cast(wrap->width_wrap); imap_.height_wrap = static_cast(wrap->height_wrap); } - const lwo2::FORM::SURF::BLOK::IMAP::WRPW *wrpw = dynamic_cast(*i); + const lwo2::FORM::SURF::BLOK::IMAP::WRPW *wrpw = dynamic_cast(*bi); if (wrpw) { imap_.wrap_amount_w = wrpw->cycles.fraction; } - const lwo2::FORM::SURF::BLOK::IMAP::WRPH *wrph = dynamic_cast(*i); + const lwo2::FORM::SURF::BLOK::IMAP::WRPH *wrph = dynamic_cast(*bi); if (wrph) { imap_.wrap_amount_h = wrph->cycles.fraction; } - const lwo2::FORM::SURF::BLOK::IMAP::VMAP *vmap = dynamic_cast(*i); + const lwo2::FORM::SURF::BLOK::IMAP::VMAP *vmap = dynamic_cast(*bi); if (vmap) { imap_.uv_map = vmap->txuv_map_name; } - const lwo2::FORM::SURF::BLOK::IMAP::TAMP *tamp = dynamic_cast(*i); + const lwo2::FORM::SURF::BLOK::IMAP::TAMP *tamp = dynamic_cast(*bi); if (tamp) { imap_.texture_amplitude = tamp->amplitude.fraction; } diff --git a/src/osgPlugins/lwo/Object.cpp b/src/osgPlugins/lwo/Object.cpp index 34cdbfd1f..bb2bdbce7 100644 --- a/src/osgPlugins/lwo/Object.cpp +++ b/src/osgPlugins/lwo/Object.cpp @@ -106,9 +106,9 @@ void Object::parse(const iff::Chunk_list &data) Layer current_layer; - for (iff::Chunk_list::const_iterator i=data.begin(); i!=data.end(); ++i) { + for (iff::Chunk_list::const_iterator di=data.begin(); di!=data.end(); ++di) { - const lwo2::FORM::LAYR *layr = dynamic_cast(*i); + const lwo2::FORM::LAYR *layr = dynamic_cast(*di); if (layr) { if (!current_layer.units().empty() || current_layer.get_layer_chunk()) { layers_[current_layer.number()] = current_layer; @@ -117,7 +117,7 @@ void Object::parse(const iff::Chunk_list &data) current_layer.units().clear(); } - const lwo2::FORM::PNTS *pnts = dynamic_cast(*i); + const lwo2::FORM::PNTS *pnts = dynamic_cast(*di); if (pnts) { Unit new_unit; for (lwo2::FORM::PNTS::Point_list::const_iterator i=pnts->point_location.begin(); i!=pnts->point_location.end(); ++i) { @@ -127,7 +127,7 @@ void Object::parse(const iff::Chunk_list &data) current_layer.units().push_back(new_unit); } - const lwo2::FORM::VMAP *vmap = dynamic_cast(*i); + const lwo2::FORM::VMAP *vmap = dynamic_cast(*di); if (vmap && !current_layer.units().empty()) { std::string type(vmap->type.id, 4); if (type == "WGHT") { @@ -202,7 +202,7 @@ void Object::parse(const iff::Chunk_list &data) } } - const lwo2::FORM::POLS *pols = dynamic_cast(*i); + const lwo2::FORM::POLS *pols = dynamic_cast(*di); if (pols && !current_layer.units().empty()) { std::string type(pols->type.id, 4); if (type != "FACE") { @@ -240,12 +240,12 @@ void Object::parse(const iff::Chunk_list &data) } } - const lwo2::FORM::TAGS *tags = dynamic_cast(*i); + const lwo2::FORM::TAGS *tags = dynamic_cast(*di); if (tags) { tag_strings = tags->tag_string; } - const lwo2::FORM::PTAG *ptag = dynamic_cast(*i); + const lwo2::FORM::PTAG *ptag = dynamic_cast(*di); if (ptag && !current_layer.units().empty()) { std::string type(ptag->type.id, 4); if (type == "SURF") { @@ -265,7 +265,7 @@ void Object::parse(const iff::Chunk_list &data) } } - const lwo2::FORM::VMAD *vmad = dynamic_cast(*i); + const lwo2::FORM::VMAD *vmad = dynamic_cast(*di); if (vmad && !current_layer.units().empty()) { std::string type(vmad->type.id, 4); if (type == "WGHT") { @@ -310,12 +310,12 @@ void Object::parse(const iff::Chunk_list &data) } } - const lwo2::FORM::DESC *desc = dynamic_cast(*i); + const lwo2::FORM::DESC *desc = dynamic_cast(*di); if (desc) { description_ = desc->description_line; } - const lwo2::FORM::TEXT *text = dynamic_cast(*i); + const lwo2::FORM::TEXT *text = dynamic_cast(*di); if (text) { comment_ = text->comment; } @@ -338,13 +338,13 @@ void Object::generate_normals() void Object::generate_auto_texture_maps() { - for (Surface_map::iterator i=surfaces_.begin(); i!=surfaces_.end(); ++i) { - for (Surface::Block_map::iterator j=i->second.blocks().begin(); j!=i->second.blocks().end(); ++j) { + for (Surface_map::iterator si=surfaces_.begin(); si!=surfaces_.end(); ++si) { + for (Surface::Block_map::iterator j=si->second.blocks().begin(); j!=si->second.blocks().end(); ++j) { Block &block = j->second; if (block.get_type() == "IMAP") { if (block.get_image_map().projection == Image_map::UV) continue; - Image_map::Axis_type axis = block.get_image_map().axis; + Image_map::Axis_type image_axis = block.get_image_map().axis; std::ostringstream oss; oss << "Auto_map_" << █ @@ -416,7 +416,7 @@ void Object::generate_auto_texture_maps() osg::Vec2 uv; if (block.get_image_map().projection == Image_map::PLANAR) { - switch (axis) { + switch (image_axis) { case Image_map::X: uv.set(P.z(), P.y()); break; case Image_map::Y: uv.set(P.x(), P.z()); break; case Image_map::Z: uv.set(P.x(), P.y()); break; @@ -426,7 +426,7 @@ void Object::generate_auto_texture_maps() } if (block.get_image_map().projection == Image_map::CYLINDRICAL) { - switch (axis) { + switch (image_axis) { case Image_map::X: uv.set(cylindrical_angle(-P.z(), -P.y()), P.x()); break; case Image_map::Y: uv.set(cylindrical_angle(P.x(), P.z()), P.y()); break; case Image_map::Z: uv.set(cylindrical_angle(P.x(), -P.y()), P.z()); break; @@ -439,7 +439,7 @@ void Object::generate_auto_texture_maps() if (block.get_image_map().projection == Image_map::SPHERICAL) { float r = P.length(); if (r != 0) { - switch (axis) { + switch (image_axis) { case Image_map::X: uv.set(cylindrical_angle(-P.z(), -P.y()), (asinf(P.x()/r) + osg::PI_2) / osg::PI); break; case Image_map::Y: uv.set(cylindrical_angle(P.x(), P.z()), (asinf(P.y()/r) + osg::PI_2) / osg::PI); break; case Image_map::Z: uv.set(cylindrical_angle(P.x(), -P.y()), (asinf(P.z()/r) + osg::PI_2) / osg::PI); break; diff --git a/src/osgPlugins/lwo/ReaderWriterLWO.cpp b/src/osgPlugins/lwo/ReaderWriterLWO.cpp index 537f4e9b8..16f58e938 100644 --- a/src/osgPlugins/lwo/ReaderWriterLWO.cpp +++ b/src/osgPlugins/lwo/ReaderWriterLWO.cpp @@ -73,7 +73,7 @@ public: if (result.success()) return result; if (!options || options->getOptionString() != "USE_OLD_READER") { - ReadResult result = readNode_LWO2(fileName, local_opt.get()); + result = readNode_LWO2(fileName, local_opt.get()); if (result.success()) return result; } diff --git a/src/osgPlugins/lwo/Surface.cpp b/src/osgPlugins/lwo/Surface.cpp index 698dd1538..9f485b83f 100644 --- a/src/osgPlugins/lwo/Surface.cpp +++ b/src/osgPlugins/lwo/Surface.cpp @@ -288,8 +288,8 @@ osg::Group *Surface::apply(osg::Geometry *geo, const VertexMap_map *texture_maps geo->setStateSet(stateset_.get()); int unit = 0; - for (Block_map::const_iterator i=blocks_.begin(); i!=blocks_.end(); ++i) { - const Block &block = i->second; + for (Block_map::const_iterator bi=blocks_.begin(); bi!=blocks_.end(); ++bi) { + const Block &block = bi->second; if (block.get_type() == "IMAP" && block.get_channel() == "COLR" && block.get_image_map().clip) { std::string image_file = block.get_image_map().clip->get_still_filename(); if (!image_file.empty()) { diff --git a/src/osgPlugins/lwo/Unit.cpp b/src/osgPlugins/lwo/Unit.cpp index e6d88ff3e..d5143a9ac 100644 --- a/src/osgPlugins/lwo/Unit.cpp +++ b/src/osgPlugins/lwo/Unit.cpp @@ -105,8 +105,6 @@ void Unit::flatten_maps() flatten_map(*i, i->local_normals(), normals_.get()); i->local_normals()->clear(); - VertexMap_map::const_iterator j; - // flatten weight maps while (!i->weight_maps()->empty()) { VertexMap_map::iterator j = i->weight_maps()->begin(); diff --git a/src/osgPlugins/lwo/old_Lwo2Layer.cpp b/src/osgPlugins/lwo/old_Lwo2Layer.cpp index dcdd0ac85..3fd53a944 100644 --- a/src/osgPlugins/lwo/old_Lwo2Layer.cpp +++ b/src/osgPlugins/lwo/old_Lwo2Layer.cpp @@ -317,7 +317,7 @@ Lwo2Layer::_find_triangle_fan(PolygonsList& polygons, PolygonsList& triangle_fan c = d; while ((next_polygon_index = _find_triangle_begins_with(polygons, a, c)) >= 0) { - PointData d = polygons[next_polygon_index][2]; + d = polygons[next_polygon_index][2]; point_list.push_back(d); // delete next triangle (mark as deleted) @@ -374,7 +374,7 @@ Lwo2Layer::_find_triangle_strip(PolygonsList& polygons, PolygonsList& triangle_s while ((next_polygon_index = _find_triangle_begins_with(polygons, strip_a, strip_b)) >= 0) { - PointData d = polygons[next_polygon_index][2]; + d = polygons[next_polygon_index][2]; point_list.push_back(d); if (current_strip_a)