mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
report p3dinstance startup
This commit is contained in:
parent
af5efe447e
commit
6758007d8a
@ -30,7 +30,39 @@ get_p3d_filename() const {
|
||||
// Description: Returns the p3d file offset, the location
|
||||
// in the file where the p3d data starts.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
inline const int &P3DFileParams::
|
||||
inline int P3DFileParams::
|
||||
get_p3d_offset() const {
|
||||
return _p3d_offset;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: P3DFileParams::get_num_tokens
|
||||
// Access: Public
|
||||
// Description: Returns the number of tokens in the params.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
inline int P3DFileParams::
|
||||
get_num_tokens() const {
|
||||
return _tokens.size();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: P3DFileParams::get_token_keyword
|
||||
// Access: Public
|
||||
// Description: Returns the keyword of the nth token.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
inline const string &P3DFileParams::
|
||||
get_token_keyword(int n) const {
|
||||
assert(n >= 0 && n < (int)_tokens.size());
|
||||
return _tokens[n]._keyword;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: P3DFileParams::get_token_value
|
||||
// Access: Public
|
||||
// Description: Returns the value of the nth token.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
inline const string &P3DFileParams::
|
||||
get_token_value(int n) const {
|
||||
assert(n >= 0 && n < (int)_tokens.size());
|
||||
return _tokens[n]._value;
|
||||
}
|
||||
|
@ -36,11 +36,15 @@ public:
|
||||
void set_args(int argc, const char *argv[]);
|
||||
|
||||
inline const string &get_p3d_filename() const;
|
||||
inline const int &get_p3d_offset() const;
|
||||
inline int get_p3d_offset() const;
|
||||
string lookup_token(const string &keyword) const;
|
||||
int lookup_token_int(const string &keyword) const;
|
||||
bool has_token(const string &keyword) const;
|
||||
|
||||
inline int get_num_tokens() const;
|
||||
inline const string &get_token_keyword(int n) const;
|
||||
inline const string &get_token_value(int n) const;
|
||||
|
||||
TiXmlElement *make_xml();
|
||||
|
||||
private:
|
||||
|
@ -93,6 +93,13 @@ P3DInstance(P3D_request_ready_func *func,
|
||||
_fparams.set_tokens(tokens, num_tokens);
|
||||
_fparams.set_args(argc, argv);
|
||||
|
||||
nout << "Creating P3DInstance " << this << ": ";
|
||||
for (int i = 0; i < _fparams.get_num_tokens(); ++i) {
|
||||
nout << " " << _fparams.get_token_keyword(i)
|
||||
<< "=\"" << _fparams.get_token_value(i) << "\"";
|
||||
}
|
||||
nout << "\n";
|
||||
|
||||
P3DInstanceManager *inst_mgr = P3DInstanceManager::get_global_ptr();
|
||||
_instance_id = inst_mgr->get_unique_id();
|
||||
_hidden = (_fparams.lookup_token_int("hidden") != 0);
|
||||
@ -307,6 +314,12 @@ P3DInstance::
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void P3DInstance::
|
||||
set_p3d_url(const string &p3d_url) {
|
||||
if (p3d_url.empty()) {
|
||||
nout << "No p3d URL specified. Cannot run.\n";
|
||||
set_failed();
|
||||
return;
|
||||
}
|
||||
|
||||
// Save the last part of the URL as the p3d_basename, for reporting
|
||||
// purposes or whatever.
|
||||
determine_p3d_basename(p3d_url);
|
||||
|
Loading…
x
Reference in New Issue
Block a user