diff options
author | Marius Kintel <marius@kintel.net> | 2011-09-09 03:53:05 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-09-09 03:53:05 (GMT) |
commit | cbba974d3ac1edeb716a1384a2262ed5447fa9e6 (patch) | |
tree | 30708ef085204435d644c4ab685b87556628d22a /src/surface.cc | |
parent | 328897c1f28e0d438aa678891f8d5a45b114f267 (diff) |
Initial attempt of cleaning up polyset handling. PolySet no longer keeps a refcount, basic cache mechanism is in place, instantiating polysets are controlled through PolySetEvaluator
Diffstat (limited to 'src/surface.cc')
-rw-r--r-- | src/surface.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/surface.cc b/src/surface.cc index 22598bf..35449ed 100644 --- a/src/surface.cc +++ b/src/surface.cc @@ -62,7 +62,7 @@ public: std::string filename; bool center; int convexity; - virtual PolySet *evaluate_polyset(render_mode_e mode, class PolySetEvaluator *) const; + virtual PolySet *evaluate_polyset(class PolySetEvaluator *) const; }; AbstractNode *SurfaceModule::evaluate(const Context *ctx, const ModuleInstantiation *inst) const @@ -98,17 +98,17 @@ void register_builtin_surface() builtin_modules["surface"] = new SurfaceModule(); } -PolySet *SurfaceNode::evaluate_polyset(render_mode_e, class PolySetEvaluator *) const +PolySet *SurfaceNode::evaluate_polyset(class PolySetEvaluator *) const { - PolySet *p = new PolySet(); handle_dep(filename); QFile f(QString::fromStdString(filename)); if (!f.open(QIODevice::ReadOnly | QIODevice::Text)) { PRINTF("WARNING: Can't open DAT file `%s'.", filename.c_str()); - return p; + return NULL; } + PolySet *p = new PolySet(); int lines = 0, columns = 0; boost::unordered_map<std::pair<int,int>,double> data; double min_val = 0; |