fix assertion failure when texture is no longer used

This commit is contained in:
David Rose 2003-11-22 20:59:00 +00:00
parent 7398f2bfa2
commit b3fd81d53e
3 changed files with 13 additions and 1 deletions

View File

@ -41,6 +41,9 @@ operator << (ostream &out, OmitReason omit) {
case OR_unknown: case OR_unknown:
return out << "unknown"; return out << "unknown";
case OR_unused:
return out << "unused";
} }
return out << "**invalid**(" << (int)omit << ")"; return out << "**invalid**(" << (int)omit << ")";

View File

@ -49,6 +49,10 @@ enum OmitReason {
OR_unknown, OR_unknown,
// The texture file cannot be read, so its size can't be determined. // 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); ostream &operator << (ostream &out, OmitReason omit);

View File

@ -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_min_uv = min_uv;
TexCoordd rounded_max_uv = max_uv; TexCoordd rounded_max_uv = max_uv;