From Wang Rui, "I'd like to submit the changes that will put ObjectProperty and ObjectMark variables into the InputStream/OutputStream class instead of static ones. This should avoid the threading problem and won't repeatedly reallocate memory for the properties. Some of the wrappers will be slightly modified to use the property variable stored in the InputStream/OutputStream as well."
This commit is contained in:
@@ -10,25 +10,25 @@ static bool checkParticleSystems( const osgParticle::ParticleSystemUpdater& upda
|
||||
|
||||
static bool readParticleSystems( osgDB::InputStream& is, osgParticle::ParticleSystemUpdater& updater )
|
||||
{
|
||||
unsigned int size = 0; is >> size >> osgDB::BEGIN_BRACKET;
|
||||
unsigned int size = 0; is >> size >> is.BEGIN_BRACKET;
|
||||
for ( unsigned int i=0; i<size; ++i )
|
||||
{
|
||||
osgParticle::ParticleSystem* ps = dynamic_cast<osgParticle::ParticleSystem*>( is.readObject() );
|
||||
if ( ps ) updater.addParticleSystem( ps );
|
||||
}
|
||||
is >> osgDB::END_BRACKET;
|
||||
is >> is.END_BRACKET;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool writeParticleSystems( osgDB::OutputStream& os, const osgParticle::ParticleSystemUpdater& updater )
|
||||
{
|
||||
unsigned int size = updater.getNumParticleSystems();
|
||||
os << size << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os << size << os.BEGIN_BRACKET << std::endl;
|
||||
for ( unsigned int i=0; i<size; ++i )
|
||||
{
|
||||
os << updater.getParticleSystem(i);
|
||||
}
|
||||
os << osgDB::END_BRACKET << std::endl;
|
||||
os << os.END_BRACKET << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user