summaryrefslogtreecommitdiff
path: root/liveengine/src/layers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'liveengine/src/layers.cpp')
-rwxr-xr-xliveengine/src/layers.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/liveengine/src/layers.cpp b/liveengine/src/layers.cpp
index ad251ea..e69023b 100755
--- a/liveengine/src/layers.cpp
+++ b/liveengine/src/layers.cpp
@@ -19,23 +19,23 @@ void svglayer::load(string _f){
}
isLoaded= (svg.getNumPath()>0);
}
-void svglayer::getCentre() {
+void svglayer::getCentre(int cx,int cy) {
if (svg.getNumPath()>0) {
- xo=(ofGetWidth()-svg.getWidth())/2;
- yo=(ofGetHeight()-svg.getHeight())/2;
+ xo=(cx-svg.getWidth())/2;
+ yo=(cy-svg.getHeight())/2;
}
}
-void svglayer::draw(float a) {
- getCentre();
+void svglayer::draw(float a,int cx,int cy) {
+ getCentre(cx,cy);
for (int i=0;i<svg.getNumPath();i++) {
svg.getPathAt(i).setFillColor(fills[i]*a);
svg.getPathAt(i).draw(xo,yo);
}
}
-void svglayer::draw(float a,unsigned char* controllers,bool transparentBlack) {
- getCentre();
+void svglayer::draw(float a,unsigned char* controllers,int cx,int cy,bool transparentBlack) {
+ getCentre(cx,cy);
//draw layers tinted by controllers
for (int i=0;i<svg.getNumPath();i++) {
float h=fills[i].getHue();
@@ -77,14 +77,14 @@ WTF is going on with the image drawing
*/
-void imglayer::draw(float a) {
+void imglayer::draw(float a,int cx,int cy) {
//if (img.isAllocated()) if (!img.isUsingTexture()) img.setUseTexture(true); //has to be done from the main thread? still doesn't work
img.draw(0,0,ofGetWidth(),ofGetHeight());
printf("drawing %f\n",ofGetElapsedTimef());
}
-void imglayer::draw(float a,unsigned char* controllers) {
- imglayer::draw(a);
+void imglayer::draw(float a,unsigned char* controllers,int cx,int cy,bool transparentBlack=false) {
+ imglayer::draw(a,cx,cy);
}