rem: if (!LengthsData) { LengthsSize = 1; LengthsData = (UChar8*) &lendummy; lendummy = PositionsPtr->getSize(); } else { LengthsSize = LengthsPtr->getSize(); }
add: LengthsSize = LengthsPtr->getSize(); } else { LengthsSize = 1; LengthsData = (UChar8*) &lendummy; lendummy = PositionsPtr->getSize();
context: void GeoPump128(Window   *win,                Geometry *geo               ){    Int16 modified=0;    pumpSetup(Positions  , GeoPositionsPtr , getPositions  );    pumpSetup(Colors     , GeoColorsPtr    , getColors     );    pumpSetup(SecColors  , GeoColorsPtr    , getSecondaryColors );    pumpSetup(TexCoords  , GeoTexCoordsPtr , getTexCoords  );    pumpSetup(TexCoords1 , GeoTexCoordsPtr , getTexCoords1 );    pumpSetup(TexCoords2 , GeoTexCoordsPtr , getTexCoords2 );    pumpSetup(TexCoords3 , GeoTexCoordsPtr , getTexCoords3 );    pumpSetup(Normals    , GeoNormalsPtr   , getNormals    );    pumpSetup(Lengths    , GeoPLengthsPtr  , getLengths    );    pumpSetup(Types      , GeoPTypesPtr    , getTypes      );    if (PositionsData)    {                glEnableClientState(GL_VERTEX_ARRAY);        glVertexPointer(PositionsPtr->getDimension(), PositionsPtr->getFormat(),                        PositionsStride, PositionsData);        modified|=(1<<0);    }    if (ColorsData)    {        glEnableClientState(GL_COLOR_ARRAY);        glColorPointer(ColorsPtr->getDimension(), ColorsPtr->getFormat(),                       ColorsStride, ColorsData);        modified|=(1<<1);            }    if (SecColorsData)    {        if (win->hasExtension(GeoPumpFactory::_extSecondaryColor))        {            glEnableClientState(GL_SECONDARY_COLOR_ARRAY_EXT);             void (OSG_APIENTRY*_glSecondaryColorPointerEXT)                  (GLint size,GLenum type,GLsizei stride,const GLvoid *pointer)=            (void (OSG_APIENTRY*)(GLint size,GLenum type,GLsizei stride,const GLvoid *pointer))             win->getFunction(GeoPumpFactory::_funcglSecondaryColorPointer);            _glSecondaryColorPointerEXT(SecColorsPtr->getDimension(),                                       SecColorsPtr->getFormat(),                                       SecColorsStride, SecColorsData);            modified|=(1<<2);        }        else            FWARNING(("GeoPump128: Window has no Secondary Color extension\n"));    }    if (NormalsData)    {        glEnableClientState(GL_NORMAL_ARRAY);        glNormalPointer(NormalsPtr->getFormat(), NormalsStride, NormalsData);        modified|=(1<<3);    }    if (TexCoordsData)    {        if (win->hasExtension(GeoPumpFactory::_extMultitexture))        {            void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)=            (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB);            _glClientActiveTextureARB(GL_TEXTURE0_ARB);            glEnableClientState(GL_TEXTURE_COORD_ARRAY);            glTexCoordPointer (TexCoordsPtr->getDimension(), TexCoordsPtr->getFormat(),                               TexCoordsStride, TexCoordsData);        }        else        {            glEnableClientState(GL_TEXTURE_COORD_ARRAY);            glTexCoordPointer (TexCoordsPtr->getDimension(), TexCoordsPtr->getFormat(),                               TexCoordsStride, TexCoordsData);        }        modified|=(1<<4);    }    if (TexCoords1Data)    {        if (win->hasExtension(GeoPumpFactory::_extMultitexture))        {            void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)=            (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB);            _glClientActiveTextureARB(GL_TEXTURE1_ARB);            glEnableClientState(GL_TEXTURE_COORD_ARRAY);            glTexCoordPointer (TexCoords1Ptr->getDimension(), TexCoords1Ptr->getFormat(),                               TexCoords1Stride, TexCoords1Data);            modified|=(1<<5);        }        else            FWARNING(("GeoPump128: Window has no MultitextureARB extension\n"));    }    if (TexCoords2Data)    {        if (win->hasExtension(GeoPumpFactory::_extMultitexture))        {            void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)=            (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB);            _glClientActiveTextureARB(GL_TEXTURE2_ARB);            glEnableClientState(GL_TEXTURE_COORD_ARRAY);            glTexCoordPointer (TexCoords2Ptr->getDimension(), TexCoords2Ptr->getFormat(),                               TexCoords2Stride, TexCoords2Data);            modified|=(1<<6);        }        else            FWARNING(("GeoPump128: Window has no MultitextureARB extension\n"));    }    if (TexCoords3Data)    {        if (win->hasExtension(GeoPumpFactory::_extMultitexture))        {            void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)=            (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB);            _glClientActiveTextureARB(GL_TEXTURE3_ARB);            glEnableClientState(GL_TEXTURE_COORD_ARRAY);            glTexCoordPointer (TexCoords3Ptr->getDimension(), TexCoords3Ptr->getFormat(),                               TexCoords3Stride, TexCoords3Data);            modified|=(1<<7);        }        else            FWARNING(("GeoPump128: Window has no MultitextureARB extension\n"));    }    UInt32 lendummy;    UInt32 LengthsSize;    if (LengthsPtr != NullFC)    {        if (!LengthsData)        {            LengthsSize = 1;            LengthsData = (UChar8*) &lendummy;            lendummy = PositionsPtr->getSize();        }        else        {            LengthsSize = LengthsPtr->getSize();        }    }    UInt32 LengthsInd,TypesInd = 0;    UInt32 first=0;    for ( LengthsInd = 0; LengthsInd < LengthsSize; LengthsInd++ )    {        UInt32 count = *(UInt32*)(LengthsData + LengthsInd * LengthsStride);        glDrawArrays(*(TypesData + TypesInd++ * TypesStride),first,count);        first+=count;    }        if(modified&(1<<0)) glDisableClientState(GL_VERTEX_ARRAY);    if(modified&(1<<1)) glDisableClientState(GL_COLOR_ARRAY);    if(modified&(1<<2)) glDisableClientState(GL_SECONDARY_COLOR_ARRAY_EXT);    if(modified&(1<<3)) glDisableClientState(GL_NORMAL_ARRAY);    if (win->hasExtension(GeoPumpFactory::_extMultitexture))    {        void (OSG_APIENTRY*_glClientActiveTextureARB) (GLenum type)=        (void (OSG_APIENTRY*) (GLenum type))win->getFunction(GeoPumpFactory::_funcglClientActiveTextureARB);        if(modified&(1<<4))        {           _glClientActiveTextureARB(GL_TEXTURE0_ARB);            glDisableClientState(GL_TEXTURE_COORD_ARRAY);        }                if(modified&(1<<5))        {            _glClientActiveTextureARB(GL_TEXTURE1_ARB);            glDisableClientState(GL_TEXTURE_COORD_ARRAY);        }                if(modified&(1<<6))        {            _glClientActiveTextureARB(GL_TEXTURE2_ARB);            glDisableClientState(GL_TEXTURE_COORD_ARRAY);        }                if(modified&(1<<7))        {            _glClientActiveTextureARB(GL_TEXTURE3_ARB);            glDisableClientState(GL_TEXTURE_COORD_ARRAY);        }    }    else    {        if(modified&(1<<4)) glDisableClientState(GL_TEXTURE_COORD_ARRAY);    }}