mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
better handling of dconfig/new interface interactions
This commit is contained in:
parent
8c5f9f0219
commit
638fad7bf6
@ -118,15 +118,26 @@ set_value_type(ConfigVariableCore::ValueType value_type) {
|
||||
// Description: Specifies the trust level of this variable. See
|
||||
// get_flags(). It is not an error to call this
|
||||
// multiple times, but if the value changes once
|
||||
// get_declaration() has been called, a warning is printed.
|
||||
// get_declaration() has been called, a warning is
|
||||
// printed.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void ConfigVariableCore::
|
||||
set_flags(int flags) {
|
||||
if (_value_queried && _flags != flags) {
|
||||
prc_cat->warning()
|
||||
<< "changing trust level for ConfigVariable "
|
||||
<< get_name() << " from " << _flags << " to "
|
||||
<< flags << ".\n";
|
||||
if (_value_queried) {
|
||||
int bits_changed = (_flags ^ flags);
|
||||
if ((bits_changed & F_trust_level_mask) != 0) {
|
||||
prc_cat->warning()
|
||||
<< "changing trust level for ConfigVariable "
|
||||
<< get_name() << " from " << (_flags & F_trust_level_mask) << " to "
|
||||
<< (flags & F_trust_level_mask) << ".\n";
|
||||
}
|
||||
if ((bits_changed & ~(F_trust_level_mask | F_dconfig)) != 0) {
|
||||
prc_cat->warning()
|
||||
<< "changing flags for ConfigVariable "
|
||||
<< get_name() << " from " << hex
|
||||
<< (_flags & ~F_trust_level_mask) << " to "
|
||||
<< (flags & ~F_trust_level_mask) << dec << ".\n";
|
||||
}
|
||||
}
|
||||
|
||||
_flags = flags;
|
||||
@ -153,6 +164,15 @@ set_description(const string &description) {
|
||||
// older DConfig interface.
|
||||
return;
|
||||
}
|
||||
if (description == "DConfig") {
|
||||
// As a similar exception, we don't replace an existing
|
||||
// description with one that reads simply "DConfig", unless it
|
||||
// was empty previously.
|
||||
if (_description.empty()) {
|
||||
_description = description;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
prc_cat->warning()
|
||||
<< "changing description for ConfigVariable "
|
||||
|
Loading…
x
Reference in New Issue
Block a user