diff --git a/simgear/scene/tgdb/TileEntry.cxx b/simgear/scene/tgdb/TileEntry.cxx index f139d145..47a72052 100644 --- a/simgear/scene/tgdb/TileEntry.cxx +++ b/simgear/scene/tgdb/TileEntry.cxx @@ -297,13 +297,8 @@ TileEntry::loadTileByFileName(const string& fileName, } } - const SGReaderWriterOptions* btgOpt; - btgOpt = dynamic_cast(options); osg::ref_ptr opt; - if (btgOpt) - opt = new SGReaderWriterOptions(*btgOpt); - else - opt = new SGReaderWriterOptions; + opt = SGReaderWriterOptions::copyOrCreate(options); // obj_load() will generate ground lighting for us ... osg::Group* new_tile = new osg::Group;