diff options
Diffstat (limited to 'liveengine/src')
| -rw-r--r-- | liveengine/src/layers.cpp | 10 | ||||
| -rw-r--r-- | liveengine/src/layers.h | 6 | ||||
| -rw-r--r-- | liveengine/src/main.cpp | 2 | ||||
| -rw-r--r-- | liveengine/src/playlist.cpp | 10 |
4 files changed, 18 insertions, 10 deletions
diff --git a/liveengine/src/layers.cpp b/liveengine/src/layers.cpp index d2698ef..d7c7d77 100644 --- a/liveengine/src/layers.cpp +++ b/liveengine/src/layers.cpp @@ -8,7 +8,8 @@ svglayer::svglayer(string _f) load(_f);
}
-void svglayer::load(string _f){
+int svglayer::load(string _f){ + //check if files exits
svg.load(_f);
printf("%i paths\n",svg.getNumPath());
for (int i=0;i<svg.getNumPath();i++) { @@ -16,8 +17,11 @@ void svglayer::load(string _f){ strokes.push_back(svg.getPathAt(i).getStrokeColor());
printf(" path %i: fill %08x stroke %08x\n",i,svg.getPathAt(i).getFillColor().getHex(),svg.getPathAt(i).getStrokeColor().getHex());
} - xo=(ofGetWidth()-svg.getWidth())/2; - yo=(ofGetHeight()-svg.getHeight())/2;
+ if (svg.getNumPath()>0) { + xo=(ofGetWidth()-svg.getWidth())/2; + yo=(ofGetHeight()-svg.getHeight())/2; + } + isLoaded= (svg.getNumPath()>0);
}
void svglayer::draw(float a) {
diff --git a/liveengine/src/layers.h b/liveengine/src/layers.h index 11e50ab..2ebbd53 100644 --- a/liveengine/src/layers.h +++ b/liveengine/src/layers.h @@ -11,9 +11,11 @@ class layer virtual ~layer(){};
virtual void load(string _f){};
virtual void draw(float a){}; - virtual void draw(float a,unsigned char* controllers){ draw(a);};
+ virtual void draw(float a,unsigned char* controllers){ draw(a);}; + virtual bool getLoaded();
protected:
- private:
+ private: + bool isLoaded;
};
class svglayer: public layer
diff --git a/liveengine/src/main.cpp b/liveengine/src/main.cpp index 192f275..41470a2 100644 --- a/liveengine/src/main.cpp +++ b/liveengine/src/main.cpp @@ -6,7 +6,7 @@ int main( ){ ofAppGlutWindow window; - ofSetupOpenGL(&window, 1024,768, OF_FULLSCREEN); // <-------- setup the GL context + ofSetupOpenGL(&window, 1024,768, OF_WINDOW); // <-------- setup the GL context //ofSetupOpenGL(&window, 1024,768, OF_WINDOW); // this kicks off the running of my app diff --git a/liveengine/src/playlist.cpp b/liveengine/src/playlist.cpp index 3063595..af44940 100644 --- a/liveengine/src/playlist.cpp +++ b/liveengine/src/playlist.cpp @@ -39,9 +39,10 @@ void playlist::loadsvg(){ layers[XML.getAttribute("svglayer", "note", 0,i)]=new svglayer(XML.getAttribute("svglayer", "file", "",i));
}
}
- else printf("no SVG layers loaded!\n");
+ else printf("no SVG layers loaded!\n"); + XML.popTag();
} - XML.popTag(); + } void playlist::loadimg(){ @@ -56,9 +57,10 @@ void playlist::loadimg(){ layers[XML.getAttribute("imglayer", "note", 0,i)]=new imglayer(XML.getAttribute("imglayer", "file", "",i));
}
}
- else printf("no IMG layers loaded!\n");
+ else printf("no IMG layers loaded!\n"); + XML.popTag();
} - XML.popTag(); + } playlist::~playlist()
|
