From 569255873355a1c7a01ad21327001ed506df5a9c Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 22 Jan 2009 03:07:14 +0000 Subject: [PATCH] main/Scene applying command-line options after loading input file git-svn-id: svn://anubis/fart/trunk@25 7f9b0f55-74a9-4bce-be96-3c2cd072584d --- main/Scene.cc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/main/Scene.cc b/main/Scene.cc index 416f95a..7df0b48 100644 --- a/main/Scene.cc +++ b/main/Scene.cc @@ -1,5 +1,6 @@ #include "Scene.h" +#include #include #include #include "BMP.h" @@ -16,6 +17,33 @@ Scene::Scene(map options, m_data = NULL; load(filename); + + /* after loading the scene file, apply any command-line render options */ + for (map::iterator it = options.begin(); + it != options.end(); + it++) + { + if (it->first == "width") + { + m_width = atoi(it->second); + } + else if (it->first == "height") + { + m_height = atoi(it->second); + } + else if (it->first == "multisample") + { + m_multisample_level = atoi(it->second); + } + else if (it->first == "output-file") + { + m_output_file_name = it->second; + } + else if (it->first == "verbose") + { + m_verbose = true; + } + } } Scene::~Scene()