Somewhere along the way into the function animationWithFrames, my vector loses its items.
This is actually a CCMutableArray which is a thin wrapper around std::vector.
template<class T = CCObject*>
class CCMutableArray : public CCObject
{
public:
typedef std::vector<T> CCObjectArray;
typedef typename CCObjectArray::iterator CCMutableArrayIterator;
typedef typename CCObjectArray::reverse_iterator CCMutableArrayRevIterator;
public:
// ... helper functions ...
private:
std::vector<T> m_array;
};
What I don’t get is, when I send the variable frames into the function, the debugger accepts that it has a variable m_array with 2 items in it.
But inside the function the variables seem to enter “ghost” form.
frames contains:
m_array=[ 2 ](0x051d5078 ... )
but expanding, m_array contains
[0]().
What would cause the debugger to be inconsistent like this?
The code, by the way, does not see the items. They’ve vanished in transit. That’s the problem.
Visual Studio 2010. Worked fine in 2008. I may downgrade in order to do some work.


This turned out to be a totally stupid issue where I was apparently linking in the 2008 build of cocos2d-x into the 2010 project.
The debugger didn’t like that very much.
Rebuilding cocos2d-x inside 2010 make the problem go away and all was well.