T2D 1.1 Alpha) Console warning for single frame animations...
by Jason Cahill · in Torque Game Builder · 11/26/2005 (2:06 pm) · 6 replies
This "bug" has no ill effects, but repros consistently on any animation that's 1 frame. In the console I see:
To "fix" the issue, I simply use two frames with the same number (e.g., animationFrames = "40 40"). This eliminates the warning. Leaving it with just animationFrames = "40" causes the warning but no ill effect. Also, setting startFrame = "0" causes a different console warning.
It appears that the bug is here (t2dAnimationController.cc like 317):
I suspect that the error lies in the ">=". Debugging in, a single frame animation has mMaxFrameIndex = "0"... this should either be "1" or the ">=" should be a ">". Also, not specifying a startFrame assumes a value of the first animationFrame (in my example above, "40") as opposed to "0." Setting startFrame = "0" also fails because of the >=.
Anyway, no harm here, but thought I'd pass on the issue.
t2dAnimationController::playAnimation() - Animation Start-Frame Invalid; Starting at frame#0! (frame#0 of 0 in adbStandRight)
To "fix" the issue, I simply use two frames with the same number (e.g., animationFrames = "40 40"). This eliminates the warning. Leaving it with just animationFrames = "40" causes the warning but no ill effect. Also, setting startFrame = "0" causes a different console warning.
It appears that the bug is here (t2dAnimationController.cc like 317):
if ( mConfigDataBlock->mStartFrame < 0 || mConfigDataBlock->mStartFrame >= mMaxFrameIndex )
I suspect that the error lies in the ">=". Debugging in, a single frame animation has mMaxFrameIndex = "0"... this should either be "1" or the ">=" should be a ">". Also, not specifying a startFrame assumes a value of the first animationFrame (in my example above, "40") as opposed to "0." Setting startFrame = "0" also fails because of the >=.
Anyway, no harm here, but thought I'd pass on the issue.
About the author
#2
In the meantime I commented out this warn :)
In t2dAnimationController.cc 319
11/28/2005 (11:39 am)
I'm heavily using the console's log, and this bother me...In the meantime I commented out this warn :)
In t2dAnimationController.cc 319
// No, so warn.
////Con::warnf("t2dAnimationController::playAnimation() - Animation Start-Frame ...
#3
Am I missing something?
11/28/2005 (11:57 am)
OK, maybe I'm being a little dense here, but if you only have one frame of animation, then you're not really an animated sprite, so why souldn't you use a static sprite instead? Even if you were place holding and were going to add additional frames of animation later, would be handy to have the warning so you know which ones still need the additional frames added.Am I missing something?
#4
11/28/2005 (2:48 pm)
Yes, you are missing something. The basic model I use is one single animated sprite for the player character. It can either be animated (as in walking) or not animated (as in standing still). In any event, it is still the same, single animated sprite. When the character is standing still, my "stand" animation consists of a single frame.
#5
Thanks for the report. :)
- Melv.
01/04/2006 (10:10 am)
This problem has been fixed and will be in the next release.Thanks for the report. :)
- Melv.
#6
01/04/2006 (11:07 am)
Awesome. Thanks Melv!
Associate Melv May
This is issue #0000842.
- Melv.