Added a post processing step to runScripts, so that Animation can be validated after buggy scripts have been executed.

svn-id: r33363
This commit is contained in:
Nicola Mettifogo 2008-07-28 08:56:37 +00:00
parent 16fe053ab4
commit c6cbf1f144
3 changed files with 25 additions and 16 deletions

View file

@ -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];