mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 07:48:37 -04:00
Merge branch 'release/1.10.x' into master
This commit is contained in:
commit
1c37522026
@ -99,8 +99,9 @@ Flock AIWorld::get_flock(unsigned int flock_id) {
|
|||||||
return *_flock_pool[i];
|
return *_flock_pool[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Flock *null_flock = nullptr;
|
static Flock null_flock(0, 0.0, 0.0, 0, 0, 0);
|
||||||
return *null_flock;
|
nassertr(false, null_flock);
|
||||||
|
return null_flock;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -348,7 +348,7 @@ check_for_constructor(CPPScope *current_scope, CPPScope *global_scope) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CPPFunctionType *func = _type->as_function_type();
|
CPPFunctionType *func = _type->as_function_type();
|
||||||
if (func != nullptr) {
|
if (func != nullptr && scope != nullptr) {
|
||||||
string method_name = get_local_name(scope);
|
string method_name = get_local_name(scope);
|
||||||
string class_name = scope->get_local_name();
|
string class_name = scope->get_local_name();
|
||||||
|
|
||||||
|
@ -485,9 +485,9 @@ sync() {
|
|||||||
size_t n = pptr() - pbase();
|
size_t n = pptr() - pbase();
|
||||||
write_chars(pbase(), n);
|
write_chars(pbase(), n);
|
||||||
pbump(-(int)n);
|
pbump(-(int)n);
|
||||||
|
_dest->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
_dest->flush();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2280,8 +2280,6 @@ read_index() {
|
|||||||
read_cert_special = true;
|
read_cert_special = true;
|
||||||
} else {
|
} else {
|
||||||
_subfiles.push_back(subfile);
|
_subfiles.push_back(subfile);
|
||||||
}
|
|
||||||
if (!subfile->is_cert_special()) {
|
|
||||||
if (bytes_skipped != 0) {
|
if (bytes_skipped != 0) {
|
||||||
// If the index entries don't follow exactly sequentially (except for
|
// If the index entries don't follow exactly sequentially (except for
|
||||||
// the cert special files), the file ought to be repacked.
|
// the cert special files), the file ought to be repacked.
|
||||||
|
@ -267,9 +267,9 @@ sync() {
|
|||||||
size_t n = pptr() - pbase();
|
size_t n = pptr() - pbase();
|
||||||
write_chars(pbase(), n, Z_SYNC_FLUSH);
|
write_chars(pbase(), n, Z_SYNC_FLUSH);
|
||||||
pbump(-(int)n);
|
pbump(-(int)n);
|
||||||
|
_dest->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
_dest->flush();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -551,8 +551,8 @@ get_format_string(bool pad) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Synthesize the format string.
|
// Synthesize the format string.
|
||||||
char *fmt = (char*) malloc(row_size + 1);
|
char *fmt = (char *)alloca(row_size + 1);
|
||||||
memset((void*) fmt, 0, row_size + 1);
|
memset((void *)fmt, 0, row_size + 1);
|
||||||
int fi = 0;
|
int fi = 0;
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
|
|
||||||
@ -566,6 +566,7 @@ get_format_string(bool pad) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
char fmt_code = 'x';
|
char fmt_code = 'x';
|
||||||
|
int num_components = column->get_num_components();
|
||||||
switch (column->get_numeric_type()) {
|
switch (column->get_numeric_type()) {
|
||||||
case NT_uint8:
|
case NT_uint8:
|
||||||
fmt_code = 'B';
|
fmt_code = 'B';
|
||||||
@ -578,6 +579,7 @@ get_format_string(bool pad) const {
|
|||||||
case NT_uint32:
|
case NT_uint32:
|
||||||
case NT_packed_dcba:
|
case NT_packed_dcba:
|
||||||
case NT_packed_dabc:
|
case NT_packed_dabc:
|
||||||
|
case NT_packed_ufloat:
|
||||||
fmt_code = 'I';
|
fmt_code = 'I';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -604,22 +606,21 @@ get_format_string(bool pad) const {
|
|||||||
default:
|
default:
|
||||||
gobj_cat.error()
|
gobj_cat.error()
|
||||||
<< "Unknown numeric type " << column->get_numeric_type() << "!\n";
|
<< "Unknown numeric type " << column->get_numeric_type() << "!\n";
|
||||||
return nullptr;
|
num_components *= column->get_component_bytes();
|
||||||
}
|
}
|
||||||
memset((void*) (fmt + fi), fmt_code, column->get_num_components());
|
memset((void*) (fmt + fi), fmt_code, num_components);
|
||||||
offset += column->get_total_bytes();
|
offset += column->get_total_bytes();
|
||||||
fi += column->get_num_components();
|
fi += num_components;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (offset < row_size) {
|
if (offset < row_size) {
|
||||||
// Add padding bytes.
|
// Add padding bytes.
|
||||||
int pad = row_size - offset;
|
int pad = row_size - offset;
|
||||||
memset((void*) (fmt + fi), 'x', pad);
|
memset((void *)(fmt + fi), 'x', pad);
|
||||||
|
++fi;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string fmt_string (fmt);
|
return std::string(fmt, (size_t)fi);
|
||||||
free(fmt);
|
|
||||||
return fmt_string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -93,7 +93,7 @@ private:
|
|||||||
// We store a chain leading all the way to the root, so that we can compose
|
// We store a chain leading all the way to the root, so that we can compose
|
||||||
// a NodePath. We may be able to eliminate this requirement in the future.
|
// a NodePath. We may be able to eliminate this requirement in the future.
|
||||||
const CullTraverserData *_next;
|
const CullTraverserData *_next;
|
||||||
NodePathComponent *_start;
|
NodePathComponent *_start; // NOLINT(*.UninitializedObject)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PandaNodePipelineReader _node_reader;
|
PandaNodePipelineReader _node_reader;
|
||||||
|
@ -35,11 +35,11 @@ pm_message(const char *format, ...) {
|
|||||||
char buffer[buffer_size];
|
char buffer[buffer_size];
|
||||||
|
|
||||||
vsnprintf(buffer, buffer_size, format, ap);
|
vsnprintf(buffer, buffer_size, format, ap);
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
nassertv(strlen(buffer) < buffer_size);
|
nassertv(strlen(buffer) < buffer_size);
|
||||||
|
|
||||||
pnmimage_cat.info() << buffer << "\n";
|
pnmimage_cat.info() << buffer << "\n";
|
||||||
|
|
||||||
va_end(ap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -55,12 +55,12 @@ pm_error(const char *format, ...) {
|
|||||||
char buffer[buffer_size];
|
char buffer[buffer_size];
|
||||||
|
|
||||||
vsnprintf(buffer, buffer_size, format, ap);
|
vsnprintf(buffer, buffer_size, format, ap);
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
nassertv(strlen(buffer) < buffer_size);
|
nassertv(strlen(buffer) < buffer_size);
|
||||||
|
|
||||||
pnmimage_cat.error() << buffer << "\n";
|
pnmimage_cat.error() << buffer << "\n";
|
||||||
|
|
||||||
va_end(ap);
|
|
||||||
|
|
||||||
// Now we're supposed to exit. Inconvenient if we were running Panda
|
// Now we're supposed to exit. Inconvenient if we were running Panda
|
||||||
// interactively, but that's the way it is.
|
// interactively, but that's the way it is.
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -1074,7 +1074,7 @@ write_data(xel *array, xelval *alpha) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
buf = (unsigned char*) malloc( bytesperrow );
|
buf = (unsigned char*) alloca( bytesperrow );
|
||||||
if ( buf == nullptr ) {
|
if ( buf == nullptr ) {
|
||||||
pnmimage_tiff_cat.error()
|
pnmimage_tiff_cat.error()
|
||||||
<< "Can't allocate memory for row buffer\n";
|
<< "Can't allocate memory for row buffer\n";
|
||||||
@ -1145,6 +1145,9 @@ write_data(xel *array, xelval *alpha) {
|
|||||||
pnmimage_tiff_cat.error()
|
pnmimage_tiff_cat.error()
|
||||||
<< "Internal error: color not found?!? row=" << row
|
<< "Internal error: color not found?!? row=" << row
|
||||||
<< " col=" << col << "\n";
|
<< " col=" << col << "\n";
|
||||||
|
if (cht != nullptr) {
|
||||||
|
ppm_freecolorhash(cht);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
*tP++ = (unsigned char) s;
|
*tP++ = (unsigned char) s;
|
||||||
@ -1188,6 +1191,10 @@ write_data(xel *array, xelval *alpha) {
|
|||||||
TIFFFlushData( tif );
|
TIFFFlushData( tif );
|
||||||
TIFFClose( tif );
|
TIFFClose( tif );
|
||||||
|
|
||||||
|
if (cht != nullptr) {
|
||||||
|
ppm_freecolorhash(cht);
|
||||||
|
}
|
||||||
|
|
||||||
return _y_size;
|
return _y_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -537,11 +537,10 @@ validate() const {
|
|||||||
size_t index = (size_t)index_array[slot];
|
size_t index = (size_t)index_array[slot];
|
||||||
++count;
|
++count;
|
||||||
if (index >= _num_entries) {
|
if (index >= _num_entries) {
|
||||||
util_cat.error()
|
write(util_cat->error()
|
||||||
<< "SimpleHashMap " << this << " is invalid: slot " << slot
|
<< "SimpleHashMap " << this << " is invalid: slot " << slot
|
||||||
<< " contains index " << index << " which is past the end of the"
|
<< " contains index " << index << " which is past the end of the"
|
||||||
" table\n";
|
" table\n");
|
||||||
write(util_cat.error(false));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
nassertd(index < _num_entries) continue;
|
nassertd(index < _num_entries) continue;
|
||||||
@ -551,21 +550,19 @@ validate() const {
|
|||||||
wants_slot = next_hash(wants_slot);
|
wants_slot = next_hash(wants_slot);
|
||||||
}
|
}
|
||||||
if (wants_slot != slot) {
|
if (wants_slot != slot) {
|
||||||
util_cat.error()
|
write(util_cat->error()
|
||||||
<< "SimpleHashMap " << this << " is invalid: key "
|
<< "SimpleHashMap " << this << " is invalid: key "
|
||||||
<< _table[index]._key << " should be in slot " << wants_slot
|
<< _table[index]._key << " should be in slot " << wants_slot
|
||||||
<< " instead of " << slot << " (ideal is " << ideal_slot << ")\n";
|
<< " instead of " << slot << " (ideal is " << ideal_slot << ")\n");
|
||||||
write(util_cat.error(false));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count != _num_entries) {
|
if (count != _num_entries) {
|
||||||
util_cat.error()
|
write(util_cat->error()
|
||||||
<< "SimpleHashMap " << this << " is invalid: reports " << _num_entries
|
<< "SimpleHashMap " << this << " is invalid: reports " << _num_entries
|
||||||
<< " entries, actually has " << count << "\n";
|
<< " entries, actually has " << count << "\n");
|
||||||
write(util_cat.error(false));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user