Changeset 888

Show
Ignore:
Timestamp:
03/07/08 21:54:47
Author:
robert
Message:

Changed the baseLayer/baseTexture setting so that it takes the highest valid imager/texture as the one to inherit into empty layers

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/vpb/Destination.cpp

    r886 r888  
    10541054    _stateset = new osg::StateSet; 
    10551055 
     1056    bool updateBaseTextureToCurrentValidImage = true; 
    10561057    osg::Texture* baseTexture = 0; 
    10571058    for(layerNum=0; 
     
    10781079        osg::Texture2D* texture = new osg::Texture2D; 
    10791080         
    1080         if (baseTexture==0) baseTexture=texture; 
     1081        if (updateBaseTextureToCurrentValidImage || baseTexture==0) baseTexture=texture; 
    10811082         
    10821083        texture->setImage(image); 
     
    11801181    // now fill in any blank texture units. 
    11811182    bool fillInAllTextureUnits = true; 
    1182     if (fillInAllTextureUnits && baseTexture
     1183    if (fillInAllTextureUnits
    11831184    { 
    11841185        for(layerNum=0; 
     
    11911192            { 
    11921193                ImageData& imageData = _imagery[layerNum]; 
    1193                 if (!imageData._imagery.valid() ||  
    1194                     !imageData._imagery->_image.valid()) applyBaseTexture=true; 
     1194                if (!imageData._imagery.valid() || !imageData._imagery->_image.valid())  
     1195                { 
     1196                    applyBaseTexture=true; 
     1197                } 
    11951198            } 
    11961199            if (applyBaseTexture)         
     
    14281431 
    14291432    osgTerrain::ImageLayer* baseLayer = 0; 
     1433    bool updateLayerTextureToCurrentValidLayer = true; 
    14301434     
    14311435    // assign the imagery 
     
    14451449            terrain->setColorLayer(layerNum, imageLayer); 
    14461450 
    1447             if (!baseLayer
     1451            if (updateLayerTextureToCurrentValidLayer || baseLayer==0
    14481452            { 
    14491453                baseLayer = imageLayer;