tellg call removed from StreamOperator's checkStream function, because reading of files (readNodeFile etc.) with tellg on 'every iter' is approximately 100 times slower on Emscripten platform

This commit is contained in:
konstantin.matveyev 2017-09-17 18:48:32 +03:00 committed by Konstantin S. Matveyev
parent 4bc1320709
commit cf2b5d030c

View File

@ -16,21 +16,14 @@
using namespace osgDB; using namespace osgDB;
static long long prev_tellg = 0;
void InputIterator::checkStream() const void InputIterator::checkStream() const
{ {
if (_in->rdstate()&_in->failbit) if (_in->rdstate()&_in->failbit)
{ {
OSG_NOTICE<<"InputIterator::checkStream() : _in->rdstate() "<<_in->rdstate()<<", "<<_in->failbit<<std::endl; OSG_NOTICE<<"InputIterator::checkStream() : _in->rdstate() "<<_in->rdstate()<<", "<<_in->failbit<<std::endl;
OSG_NOTICE<<" _in->tellg() = "<<_in->tellg()<<std::endl; OSG_NOTICE<<" _in->tellg() = "<<_in->tellg()<<std::endl;
OSG_NOTICE<<" prev_tellg = "<<prev_tellg<<std::endl;
_failed = true; _failed = true;
} }
else
{
prev_tellg = _in->tellg();
}
} }
void InputIterator::readComponentArray( char* s, unsigned int numElements, unsigned int numComponentsPerElements, unsigned int componentSizeInBytes) void InputIterator::readComponentArray( char* s, unsigned int numElements, unsigned int numComponentsPerElements, unsigned int componentSizeInBytes)