From b3fd81d53e5fdbb4486351ddb17edf6650d6eeed Mon Sep 17 00:00:00 2001 From: David Rose Date: Sat, 22 Nov 2003 20:59:00 +0000 Subject: [PATCH] fix assertion failure when texture is no longer used --- pandatool/src/palettizer/omitReason.cxx | 3 +++ pandatool/src/palettizer/omitReason.h | 4 ++++ pandatool/src/palettizer/texturePlacement.cxx | 7 ++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/pandatool/src/palettizer/omitReason.cxx b/pandatool/src/palettizer/omitReason.cxx index 70c720e10a..675c6f8763 100644 --- a/pandatool/src/palettizer/omitReason.cxx +++ b/pandatool/src/palettizer/omitReason.cxx @@ -41,6 +41,9 @@ operator << (ostream &out, OmitReason omit) { case OR_unknown: return out << "unknown"; + + case OR_unused: + return out << "unused"; } return out << "**invalid**(" << (int)omit << ")"; diff --git a/pandatool/src/palettizer/omitReason.h b/pandatool/src/palettizer/omitReason.h index 3df5526d7a..a2d8883e2f 100644 --- a/pandatool/src/palettizer/omitReason.h +++ b/pandatool/src/palettizer/omitReason.h @@ -49,6 +49,10 @@ enum OmitReason { OR_unknown, // The texture file cannot be read, so its size can't be determined. + + OR_unused, + // The texture is no longer used by any of the egg files that + // formerly referenced it. }; ostream &operator << (ostream &out, OmitReason omit); diff --git a/pandatool/src/palettizer/texturePlacement.cxx b/pandatool/src/palettizer/texturePlacement.cxx index 4d976c57e9..4e94a4891d 100644 --- a/pandatool/src/palettizer/texturePlacement.cxx +++ b/pandatool/src/palettizer/texturePlacement.cxx @@ -282,7 +282,12 @@ determine_size() { } } - nassertr(_has_uvs, false); + if (!_has_uvs) { + force_replace(); + _omit_reason = OR_unused; + return false; + } + TexCoordd rounded_min_uv = min_uv; TexCoordd rounded_max_uv = max_uv;