From 3d7aa7015407cc9da646399271cd9adf5655f551 Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 30 Apr 2001 21:40:33 +0000 Subject: [PATCH] *** empty log message *** --- .../src/lwo/lwoDiscontinuousVertexMap.cxx | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/pandatool/src/lwo/lwoDiscontinuousVertexMap.cxx b/pandatool/src/lwo/lwoDiscontinuousVertexMap.cxx index dc21523174..94b01cad50 100644 --- a/pandatool/src/lwo/lwoDiscontinuousVertexMap.cxx +++ b/pandatool/src/lwo/lwoDiscontinuousVertexMap.cxx @@ -7,6 +7,7 @@ #include "lwoInputFile.h" #include +#include TypeHandle LwoDiscontinuousVertexMap::_type_handle; @@ -79,10 +80,26 @@ read_iff(IffInputFile *in, size_t stop_at) { value.push_back(lin->get_be_float32()); } - bool inserted = _vmad[polygon_index].insert(VMap::value_type(vertex_index, value)).second; - if (!inserted) { - nout << "Duplicate pair " << polygon_index << ", " << vertex_index - << " in map.\n"; + VMap &vmap = _vmad[polygon_index]; + pair ir = + vmap.insert(VMap::value_type(vertex_index, value)); + if (!ir.second) { + // This polygon/vertex pair was repeated in the vmad. Is it + // simply redundant, or is it contradictory? + PTA_float orig_value = (*ir.first).second; + + if (value.v() != orig_value.v()) { + nout << "Multiple UV values for vertex " << vertex_index + << " of polygon " << polygon_index + << " specified by discontinuous vertex map.\n" + << "Original value = "; + copy(orig_value.begin(), orig_value.end(), + ostream_iterator(nout, " ")); + nout << " new value = "; + copy(value.begin(), value.end(), + ostream_iterator(nout, " ")); + nout << "\n"; + } } }