From 6cd4dbfac4e89f5bbb14297f46beab776be8add3 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 8 Jun 2006 11:19:24 +0000 Subject: [PATCH] Added setting of default colour. --- applications/osgdem/osgdem.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/applications/osgdem/osgdem.cpp b/applications/osgdem/osgdem.cpp index e1b03aa96..49e13887a 100644 --- a/applications/osgdem/osgdem.cpp +++ b/applications/osgdem/osgdem.cpp @@ -190,6 +190,7 @@ int main( int argc, char **argv ) arguments.getApplicationUsage()->addCommandLineOption("--RGBA","Use 32bit RGBA destination imagery"); arguments.getApplicationUsage()->addCommandLineOption("--max-visible-distance-of-top-level","Set the maximum visible distance that the top most tile can be viewed at"); arguments.getApplicationUsage()->addCommandLineOption("--no-terrain-simplification","Switch off terrain simplification."); + arguments.getApplicationUsage()->addCommandLineOption("--default-color ","Sets the default color of the terrain."); arguments.getApplicationUsage()->addCommandLineOption("--radius-to-max-visible-distance-ratio","Set the maximum visible distance ratio for all tiles apart from the top most tile. The maximum visuble distance is computed from the ratio * tile radius."); arguments.getApplicationUsage()->addCommandLineOption("--no-mip-mapping","Disable mip mapping of textures"); arguments.getApplicationUsage()->addCommandLineOption("--mip-mapping-hardware","Use mip mapped textures, and generate the mipmaps in hardware when available."); @@ -307,6 +308,20 @@ int main( int argc, char **argv ) dataset->setSimplifyTerrain(false); } + std::string str; + while (arguments.read("--default-color",str) || + arguments.read("--default_color",str)) + { + osg::Vec4 defaultColor; + if( sscanf( str.c_str(), "%f,%f,%f,%f", + &defaultColor[0], &defaultColor[1], &defaultColor[2], &defaultColor[3] ) != 4 ) + { + std::cout<<"Color argument format incorrect."<setDefaultColor(defaultColor); + } + std::string image_ext; while (arguments.read("--image-ext",image_ext)) {