Changeset 4643


Ignore:
Timestamp:
Oct 3, 2014 1:18:26 PM (10 years ago)
Author:
ldelgass
Message:

Fixes for building with osgearth 2.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • geovis/trunk/Renderer.cpp

    r4636 r4643  
    5050#include <osgEarthAnnotation/ScaleDecoration>
    5151#include <osgEarthUtil/EarthManipulator>
    52 #if defined(USE_OSGEARTH_TRUNK) || OSGEARTH_MIN_VERSION_REQUIRED(2, 5, 1)
     52#if OSGEARTH_MIN_VERSION_REQUIRED(2, 5, 1)
    5353#include <osgEarthUtil/Sky>
     54#include <osgEarthDrivers/sky_simple/SimpleSkyOptions>
    5455#else
    5556#include <osgEarthUtil/SkyNode>
     
    406407    _hbox->addControl(_scaleLabel.get());
    407408    _hbox->addControl(_scaleBar.get());
    408 #ifdef USE_OSGEARTH_TRUNK
     409#if OSGEARTH_MIN_VERSION_REQUIRED(2, 5, 1)
    409410    osgEarth::Util::Controls::ControlCanvas::getOrCreate(_viewer.get())->addControl(_hbox.get());
    410411#else
     
    488489            osgEarth::Util::Controls::LabelControl *readout =
    489490                _coordsCallback->getLabel();
    490 #ifdef USE_OSGEARTH_TRUNK
     491#if OSGEARTH_MIN_VERSION_REQUIRED(2, 5, 1)
    491492            osgEarth::Util::Controls::ControlCanvas::getOrCreate(_viewer.get())->removeControl(readout);
    492493#else
     
    537538    } else {
    538539        readout = new osgEarth::Util::Controls::LabelControl("", 12.0f);
    539 #ifdef USE_OSGEARTH_TRUNK
     540#if OSGEARTH_MIN_VERSION_REQUIRED(2, 5, 1)
    540541        osgEarth::Util::Controls::ControlCanvas::getOrCreate(_viewer.get())->addControl(readout);
    541542#else
     
    691692    bopts.url() = getBaseImage();
    692693    addImageLayer("base", bopts);
    693 #ifdef USE_OSGEARTH_TRUNK
     694#if OSGEARTH_MIN_VERSION_REQUIRED(2, 5, 1)
    694695    osgEarth::Drivers::MPTerrainEngine::MPTerrainEngineOptions mpOpt;
    695696#else
     
    704705    // Sets GL_LIGHTING state in MapNode's StateSet (config var defaults to true)
    705706    mapNodeOpts.enableLighting() = true;
     707    //mapNodeOpts.getTerrainOptions().loadingPolicy().mapLoadingThreadsPerCore() = 1;
     708    //mapNodeOpts.getTerrainOptions().loadingPolicy().numLoadingThreads() = 1;
     709    //mapNodeOpts.getTerrainOptions().loadingPolicy().numCompileThreadsPerCore() = 1;
     710    //mapNodeOpts.getTerrainOptions().loadingPolicy().numCompileThreads() = 1;
    706711    osgEarth::MapNode *mapNode = new osgEarth::MapNode(map, mapNodeOpts);
    707712    _mapNode = mapNode;
    708713    if (_map->isGeocentric()) {
    709714        osgEarth::DateTime now;
    710 #if defined(USE_OSGEARTH_TRUNK) || OSGEARTH_MIN_VERSION_REQUIRED(2, 5, 1)
     715#if OSGEARTH_MIN_VERSION_REQUIRED(2, 5, 1)
    711716        TRACE("Creating SkyNode");
    712         osgEarth::Util::SkyOptions skyOpts;
    713         skyOpts.setDriver("gl");
     717        osgEarth::Drivers::SimpleSky::SimpleSkyOptions skyOpts;
    714718        skyOpts.hours() = now.hours();
    715719        skyOpts.ambient() = 0.2f;
     720        skyOpts.atmosphericLighting() = true;
     721        skyOpts.exposure() = 3.0;
    716722        osgEarth::Util::SkyNode *sky = osgEarth::Util::SkyNode::create(skyOpts, mapNode);
    717723        sky->addChild(mapNode);
     
    10791085    }
    10801086    osgEarth::ImageLayerOptions layerOpts(name, opts);
    1081 #ifdef USE_OSGEARTH_TRUNK
     1087#if OSGEARTH_MIN_VERSION_REQUIRED(2, 5, 1)
    10821088    layerOpts.textureCompression() = osg::Texture::USE_IMAGE_DATA_FORMAT;
    10831089#endif
Note: See TracChangeset for help on using the changeset viewer.