mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
better assertions
This commit is contained in:
parent
4683c4c3c5
commit
fd51c9b27e
@ -566,6 +566,10 @@ template<class Element>
|
|||||||
INLINE void PointerToArray<Element>::
|
INLINE void PointerToArray<Element>::
|
||||||
set_subdata(size_type n, size_type count, const string &data) {
|
set_subdata(size_type n, size_type count, const string &data) {
|
||||||
nassertv((data.length() % sizeof(Element)) == 0);
|
nassertv((data.length() % sizeof(Element)) == 0);
|
||||||
|
nassertv(n <= size() && n + count <= size());
|
||||||
|
nassertd((this->_void_ptr) != NULL) {
|
||||||
|
((PointerToArray<Element> *)this)->reassign(new ReferenceCountedVector<Element>(_type_handle));
|
||||||
|
}
|
||||||
size_type ncount = data.length() / sizeof(Element);
|
size_type ncount = data.length() / sizeof(Element);
|
||||||
if (ncount < count) {
|
if (ncount < count) {
|
||||||
// Reduce the array.
|
// Reduce the array.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user