mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 00:06:44 -04:00
*** empty log message ***
This commit is contained in:
parent
26d6e6c12a
commit
1ae907ef31
@ -286,13 +286,6 @@ prompt_user(const string &filename, CVSSourceDirectory *suggested_dir,
|
|||||||
if (result != (CVSSourceDirectory *)NULL) {
|
if (result != (CVSSourceDirectory *)NULL) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else { // dirs.empty()
|
|
||||||
nassertr(dirs.empty(), (CVSSourceDirectory *)NULL);
|
|
||||||
// The file does not already exist.
|
|
||||||
if (!interactive) {
|
|
||||||
return suggested_dir;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The file does not already exist, or the user declined to replace
|
// The file does not already exist, or the user declined to replace
|
||||||
|
@ -34,6 +34,13 @@
|
|||||||
|
|
||||||
Configure(config_flt);
|
Configure(config_flt);
|
||||||
|
|
||||||
|
// Set this true to trigger an assertion failure (and core dump)
|
||||||
|
// immediately when an error is detected on reading or writing a flt
|
||||||
|
// file. This is primarily useful for debugging the flt reader
|
||||||
|
// itself, to generate a stack trace to determine precisely at what
|
||||||
|
// point a flt file failed.
|
||||||
|
const bool flt_error_abort = config_flt.GetBool("flt-error-abort", false);
|
||||||
|
|
||||||
ConfigureFn(config_flt) {
|
ConfigureFn(config_flt) {
|
||||||
FltRecord::init_type();
|
FltRecord::init_type();
|
||||||
FltBead::init_type();
|
FltBead::init_type();
|
||||||
@ -61,3 +68,4 @@ ConfigureFn(config_flt) {
|
|||||||
FltTransformRotateScale::init_type();
|
FltTransformRotateScale::init_type();
|
||||||
FltExternalReference::init_type();
|
FltExternalReference::init_type();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,6 @@
|
|||||||
#ifndef CONFIG_FLT_H
|
#ifndef CONFIG_FLT_H
|
||||||
#define CONFIG_FLT_H
|
#define CONFIG_FLT_H
|
||||||
|
|
||||||
// No configure variables.
|
extern const bool flt_error_abort;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -13,6 +13,9 @@
|
|||||||
#include "fltTransformScale.h"
|
#include "fltTransformScale.h"
|
||||||
#include "fltTransformTranslate.h"
|
#include "fltTransformTranslate.h"
|
||||||
#include "fltTransformRotateScale.h"
|
#include "fltTransformRotateScale.h"
|
||||||
|
#include "config_flt.h"
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
TypeHandle FltBead::_type_handle;
|
TypeHandle FltBead::_type_handle;
|
||||||
|
|
||||||
@ -356,6 +359,7 @@ write_transform(FltRecordWriter &writer) const {
|
|||||||
Transforms::const_iterator ti;
|
Transforms::const_iterator ti;
|
||||||
for (ti = _transform_steps.begin(); ti != _transform_steps.end(); ++ti) {
|
for (ti = _transform_steps.begin(); ti != _transform_steps.end(); ++ti) {
|
||||||
if (!(*ti)->build_record(writer)) {
|
if (!(*ti)->build_record(writer)) {
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_invalid_record;
|
return FE_invalid_record;
|
||||||
}
|
}
|
||||||
FltError result = writer.advance();
|
FltError result = writer.advance();
|
||||||
|
@ -7,6 +7,9 @@
|
|||||||
#include "fltRecordReader.h"
|
#include "fltRecordReader.h"
|
||||||
#include "fltRecordWriter.h"
|
#include "fltRecordWriter.h"
|
||||||
#include "fltUnsupportedRecord.h"
|
#include "fltUnsupportedRecord.h"
|
||||||
|
#include "config_flt.h"
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
TypeHandle FltHeader::_type_handle;
|
TypeHandle FltHeader::_type_handle;
|
||||||
|
|
||||||
@ -76,6 +79,7 @@ read_flt(Filename filename) {
|
|||||||
|
|
||||||
ifstream in;
|
ifstream in;
|
||||||
if (!filename.open_read(in)) {
|
if (!filename.open_read(in)) {
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_could_not_open;
|
return FE_could_not_open;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,6 +105,7 @@ read_flt(istream &in) {
|
|||||||
FltRecordReader reader(in);
|
FltRecordReader reader(in);
|
||||||
FltError result = reader.advance();
|
FltError result = reader.advance();
|
||||||
if (result == FE_end_of_file) {
|
if (result == FE_end_of_file) {
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_empty_file;
|
return FE_empty_file;
|
||||||
} else if (result != FE_ok) {
|
} else if (result != FE_ok) {
|
||||||
return result;
|
return result;
|
||||||
@ -112,6 +117,7 @@ read_flt(istream &in) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!reader.eof()) {
|
if (!reader.eof()) {
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_extra_data;
|
return FE_extra_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,6 +138,7 @@ write_flt(Filename filename) {
|
|||||||
|
|
||||||
ofstream out;
|
ofstream out;
|
||||||
if (!filename.open_write(out)) {
|
if (!filename.open_write(out)) {
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_could_not_open;
|
return FE_could_not_open;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,6 +158,7 @@ write_flt(ostream &out) {
|
|||||||
FltError result = write_record_and_children(writer);
|
FltError result = write_record_and_children(writer);
|
||||||
|
|
||||||
if (out.fail()) {
|
if (out.fail()) {
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_write_error;
|
return FE_write_error;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -1455,6 +1463,7 @@ write_color_palette(FltRecordWriter &writer) const {
|
|||||||
Colors::const_iterator ci;
|
Colors::const_iterator ci;
|
||||||
for (ci = _colors.begin(); num_colors > 0 && ci != _colors.end(); ++ci) {
|
for (ci = _colors.begin(); num_colors > 0 && ci != _colors.end(); ++ci) {
|
||||||
if (!(*ci).build_record(writer)) {
|
if (!(*ci).build_record(writer)) {
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_invalid_record;
|
return FE_invalid_record;
|
||||||
}
|
}
|
||||||
num_colors--;
|
num_colors--;
|
||||||
@ -1466,6 +1475,7 @@ write_color_palette(FltRecordWriter &writer) const {
|
|||||||
FltPackedColor empty;
|
FltPackedColor empty;
|
||||||
while (num_colors > 0) {
|
while (num_colors > 0) {
|
||||||
if (!empty.build_record(writer)) {
|
if (!empty.build_record(writer)) {
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_invalid_record;
|
return FE_invalid_record;
|
||||||
}
|
}
|
||||||
num_colors--;
|
num_colors--;
|
||||||
@ -1573,6 +1583,7 @@ write_eyepoint_palette(FltRecordWriter &writer) const {
|
|||||||
int num_eyepoints = get_num_eyepoints();
|
int num_eyepoints = get_num_eyepoints();
|
||||||
for (i = 0; i < num_eyepoints; i++) {
|
for (i = 0; i < num_eyepoints; i++) {
|
||||||
if (!_eyepoints[i].build_record(writer)) {
|
if (!_eyepoints[i].build_record(writer)) {
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_bad_data;
|
return FE_bad_data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1580,6 +1591,7 @@ write_eyepoint_palette(FltRecordWriter &writer) const {
|
|||||||
int num_trackplanes = get_num_trackplanes();
|
int num_trackplanes = get_num_trackplanes();
|
||||||
for (i = 0; i < num_trackplanes; i++) {
|
for (i = 0; i < num_trackplanes; i++) {
|
||||||
if (!_trackplanes[i].build_record(writer)) {
|
if (!_trackplanes[i].build_record(writer)) {
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_bad_data;
|
return FE_bad_data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,9 +16,12 @@
|
|||||||
#include "fltInstanceRef.h"
|
#include "fltInstanceRef.h"
|
||||||
#include "fltUnsupportedRecord.h"
|
#include "fltUnsupportedRecord.h"
|
||||||
#include "fltExternalReference.h"
|
#include "fltExternalReference.h"
|
||||||
|
#include "config_flt.h"
|
||||||
|
|
||||||
#include <indent.h>
|
#include <indent.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
TypeHandle FltRecord::_type_handle;
|
TypeHandle FltRecord::_type_handle;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -44,8 +47,8 @@ FltRecord::
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: FltRecord::get_num_children
|
// Function: FltRecord::get_num_children
|
||||||
// Access: Public
|
// Access: Public
|
||||||
// Description: Returns the number of child records of this record. This
|
// Description: Returns the number of child records of this record.
|
||||||
// reflects the normal scene graph hierarchy.
|
// This reflects the normal scene graph hierarchy.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
int FltRecord::
|
int FltRecord::
|
||||||
get_num_children() const {
|
get_num_children() const {
|
||||||
@ -430,6 +433,7 @@ FltError FltRecord::
|
|||||||
read_record_and_children(FltRecordReader &reader) {
|
read_record_and_children(FltRecordReader &reader) {
|
||||||
if (!extract_record(reader)) {
|
if (!extract_record(reader)) {
|
||||||
nout << "Could not extract record for " << *this << "\n";
|
nout << "Could not extract record for " << *this << "\n";
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_invalid_record;
|
return FE_invalid_record;
|
||||||
}
|
}
|
||||||
FltError result = reader.advance();
|
FltError result = reader.advance();
|
||||||
@ -468,6 +472,7 @@ read_record_and_children(FltRecordReader &reader) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (reader.eof() || reader.error()) {
|
if (reader.eof() || reader.error()) {
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_end_of_file;
|
return FE_end_of_file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -487,6 +492,7 @@ read_record_and_children(FltRecordReader &reader) {
|
|||||||
}
|
}
|
||||||
add_subface(subface);
|
add_subface(subface);
|
||||||
if (reader.eof() || reader.error()) {
|
if (reader.eof() || reader.error()) {
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_end_of_file;
|
return FE_end_of_file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -555,6 +561,7 @@ FltError FltRecord::
|
|||||||
write_record_and_children(FltRecordWriter &writer) const {
|
write_record_and_children(FltRecordWriter &writer) const {
|
||||||
// First, write the record.
|
// First, write the record.
|
||||||
if (!build_record(writer)) {
|
if (!build_record(writer)) {
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_bad_data;
|
return FE_bad_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -571,6 +578,7 @@ write_record_and_children(FltRecordWriter &writer) const {
|
|||||||
Records::const_iterator ci;
|
Records::const_iterator ci;
|
||||||
for (ci = _ancillary.begin(); ci != _ancillary.end(); ++ci) {
|
for (ci = _ancillary.begin(); ci != _ancillary.end(); ++ci) {
|
||||||
if (!(*ci)->build_record(writer)) {
|
if (!(*ci)->build_record(writer)) {
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_bad_data;
|
return FE_bad_data;
|
||||||
}
|
}
|
||||||
result = writer.advance();
|
result = writer.advance();
|
||||||
|
@ -4,9 +4,12 @@
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "fltRecordReader.h"
|
#include "fltRecordReader.h"
|
||||||
|
#include "config_flt.h"
|
||||||
|
|
||||||
#include <datagramIterator.h>
|
#include <datagramIterator.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: FltRecordReader::Constructor
|
// Function: FltRecordReader::Constructor
|
||||||
// Access: Public
|
// Access: Public
|
||||||
@ -95,9 +98,11 @@ get_record_length() const {
|
|||||||
FltError FltRecordReader::
|
FltError FltRecordReader::
|
||||||
advance() {
|
advance() {
|
||||||
if (_state == S_eof) {
|
if (_state == S_eof) {
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_end_of_file;
|
return FE_end_of_file;
|
||||||
}
|
}
|
||||||
if (_state == S_error) {
|
if (_state == S_error) {
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_read_error;
|
return FE_read_error;
|
||||||
}
|
}
|
||||||
if (_iterator != (DatagramIterator *)NULL) {
|
if (_iterator != (DatagramIterator *)NULL) {
|
||||||
@ -113,10 +118,12 @@ advance() {
|
|||||||
|
|
||||||
if (_in.eof()) {
|
if (_in.eof()) {
|
||||||
_state = S_eof;
|
_state = S_eof;
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_end_of_file;
|
return FE_end_of_file;
|
||||||
|
|
||||||
} else if (_in.fail()) {
|
} else if (_in.fail()) {
|
||||||
_state = S_error;
|
_state = S_error;
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_read_error;
|
return FE_read_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,11 +144,13 @@ advance() {
|
|||||||
|
|
||||||
if (_in.eof()) {
|
if (_in.eof()) {
|
||||||
_state = S_eof;
|
_state = S_eof;
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_end_of_file;
|
return FE_end_of_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_in.fail()) {
|
if (_in.fail()) {
|
||||||
_state = S_error;
|
_state = S_error;
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_read_error;
|
return FE_read_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,9 +6,12 @@
|
|||||||
#include "fltRecordWriter.h"
|
#include "fltRecordWriter.h"
|
||||||
#include "fltInstanceDefinition.h"
|
#include "fltInstanceDefinition.h"
|
||||||
#include "fltHeader.h"
|
#include "fltHeader.h"
|
||||||
|
#include "config_flt.h"
|
||||||
|
|
||||||
#include <datagram.h>
|
#include <datagram.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: FltRecordWriter::Constructor
|
// Function: FltRecordWriter::Constructor
|
||||||
// Access: Public
|
// Access: Public
|
||||||
@ -86,12 +89,14 @@ advance() {
|
|||||||
|
|
||||||
_out.write(dg.get_message().data(), dg.get_length());
|
_out.write(dg.get_message().data(), dg.get_length());
|
||||||
if (_out.fail()) {
|
if (_out.fail()) {
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_write_error;
|
return FE_write_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now write the rest of the record.
|
// Now write the rest of the record.
|
||||||
_out.write(_datagram.get_message().data(), _datagram.get_length());
|
_out.write(_datagram.get_message().data(), _datagram.get_length());
|
||||||
if (_out.fail()) {
|
if (_out.fail()) {
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_write_error;
|
return FE_write_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,6 +138,7 @@ write_instance_def(FltHeader *header, int instance_index) {
|
|||||||
|
|
||||||
FltInstanceDefinition *instance = header->get_instance(instance_index);
|
FltInstanceDefinition *instance = header->get_instance(instance_index);
|
||||||
if (instance == (FltInstanceDefinition *)NULL) {
|
if (instance == (FltInstanceDefinition *)NULL) {
|
||||||
|
assert(!flt_error_abort);
|
||||||
return FE_undefined_instance;
|
return FE_undefined_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user