diff options
| author | Tim Redfern <tim@gray.(none)> | 2012-11-22 11:00:03 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@gray.(none)> | 2012-11-22 11:00:03 +0000 |
| commit | 9dc429df9dbd1a5ae0f93d553ccfde7ab37a53a2 (patch) | |
| tree | c0891b8554cf6973aae12ade27bd85be2a1f6a09 /vfg/src/Puppet.cpp | |
| parent | b4d89c0a9029739d2af1705b371dc28f27b6d2dc (diff) | |
gameplay good: up against memory limit
Diffstat (limited to 'vfg/src/Puppet.cpp')
| -rwxr-xr-x | vfg/src/Puppet.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/vfg/src/Puppet.cpp b/vfg/src/Puppet.cpp index 0fd07a6..90ba137 100755 --- a/vfg/src/Puppet.cpp +++ b/vfg/src/Puppet.cpp @@ -21,8 +21,8 @@ void Puppet::load(string filename) { for (int i=0;i<XML.getNumTags("Clip");i++) {
string name=XML.getAttribute("Clip", "name","",i);
if (name!="") {
- clips[name]=ofxSprite();
- clips[name].load(XML.getAttribute("Clip", "files","",i),XML.getAttribute("Clip", "frames",0,i));
+ clips[name]=puppetSprite();
+ clips[name].load(XML.getAttribute("Clip", "files","",i),XML.getAttribute("Clip", "frames",0,i),XML.getAttribute("Clip", "start",0,i));
clips[name].setAnchorPercent(XML.getAttribute("Clip", "xAnchorPct",0.5,i),XML.getAttribute("Clip", "yAnchorPct",0.5,i));
clips[name].setFrameRate(XML.getAttribute("Clip", "rate",25,i));
clips[name].setLoop(false);
@@ -34,7 +34,7 @@ void Puppet::load(string filename) { }
}
-void Puppet::draw(float x, float y) {
+void Puppet::draw(float x, float y, float scale) {
if (playlist.size()>0) {
if (!clips[playlist[0]].getIsPlaying()) {
playlist.erase(playlist.begin());
@@ -44,11 +44,11 @@ void Puppet::draw(float x, float y) { }
}
if (playlist.size()==0) {
- if (clips.find("base") != clips.end()) clips["base"].draw(x,y);
+ if (clips.find("base") != clips.end()) clips["base"].draw(x,y,scale);
}
else {
clips[playlist[0]].update();
- clips[playlist[0]].draw(x,y);
+ clips[playlist[0]].draw(x,y,scale);
}
}
|
