From eb88e47020201deef27adb81da22b91579c9405c Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Tue, 17 Sep 2013 13:57:56 +0100 Subject: non blocking graph load --- rotord/src/graph.h | 1 + rotord/src/rendercontext.cpp | 70 +++++++++++++++++++++++++++++++++++++++++--- rotord/src/rendercontext.h | 3 ++ 3 files changed, 70 insertions(+), 4 deletions(-) diff --git a/rotord/src/graph.h b/rotord/src/graph.h index cbcc121..58861ac 100644 --- a/rotord/src/graph.h +++ b/rotord/src/graph.h @@ -34,6 +34,7 @@ namespace Rotor { delete n.second; } nodes.clear(); + loaded=false; } string uid; //every version of a graph has a UUID, no particular need to actually read its data(?) //?? is it faster than using strings?? diff --git a/rotord/src/rendercontext.cpp b/rotord/src/rendercontext.cpp index 62c60c0..d516cbd 100644 --- a/rotord/src/rendercontext.cpp +++ b/rotord/src/rendercontext.cpp @@ -48,6 +48,20 @@ void Render_context::runTask() { renders[cmd.uid].status=FAILED; } } + if(cmd.task==LOAD_GRAPH) { + state=LOADING_GRAPH; + if (graph_filename!="") { + if (!graph.loadFile(graph_filename,media_dir)){ + cerr<<"Rotor: failed to load graph from "<