aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/objects.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2008-07-28 08:56:37 +0000
committerNicola Mettifogo2008-07-28 08:56:37 +0000
commitc6cbf1f144110ab2d754e42032036018768ef9ff (patch)
tree7bacb7bda4bc13b9919f72c33eb4b9cd4c877737 /engines/parallaction/objects.cpp
parent16fe053ab4535865b7f52a274cc886a682caf7d4 (diff)
downloadscummvm-rg350-c6cbf1f144110ab2d754e42032036018768ef9ff.tar.gz
scummvm-rg350-c6cbf1f144110ab2d754e42032036018768ef9ff.tar.bz2
scummvm-rg350-c6cbf1f144110ab2d754e42032036018768ef9ff.zip
Added a post processing step to runScripts, so that Animation can be validated after buggy scripts have been executed.
svn-id: r33363
Diffstat (limited to 'engines/parallaction/objects.cpp')
-rw-r--r--engines/parallaction/objects.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp
index e04a7d5342..c387484de7 100644
--- a/engines/parallaction/objects.cpp
+++ b/engines/parallaction/objects.cpp
@@ -81,6 +81,12 @@ byte* Animation::getFrameData(uint32 index) const {
return gfxobj->getData(index);
}
+void Animation::validateScriptVars() {
+ // this is used to clip values of _frame, _left and _top
+ // which can be screwed up by buggy scripts.
+
+ _frame = CLIP(_frame, (int16)0, (int16)(getFrameNum() - 1));
+}
#define NUM_LOCALS 10
char _localNames[NUM_LOCALS][10];