changed_usage_hint()

This commit is contained in:
David Rose 2005-04-15 21:58:39 +00:00
parent 417b89318e
commit fba33cb9cf
7 changed files with 34 additions and 6 deletions

View File

@ -66,6 +66,17 @@ changed_size() const {
return get_data_size_bytes() != _data->get_data_size_bytes();
}
////////////////////////////////////////////////////////////////////
// Function: IndexBufferContext::changed_usage_hint
// Access: Public
// Description: Returns true if the data has changed its usage hint
// since the last time mark_loaded() was called.
////////////////////////////////////////////////////////////////////
INLINE bool IndexBufferContext::
changed_usage_hint() const {
return _usage_hint != _data->get_usage_hint();
}
////////////////////////////////////////////////////////////////////
// Function: IndexBufferContext::was_modified
// Access: Public
@ -87,5 +98,6 @@ was_modified() const {
INLINE void IndexBufferContext::
mark_loaded() {
_data_size_bytes = _data->get_data_size_bytes();
_usage_hint = _data->get_usage_hint();
_modified = _data->get_modified();
}

View File

@ -44,6 +44,7 @@ public:
INLINE int get_data_size_bytes() const;
INLINE bool changed_size() const;
INLINE bool changed_usage_hint() const;
INLINE bool was_modified() const;
INLINE void mark_loaded();
@ -55,6 +56,7 @@ private:
qpGeomPrimitive *_data;
UpdateSeq _modified;
int _data_size_bytes;
qpGeomEnums::UsageHint _usage_hint;
public:
static TypeHandle get_class_type() {

View File

@ -199,8 +199,8 @@ PUBLISHED:
};
ostream &operator << (ostream &out, qpGeomEnums::NumericType numeric_type);
ostream &operator << (ostream &out, qpGeomEnums::Contents contents);
EXPCL_PANDA ostream &operator << (ostream &out, qpGeomEnums::NumericType numeric_type);
EXPCL_PANDA ostream &operator << (ostream &out, qpGeomEnums::Contents contents);
#endif

View File

@ -404,9 +404,9 @@ inc_pointer() {
nassertr(_pointer < _pointer_end, empty_buffer);
if (_vertex_data != (const qpGeomVertexData *)NULL){
const qpGeomVertexArrayData *array_data = _vertex_data->get_array(_array);
nassertr(_pointer >= array_data->get_data() && _pointer < array_data->get_data() + array_data->get_data_size_bytes(), empty_buffer);
nassertr(_pointer >= array_data->get_data().p() && _pointer < array_data->get_data().p() + array_data->get_data_size_bytes(), empty_buffer);
} else {
nassertr(_pointer >= _array_data->get_data() && _pointer < _array_data->get_data() + _array_data->get_data_size_bytes(), empty_buffer);
nassertr(_pointer >= _array_data->get_data().p() && _pointer < _array_data->get_data().p() + _array_data->get_data_size_bytes(), empty_buffer);
}
#endif

View File

@ -709,9 +709,9 @@ inc_pointer() {
nassertr(_pointer < _pointer_end, empty_buffer);
if (_vertex_data != (qpGeomVertexData *)NULL){
const qpGeomVertexArrayData *array_data = _vertex_data->get_array(_array);
nassertr(_pointer >= array_data->get_data() && _pointer < array_data->get_data() + array_data->get_data_size_bytes(), empty_buffer);
nassertr(_pointer >= array_data->get_data().p() && _pointer < array_data->get_data().p() + array_data->get_data_size_bytes(), empty_buffer);
} else {
nassertr(_pointer >= _array_data->get_data() && _pointer < _array_data->get_data() + _array_data->get_data_size_bytes(), empty_buffer);
nassertr(_pointer >= _array_data->get_data().p() && _pointer < _array_data->get_data().p() + _array_data->get_data_size_bytes(), empty_buffer);
}
#endif

View File

@ -66,6 +66,17 @@ changed_size() const {
return get_data_size_bytes() != _data->get_data_size_bytes();
}
////////////////////////////////////////////////////////////////////
// Function: VertexBufferContext::changed_usage_hint
// Access: Public
// Description: Returns true if the data has changed its usage hint
// since the last time mark_loaded() was called.
////////////////////////////////////////////////////////////////////
INLINE bool VertexBufferContext::
changed_usage_hint() const {
return _usage_hint != _data->get_usage_hint();
}
////////////////////////////////////////////////////////////////////
// Function: VertexBufferContext::was_modified
// Access: Public
@ -87,5 +98,6 @@ was_modified() const {
INLINE void VertexBufferContext::
mark_loaded() {
_data_size_bytes = _data->get_data_size_bytes();
_usage_hint = _data->get_usage_hint();
_modified = _data->get_modified();
}

View File

@ -44,6 +44,7 @@ public:
INLINE int get_data_size_bytes() const;
INLINE bool changed_size() const;
INLINE bool changed_usage_hint() const;
INLINE bool was_modified() const;
INLINE void mark_loaded();
@ -55,6 +56,7 @@ private:
qpGeomVertexArrayData *_data;
UpdateSeq _modified;
int _data_size_bytes;
qpGeomEnums::UsageHint _usage_hint;
public:
static TypeHandle get_class_type() {