mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-05 11:28:17 -04:00
*** empty log message ***
This commit is contained in:
parent
900c8b195e
commit
ebcf12e1a7
@ -42,15 +42,9 @@ EggFilter(bool allow_last_param, bool allow_stdout) :
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
bool EggFilter::
|
bool EggFilter::
|
||||||
handle_args(ProgramBase::Args &args) {
|
handle_args(ProgramBase::Args &args) {
|
||||||
if (_allow_last_param && !_got_output_filename && args.size() > 1) {
|
if (!check_last_arg(args)) {
|
||||||
_got_output_filename = true;
|
|
||||||
_output_filename = args.back();
|
|
||||||
args.pop_back();
|
|
||||||
|
|
||||||
if (!verify_output_file_safe()) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return EggReader::handle_args(args);
|
return EggReader::handle_args(args);
|
||||||
}
|
}
|
||||||
|
@ -146,15 +146,9 @@ get_output_filename() const {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
bool EggWriter::
|
bool EggWriter::
|
||||||
handle_args(ProgramBase::Args &args) {
|
handle_args(ProgramBase::Args &args) {
|
||||||
if (_allow_last_param && !_got_output_filename && !args.empty()) {
|
if (!check_last_arg(args)) {
|
||||||
_got_output_filename = true;
|
|
||||||
_output_filename = args.back();
|
|
||||||
args.pop_back();
|
|
||||||
|
|
||||||
if (!verify_output_file_safe()) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!args.empty()) {
|
if (!args.empty()) {
|
||||||
nout << "Unexpected arguments on command line:\n";
|
nout << "Unexpected arguments on command line:\n";
|
||||||
@ -166,6 +160,33 @@ handle_args(ProgramBase::Args &args) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: EggWriter::check_last_arg
|
||||||
|
// Access: Protected
|
||||||
|
// Description: Checks if the last filename on the argument list is
|
||||||
|
// an egg file (if _allow_last_param was set true), and
|
||||||
|
// removes it from the argument list if it is. Returns
|
||||||
|
// true if the arguments are good, false if something is
|
||||||
|
// invalid.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
bool EggWriter::
|
||||||
|
check_last_arg(ProgramBase::Args &args) {
|
||||||
|
if (_allow_last_param && !_got_output_filename && !args.empty()) {
|
||||||
|
Filename filename = args.back();
|
||||||
|
if (filename.get_extension() == "egg") {
|
||||||
|
_got_output_filename = true;
|
||||||
|
_output_filename = filename;
|
||||||
|
args.pop_back();
|
||||||
|
|
||||||
|
if (!verify_output_file_safe()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: EggWriter::post_command_line
|
// Function: EggWriter::post_command_line
|
||||||
// Access: Protected, Virtual
|
// Access: Protected, Virtual
|
||||||
|
@ -27,6 +27,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool handle_args(Args &args);
|
virtual bool handle_args(Args &args);
|
||||||
|
bool check_last_arg(Args &args);
|
||||||
virtual bool post_command_line();
|
virtual bool post_command_line();
|
||||||
|
|
||||||
bool verify_output_file_safe() const;
|
bool verify_output_file_safe() const;
|
||||||
|
@ -14,3 +14,11 @@
|
|||||||
eggTrans.cxx eggTrans.h
|
eggTrans.cxx eggTrans.h
|
||||||
|
|
||||||
#end noinst_bin_target
|
#end noinst_bin_target
|
||||||
|
|
||||||
|
#begin bin_target
|
||||||
|
#define TARGET egg-texture-cards
|
||||||
|
|
||||||
|
#define SOURCES \
|
||||||
|
eggTextureCards.cxx eggTextureCards.h
|
||||||
|
|
||||||
|
#end bin_target
|
||||||
|
Loading…
x
Reference in New Issue
Block a user