mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-23 15:46:18 +00:00
CHANGED: #1471 Merged latest gui-refactoring changes.
--HG-- branch : gsoc2012-gui-editor
This commit is contained in:
commit
8883b37efb
6 changed files with 17 additions and 17 deletions
|
@ -35,12 +35,6 @@ class CCDBNodeLeaf;
|
|||
class CCDBNodeBranch;
|
||||
class CCDBBankHandler;
|
||||
|
||||
///global bool, must be set to true if we want to display database modification. See displayDBModifs in commands.cpp
|
||||
extern bool VerboseDatabase;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Interface to manage a database node, can contain a unique property or a set of property
|
||||
* \author Stephane Coutelas
|
||||
|
@ -330,6 +324,9 @@ public :
|
|||
/// release string mapper
|
||||
static void releaseStringMapper();
|
||||
|
||||
static bool isDatabaseVerbose(){ return verboseDatabase; }
|
||||
static void setVerboseDatabase( bool b ){ verboseDatabase = b; }
|
||||
|
||||
protected:
|
||||
|
||||
/// Constructor
|
||||
|
@ -359,6 +356,8 @@ protected:
|
|||
|
||||
static CStringMapper *_DBSM;
|
||||
|
||||
static bool verboseDatabase;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ using namespace std;
|
|||
namespace NLMISC{
|
||||
|
||||
CStringMapper *ICDBNode::_DBSM = NULL;
|
||||
bool ICDBNode::verboseDatabase = false;
|
||||
|
||||
|
||||
std::string ICDBNode::getFullName()
|
||||
|
|
|
@ -401,7 +401,7 @@ void CCDBNodeBranch::readAndMapDelta( TGameCycle gc, CBitMemStream& s, uint bank
|
|||
}
|
||||
|
||||
// Display the Name if we are in verbose mode
|
||||
if ( VerboseDatabase )
|
||||
if ( verboseDatabase )
|
||||
{
|
||||
string displayStr = string("Reading: ") + *(_Nodes[idx]->getName());
|
||||
//CInterfaceManager::getInstance()->getChatOutput()->addTextChild( ucstring( displayStr ),CRGBA(255,255,255,255));
|
||||
|
@ -423,13 +423,13 @@ void CCDBNodeBranch::readDelta( TGameCycle gc, CBitMemStream & f )
|
|||
{
|
||||
// Read the atom bitfield
|
||||
uint nbAtomElements = countLeaves();
|
||||
if(VerboseDatabase)
|
||||
if(verboseDatabase)
|
||||
nlinfo( "CDB/ATOM: %u leaves", nbAtomElements );
|
||||
CBitSet bitfield( nbAtomElements );
|
||||
f.readBits( bitfield );
|
||||
if ( ! bitfield.getVector().empty() )
|
||||
{
|
||||
if(VerboseDatabase)
|
||||
if(verboseDatabase)
|
||||
{
|
||||
nldebug( "CDB/ATOM: Bitfield: %s LastBits:", bitfield.toString().c_str() );
|
||||
f.displayLastBits( bitfield.size() );
|
||||
|
@ -442,7 +442,7 @@ void CCDBNodeBranch::readDelta( TGameCycle gc, CBitMemStream & f )
|
|||
{
|
||||
if ( bitfield[i] )
|
||||
{
|
||||
if(VerboseDatabase)
|
||||
if(verboseDatabase)
|
||||
{
|
||||
nldebug( "CDB/ATOM: Reading prop[%u] of atom", i );
|
||||
}
|
||||
|
@ -468,7 +468,7 @@ void CCDBNodeBranch::readDelta( TGameCycle gc, CBitMemStream & f )
|
|||
}
|
||||
|
||||
// Display the Name if we are in verbose mode
|
||||
if ( VerboseDatabase )
|
||||
if ( verboseDatabase )
|
||||
{
|
||||
string displayStr = string("Reading: ") + *(_Nodes[idx]->getName());
|
||||
//CInterfaceManager::getInstance()->getChatOutput()->addTextChild( ucstring( displayStr ),CRGBA(255,255,255,255));
|
||||
|
|
|
@ -163,7 +163,7 @@ void CCDBNodeLeaf::readDelta(TGameCycle gc, CBitMemStream & f )
|
|||
_Property |= ~mask;
|
||||
}
|
||||
}
|
||||
if ( VerboseDatabase )
|
||||
if ( verboseDatabase )
|
||||
{
|
||||
nlinfo( "CDB: Read value (%u bits) %"NL_I64"d", bits, _Property );
|
||||
}
|
||||
|
|
|
@ -49,8 +49,6 @@
|
|||
using namespace NLMISC;
|
||||
using namespace std;
|
||||
|
||||
|
||||
bool NLMISC::VerboseDatabase = false;
|
||||
uint32 NbDatabaseChanges = 0;
|
||||
|
||||
|
||||
|
@ -191,7 +189,7 @@ void CCDBSynchronised::readDelta( NLMISC::TGameCycle gc, CBitMemStream& s, uint
|
|||
uint16 propertyCount = 0;
|
||||
s.serial( propertyCount );
|
||||
|
||||
if ( VerboseDatabase )
|
||||
if ( NLMISC::ICDBNode::isDatabaseVerbose() )
|
||||
nlinfo( "CDB: Reading delta (%hu changes)", propertyCount );
|
||||
NbDatabaseChanges += propertyCount;
|
||||
|
||||
|
|
|
@ -985,8 +985,10 @@ NLMISC_COMMAND(verboseDatabase, "Enable/Disable the log for the database", "")
|
|||
if(args.size() != 0)
|
||||
return false;
|
||||
|
||||
VerboseDatabase = !VerboseDatabase;
|
||||
if(VerboseDatabase)
|
||||
bool v = NLMISC::ICDBNode::isDatabaseVerbose();
|
||||
NLMISC::ICDBNode::setVerboseDatabase( !v );
|
||||
|
||||
if( !v )
|
||||
nlinfo("Enable VerboseDatabase");
|
||||
else
|
||||
nlinfo("Disable VerboseDatabase");
|
||||
|
|
Loading…
Reference in a new issue