mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 07:48:37 -04:00
gobj: Assert instead of crash when printing unresolved GV(A)D
This commit is contained in:
parent
79dae16a2c
commit
60f3ac5163
@ -59,8 +59,10 @@ ALLOC_DELETED_CHAIN_DEF(GeomVertexArrayDataHandle);
|
||||
* file.
|
||||
*/
|
||||
GeomVertexArrayData::
|
||||
GeomVertexArrayData() : SimpleLruPage(0) {
|
||||
_contexts = nullptr;
|
||||
GeomVertexArrayData() :
|
||||
SimpleLruPage(0),
|
||||
_array_format(nullptr),
|
||||
_contexts(nullptr) {
|
||||
|
||||
// Can't put it in the LRU until it has been read in and made valid.
|
||||
}
|
||||
@ -180,7 +182,8 @@ set_usage_hint(GeomVertexArrayData::UsageHint usage_hint) {
|
||||
*/
|
||||
void GeomVertexArrayData::
|
||||
output(std::ostream &out) const {
|
||||
out << get_num_rows() << " rows: " << *get_array_format();
|
||||
nassertv(_array_format != nullptr);
|
||||
out << get_num_rows() << " rows: " << *_array_format;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -188,6 +191,7 @@ output(std::ostream &out) const {
|
||||
*/
|
||||
void GeomVertexArrayData::
|
||||
write(std::ostream &out, int indent_level) const {
|
||||
nassertv(_array_format != nullptr);
|
||||
_array_format->write_with_data(out, indent_level, this);
|
||||
}
|
||||
|
||||
|
@ -582,6 +582,7 @@ CacheEntry(GeomVertexData *source, CacheKey &&key) noexcept :
|
||||
*/
|
||||
INLINE GeomVertexData::CData::
|
||||
CData() :
|
||||
_format(nullptr),
|
||||
_usage_hint(UH_unspecified)
|
||||
{
|
||||
}
|
||||
|
@ -1268,7 +1268,9 @@ output(ostream &out) const {
|
||||
if (!get_name().empty()) {
|
||||
out << get_name() << " ";
|
||||
}
|
||||
out << get_num_rows() << " rows: " << *get_format();
|
||||
const GeomVertexFormat *format = get_format();
|
||||
nassertv(format != nullptr);
|
||||
out << get_num_rows() << " rows: " << *format;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1279,8 +1281,15 @@ write(ostream &out, int indent_level) const {
|
||||
if (!get_name().empty()) {
|
||||
indent(out, indent_level) << get_name() << "\n";
|
||||
}
|
||||
get_format()->write_with_data(out, indent_level + 2, this);
|
||||
CPT(TransformBlendTable) table = get_transform_blend_table();
|
||||
CPT(TransformBlendTable) table;
|
||||
const GeomVertexFormat *format = nullptr;
|
||||
{
|
||||
CDReader cdata(_cycler);
|
||||
format = cdata->_format;
|
||||
table = cdata->_transform_blend_table.get_read_pointer();
|
||||
}
|
||||
nassertv(format != nullptr);
|
||||
format->write_with_data(out, indent_level + 2, this);
|
||||
if (table != nullptr) {
|
||||
indent(out, indent_level)
|
||||
<< "Transform blend table:\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user