=== modified file 'src/options.cpp'
@@ -36,6 +36,7 @@
bool Options::swap_buffers = true;
std::pair<int,int> Options::size(800, 600);
bool Options::list_scenes = false;
+bool Options::show_all_options = false;
bool Options::show_debug = false;
bool Options::show_help = false;
@@ -45,6 +46,7 @@
{"no-swap-buffers", 0, 0, 0},
{"size", 1, 0, 0},
{"list-scenes", 0, 0, 0},
+ {"show-all-options", 0, 0, 0},
{"debug", 0, 0, 0},
{"help", 0, 0, 0},
{0, 0, 0, 0}
@@ -93,6 +95,8 @@
" -s, --size WxH Size of the display (default: 800x600)\n"
" -l, --list-scenes Display information about the available scenes\n"
" and their options\n"
+ " --show-all-options Show all scene option values used for benchmarks\n"
+ " (only explicitly set options are shown by default)\n"
" -d, --debug Display debug messages\n"
" -h, --help Display help\n");
}
@@ -125,6 +129,8 @@
parse_size(optarg, Options::size);
else if (c == 'l' || !strcmp(optname, "list-scenes"))
Options::list_scenes = true;
+ else if (!strcmp(optname, "show-all-options"))
+ Options::show_all_options = true;
else if (c == 'd' || !strcmp(optname, "debug"))
Options::show_debug = true;
else if (c == 'h' || !strcmp(optname, "help"))
=== modified file 'src/options.h'
@@ -36,6 +36,7 @@
static bool swap_buffers;
static std::pair<int,int> size;
static bool list_scenes;
+ static bool show_all_options;
static bool show_debug;
static bool show_help;
};
=== modified file 'src/scene.cpp'
@@ -24,6 +24,7 @@
#include "scene.h"
#include "log.h"
#include "shader-source.h"
+#include "options.h"
#include <sstream>
#include <cmath>
#include <sys/time.h>
@@ -119,6 +120,7 @@
return false;
iter->second.value = val;
+ iter->second.set = true;
return true;
}
@@ -133,6 +135,7 @@
Option &opt = iter->second;
opt.value = opt.default_value;
+ opt.set = false;
}
}
@@ -160,8 +163,14 @@
iter != mOptions.end();
iter++)
{
- ss << iter->first << "=" << iter->second.value << ":";
+ if (Options::show_all_options || iter->second.set)
+ {
+ ss << iter->first << "=" << iter->second.value << ":";
+ }
}
+
+ if (ss.str().empty())
+ ss << "<default>:";
}
else
ss << title;
=== modified file 'src/scene.h'
@@ -46,12 +46,13 @@
struct Option {
Option(const std::string &nam, const std::string &val, const std::string &desc) :
- name(nam), value(val), default_value(val), description(desc) {}
+ name(nam), value(val), default_value(val), description(desc), set(false) {}
Option() {}
std::string name;
std::string value;
std::string default_value;
std::string description;
+ bool set;
};
enum ValidationResult {