summaryrefslogtreecommitdiff
path: root/src/surface.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2012-03-27 22:05:00 (GMT)
committerMarius Kintel <marius@kintel.net>2012-03-27 22:05:58 (GMT)
commit327310f190bbd81c7b71b568d5bf72bb900cc9db (patch)
tree9399bb490ecafe9f0c7fd209c680311d829eb631 /src/surface.cc
parent4394c7a030ce7a08c95bd1af2e8c38ffcf972439 (diff)
Rewrote the Value class to be based on boost::variant - this should reduce memory footprint and improve performance
Diffstat (limited to 'src/surface.cc')
-rw-r--r--src/surface.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/surface.cc b/src/surface.cc
index e927beb..756ad74 100644
--- a/src/surface.cc
+++ b/src/surface.cc
@@ -79,16 +79,17 @@ AbstractNode *SurfaceModule::evaluate(const Context *ctx, const ModuleInstantiat
Context c(ctx);
c.args(argnames, argexpr, inst->argnames, inst->argvalues);
- node->filename = c.getAbsolutePath(c.lookup_variable("file").text);
+ Value fileval = c.lookup_variable("file");
+ node->filename = c.getAbsolutePath(fileval.isUndefined() ? "" : fileval.toString());
Value center = c.lookup_variable("center", true);
- if (center.type == Value::BOOL) {
- node->center = center.b;
+ if (center.type() == Value::BOOL) {
+ node->center = center.toBool();
}
Value convexity = c.lookup_variable("convexity", true);
- if (convexity.type == Value::NUMBER) {
- node->convexity = (int)convexity.num;
+ if (convexity.type() == Value::NUMBER) {
+ node->convexity = (int)convexity.toDouble();
}
return node;
contact: Jan Huwald // Impressum