Changeset 14044

Show
Ignore:
Timestamp:
08/19/14 18:58:02 (14 hours ago)
Author:
robert
Message:

Added toggling on/off of the VolumeSettings? ui via the 'E' key.

Location:
OpenSceneGraph/trunk/src
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgQt/GraphicsWindowQt.cpp

    r14009 r14044  
    249249    const QSize& size = event->size(); 
    250250 
    251     _gw->resized( x(), y(), size.width()*_devicePixelRatio, size.height()*_devicePixelRatio ); 
    252     _gw->getEventQueue()->windowResize( x(), y(), size.width()*_devicePixelRatio, size.height()*_devicePixelRatio ); 
     251    int scaled_width = static_cast<int>(size.width()*_devicePixelRatio); 
     252    int scaled_height = static_cast<int>(size.height()*_devicePixelRatio); 
     253    _gw->resized( x(), y(), scaled_width,  scaled_height); 
     254    _gw->getEventQueue()->windowResize( x(), y(), scaled_width, scaled_height ); 
    253255    _gw->requestRedraw(); 
    254256} 
     
    257259{ 
    258260    const QPoint& pos = event->pos(); 
    259     _gw->resized( pos.x(), pos.y(), width()*_devicePixelRatio, height()*_devicePixelRatio ); 
    260     _gw->getEventQueue()->windowResize( pos.x(), pos.y(), width()*_devicePixelRatio, height()*_devicePixelRatio ); 
     261    int scaled_width = static_cast<int>(width()*_devicePixelRatio); 
     262    int scaled_height = static_cast<int>(height()*_devicePixelRatio); 
     263    _gw->resized( pos.x(), pos.y(), scaled_width,  scaled_height ); 
     264    _gw->getEventQueue()->windowResize( pos.x(), pos.y(), scaled_width,  scaled_height ); 
    261265} 
    262266 
  • OpenSceneGraph/trunk/src/osgQt/QGraphicsViewAdapter.cpp

    r13482 r14044  
    9292#endif 
    9393 
    94     _width = _graphicsScene->width(); 
    95     _height = _graphicsScene->height(); 
     94    _width = static_cast<int>(_graphicsScene->width()); 
     95    _height = static_cast<int>(_graphicsScene->height()); 
    9696 
    9797    _qimages[0] = QImage(QSize(_width, _height), s_imageFormat); 
  • OpenSceneGraph/trunk/src/osgShadow/ViewDependentShadowMap.cpp

    r13587 r14044  
    974974            { 
    975975                camera->getViewport()->x() = pos_x; 
    976                 pos_x += camera->getViewport()->width() + 40; 
     976                pos_x += static_cast<unsigned int>(camera->getViewport()->width()) + 40; 
    977977            } 
    978978 
  • OpenSceneGraph/trunk/src/osgVolume/VolumeScene.cpp

    r14021 r14044  
    102102        if (viewport) 
    103103        { 
    104             textureWidth = viewport->width(); 
    105             textureHeight = viewport->height(); 
     104            textureWidth = static_cast<int>(viewport->width()); 
     105            textureHeight = static_cast<int>(viewport->height()); 
    106106        } 
    107107 
     
    210210        OSG_NOTICE<<"Creating ViewData"<<std::endl; 
    211211 
    212         unsigned textureWidth = 512; 
    213         unsigned textureHeight = 512; 
     212        int textureWidth = 512; 
     213        int textureHeight = 512; 
    214214 
    215215        osg::Viewport* viewport = cv->getCurrentRenderStage()->getViewport(); 
    216216        if (viewport) 
    217217        { 
    218             textureWidth = viewport->width(); 
    219             textureHeight = viewport->height(); 
     218            textureWidth = static_cast<int>(viewport->width()); 
     219            textureHeight = static_cast<int>(viewport->height()); 
    220220        } 
    221221 
     
    365365        viewData->_viewportDimensionsUniform->set(osg::Vec4(viewport->x(), viewport->y(), viewport->width(),viewport->height())); 
    366366 
    367         if (viewport->width() != viewData->_colorTexture->getTextureWidth() || 
    368             viewport->height() != viewData->_colorTexture->getTextureHeight()) 
    369         { 
    370             OSG_NOTICE<<"Need to change texture size to "<<viewport->width()<<", "<< viewport->height()<<std::endl; 
    371             viewData->_colorTexture->setTextureSize(viewport->width(), viewport->height()); 
     367        int textureWidth = static_cast<int>(viewport->width()); 
     368        int textureHeight = static_cast<int>(viewport->height()); 
     369 
     370        if (textureWidth != viewData->_colorTexture->getTextureWidth() || 
     371            textureHeight != viewData->_colorTexture->getTextureHeight()) 
     372        { 
     373            OSG_NOTICE<<"Need to change texture size to "<<textureWidth<<", "<< textureHeight<<std::endl; 
     374            viewData->_colorTexture->setTextureSize(textureWidth, textureHeight); 
    372375            viewData->_colorTexture->dirtyTextureObject(); 
    373             viewData->_depthTexture->setTextureSize(viewport->width(), viewport->height()); 
     376            viewData->_depthTexture->setTextureSize(textureWidth, textureHeight); 
    374377            viewData->_depthTexture->dirtyTextureObject(); 
    375             viewData->_rttCamera->setViewport(0, 0, viewport->width(), viewport->height()); 
     378            viewData->_rttCamera->setViewport(0, 0, textureWidth, textureHeight); 
    376379            if (viewData->_rttCamera->getRenderingCache()) 
    377380            { 
  • OpenSceneGraph/trunk/src/osgWrappers/deprecated-dotosg/osg/StateSet.cpp

    r13217 r14044  
    9494            return false; 
    9595        } 
    96              
     96 
    9797    } 
    9898 
     
    445445            if (StateSet_matchModeStr(fr[1].getStr(),value)) 
    446446            { 
    447                 StateAttribute::GLMode mode; 
     447                StateAttribute::GLMode mode=0; 
    448448                if (s_ModesAndNames.getGLModeForName(fr[0].getStr(), mode)) 
    449449                { 
     
    524524                    if (StateSet_matchModeStr(fr[1].getStr(),value)) 
    525525                    { 
    526                         StateAttribute::GLMode mode; 
     526                        StateAttribute::GLMode mode=0; 
    527527                        if (s_ModesAndNames.getGLModeForName(fr[0].getStr(), mode)) 
    528528                        {