summaryrefslogtreecommitdiff
path: root/src/mainwin.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-11-05 16:04:09 (GMT)
committerMarius Kintel <marius@kintel.net>2011-11-05 16:04:09 (GMT)
commit5466efe7ef89bb2e9925f8fccd6c752e3475bd93 (patch)
tree9fcec9fe4dcfce54764dc448e56744aaf7425bd9 /src/mainwin.cc
parent04bc3ed890451de881034fee9f000761c4f0e068 (diff)
bugfix: PI constant didn't work in cmd-line mode. refactored away duplicate code
Diffstat (limited to 'src/mainwin.cc')
-rw-r--r--src/mainwin.cc17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/mainwin.cc b/src/mainwin.cc
index 9944f67..a6f5be6 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -143,22 +143,7 @@ MainWindow::MainWindow(const QString &filename)
{
setupUi(this);
- root_ctx.functions_p = &builtin_functions;
- root_ctx.modules_p = &builtin_modules;
- root_ctx.set_variable("$fn", Value(0.0));
- root_ctx.set_variable("$fs", Value(1.0));
- root_ctx.set_variable("$fa", Value(12.0));
- root_ctx.set_variable("$t", Value(0.0));
-
- root_ctx.set_constant("PI",Value(M_PI));
-
- Value zero3;
- zero3.type = Value::VECTOR;
- zero3.append(new Value(0.0));
- zero3.append(new Value(0.0));
- zero3.append(new Value(0.0));
- root_ctx.set_variable("$vpt", zero3);
- root_ctx.set_variable("$vpr", zero3);
+ register_builtin(root_ctx);
root_module = NULL;
absolute_root_node = NULL;
contact: Jan Huwald // Impressum