*** empty log message ***

This commit is contained in:
David Rose 2000-11-08 22:49:08 +00:00
parent e2e9663c4c
commit ce7cc4526b
5 changed files with 34 additions and 5 deletions

View File

@ -22,6 +22,12 @@ EggMultiBase() {
"'y-up', 'z-up', 'y-up-left', or 'z-up-left'.",
&EggMultiBase::dispatch_coordinate_system,
&_got_coordinate_system, &_coordinate_system);
add_option
("f", "", 80,
"Force complete loading: load up the egg file along with all of its "
"external references.",
&EggMultiBase::dispatch_none, &_force_complete);
}
@ -94,11 +100,18 @@ append_command_comment(EggData &data) {
EggData *EggMultiBase::
read_egg(const Filename &filename) {
EggData *data = new EggData;
if (data->read(filename)) {
return data;
}
if (!data->read(filename)) {
// Failure reading.
delete data;
return (EggData *)NULL;
}
if (_force_complete) {
if (!data->resolve_externals()) {
delete data;
return (EggData *)NULL;
}
}
return data;
}

View File

@ -38,6 +38,8 @@ protected:
typedef vector<EggData *> Eggs;
Eggs _eggs;
bool _force_complete;
};
#endif

View File

@ -152,6 +152,7 @@ write_eggs() {
nassertv(_inplace);
}
nout << "Writing " << filename << "\n";
if (!data->write_egg(filename)) {
// Error writing an egg file; abort.
exit(1);

View File

@ -20,6 +20,12 @@ EggReader() {
"Specify the coordinate system to operate in. This may be "
" one of 'y-up', 'z-up', 'y-up-left', or 'z-up-left'. The default "
"is the coordinate system of the input egg file.");
add_option
("f", "", 80,
"Force complete loading: load up the egg file along with all of its "
"external references.",
&EggReader::dispatch_none, &_force_complete);
}
////////////////////////////////////////////////////////////////////
@ -45,6 +51,12 @@ handle_args(ProgramBase::Args &args) {
// just because we got a bad egg file.
exit(1);
}
if (_force_complete) {
if (!_data.resolve_externals()) {
exit(1);
}
}
}
return true;

View File

@ -23,6 +23,7 @@ public:
protected:
virtual bool handle_args(Args &args);
bool _force_complete;
};
#endif