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'.",
|
"'y-up', 'z-up', 'y-up-left', or 'z-up-left'.",
|
||||||
&EggMultiBase::dispatch_coordinate_system,
|
&EggMultiBase::dispatch_coordinate_system,
|
||||||
&_got_coordinate_system, &_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::
|
EggData *EggMultiBase::
|
||||||
read_egg(const Filename &filename) {
|
read_egg(const Filename &filename) {
|
||||||
EggData *data = new EggData;
|
EggData *data = new EggData;
|
||||||
if (data->read(filename)) {
|
if (!data->read(filename)) {
|
||||||
return data;
|
// Failure reading.
|
||||||
|
delete data;
|
||||||
|
return (EggData *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Failure reading.
|
if (_force_complete) {
|
||||||
delete data;
|
if (!data->resolve_externals()) {
|
||||||
return (EggData *)NULL;
|
delete data;
|
||||||
|
return (EggData *)NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,8 @@ protected:
|
|||||||
|
|
||||||
typedef vector<EggData *> Eggs;
|
typedef vector<EggData *> Eggs;
|
||||||
Eggs _eggs;
|
Eggs _eggs;
|
||||||
|
|
||||||
|
bool _force_complete;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -152,6 +152,7 @@ write_eggs() {
|
|||||||
nassertv(_inplace);
|
nassertv(_inplace);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nout << "Writing " << filename << "\n";
|
||||||
if (!data->write_egg(filename)) {
|
if (!data->write_egg(filename)) {
|
||||||
// Error writing an egg file; abort.
|
// Error writing an egg file; abort.
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -20,6 +20,12 @@ EggReader() {
|
|||||||
"Specify the coordinate system to operate in. This may be "
|
"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 "
|
" one of 'y-up', 'z-up', 'y-up-left', or 'z-up-left'. The default "
|
||||||
"is the coordinate system of the input egg file.");
|
"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.
|
// just because we got a bad egg file.
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_force_complete) {
|
||||||
|
if (!_data.resolve_externals()) {
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -23,6 +23,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
virtual bool handle_args(Args &args);
|
virtual bool handle_args(Args &args);
|
||||||
|
|
||||||
|
bool _force_complete;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user