summaryrefslogtreecommitdiff
path: root/src/mainwin.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/mainwin.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/mainwin.cc')
-rw-r--r--src/mainwin.cc22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/mainwin.cc b/src/mainwin.cc
index bb0f90d..daea6e3 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -972,19 +972,17 @@ void MainWindow::updateTemporalVariables()
{
this->root_ctx.set_variable("$t", Value(this->e_tval->text().toDouble()));
- Value vpt;
- vpt.type = Value::VECTOR;
- vpt.append(new Value(-this->glview->object_trans_x));
- vpt.append(new Value(-this->glview->object_trans_y));
- vpt.append(new Value(-this->glview->object_trans_z));
- this->root_ctx.set_variable("$vpt", vpt);
+ Value::VectorType vpt;
+ vpt.push_back(Value(-this->glview->object_trans_x));
+ vpt.push_back(Value(-this->glview->object_trans_y));
+ vpt.push_back(Value(-this->glview->object_trans_z));
+ this->root_ctx.set_variable("$vpt", Value(vpt));
- Value vpr;
- vpr.type = Value::VECTOR;
- vpr.append(new Value(fmodf(360 - this->glview->object_rot_x + 90, 360)));
- vpr.append(new Value(fmodf(360 - this->glview->object_rot_y, 360)));
- vpr.append(new Value(fmodf(360 - this->glview->object_rot_z, 360)));
- root_ctx.set_variable("$vpr", vpr);
+ Value::VectorType vpr;
+ vpr.push_back(Value(fmodf(360 - this->glview->object_rot_x + 90, 360)));
+ vpr.push_back(Value(fmodf(360 - this->glview->object_rot_y, 360)));
+ vpr.push_back(Value(fmodf(360 - this->glview->object_rot_z, 360)));
+ root_ctx.set_variable("$vpr", Value(vpr));
}
bool MainWindow::fileChangedOnDisk()
contact: Jan Huwald // Impressum