diff options
| author | Tim Redfern <tim@eclectronics.org> | 2012-09-15 17:38:00 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2012-09-15 17:38:00 +0100 |
| commit | 530bf6501e6f13ed3e91d4d0e2763613146774a2 (patch) | |
| tree | 3bf4f0ba78842c4e6cb74dc0a62b154b64b890cf /liveengine/src/layers.cpp | |
| parent | 4fda3af17e55c0afff35b3f3ebbe5b4fd1ffad7e (diff) | |
performance 2.0
Diffstat (limited to 'liveengine/src/layers.cpp')
| -rwxr-xr-x | liveengine/src/layers.cpp | 20 |
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);
} |
