Exemplo n.º 1
0
MyAnimationTrack::~MyAnimationTrack()
{
	keyframeIndices->clear();
	MyDelete(keyframeIndices);

	for (std::vector<MyKeyframe *>::iterator it = frames->begin(); it != frames->end(); ++it)
	{
		MyDelete(*it);
	}
	frames->clear();
	MyDelete(frames);
}
Exemplo n.º 2
0
void MyAnimationTrack::RemoveKeyFrame(unsigned int index)
{
	if (index != 0 && index < frames->size())
	{
		keyframeIndices->remove(index);
		MyDelete((*frames)[index]);
	}
}
Exemplo n.º 3
0
void MyAnimationTrack::SetFrameCount(unsigned int const & frameCount)
{
	while (frames->size() < frameCount)
	{
		frames->push_back(0);
	}
	while (frames->size() > frameCount)
	{
		MyDelete((*frames)[frames->size() - 1]);
		frames->pop_back();
	}
}
Exemplo n.º 4
0
void MyAnimationTrack::AddKeyFrame(unsigned int index, MyKeyframe * keyFrame)
{
	if (index < frames->size())
	{
		bool push = false;
		if (keyframeIndices->size() == 0)
		{
			keyframeIndices->push_back(index);
		}
		else
		{
			for (std::list<unsigned int>::iterator it = keyframeIndices->begin(); it != keyframeIndices->end(); ++it)
			{
				if (index == *it)
				{
					break;
				}
				if (index < *it)
				{
					keyframeIndices->insert(it, index);
					break;
				}
				if (std::next(it) == keyframeIndices->end())
				{
					push = true;
				}
			}
		}
		if (push)
		{
			keyframeIndices->push_back(index);
		}
		MyDelete((*frames)[index]);
		(*frames)[index] = keyFrame;
	}
}
Exemplo n.º 5
0
void operator delete(void *pPointer, char *szFile, int nLine)
{
	MyDelete(pPointer);
}
Exemplo n.º 6
0
void operator delete[](void *pPointer)
{
	MyDelete(pPointer);
}
void operator delete[](void * p, const char *file, int line)  
{  
	MyDelete(p, file, line);
}
void operator delete[](void * p)  
{  
	MyDelete(p);
}