mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 00:32:57 -04:00
*** empty log message ***
This commit is contained in:
parent
e2e9663c4c
commit
ce7cc4526b
@ -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;
|
||||
}
|
||||
|
||||
// Failure reading.
|
||||
delete data;
|
||||
return (EggData *)NULL;
|
||||
if (_force_complete) {
|
||||
if (!data->resolve_externals()) {
|
||||
delete data;
|
||||
return (EggData *)NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
@ -38,6 +38,8 @@ protected:
|
||||
|
||||
typedef vector<EggData *> Eggs;
|
||||
Eggs _eggs;
|
||||
|
||||
bool _force_complete;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -23,6 +23,7 @@ public:
|
||||
protected:
|
||||
virtual bool handle_args(Args &args);
|
||||
|
||||
bool _force_complete;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user