Example #1
0
void CAnimImage::init()
{
	anim->load(frame, group);
	if (flags & CShowableAnim::BASE)
		anim->load(0,group);

	IImage *img = anim->getImage(frame, group);
	if (img)
	{
		pos.w = img->width();
		pos.h = img->height();
	}
}
Example #2
0
void CAnimImage::setFrame(size_t Frame, size_t Group)
{
	if (frame == Frame && group==Group)
		return;
	if (anim->size(Group) > Frame)
	{
		anim->load(Frame, Group);
		anim->unload(frame, group);
		frame = Frame;
		group = Group;
		IImage *img = anim->getImage(frame, group);
		if (img)
		{
			if (flags & CShowableAnim::PLAYER_COLORED)
				img->playerColored(player);
			pos.w = img->width();
			pos.h = img->height();
		}
	}
	else
		logGlobal->errorStream() << "Error: accessing unavailable frame " << Group << ":" << Frame << " in CAnimation!";
}