示例#1
0
void DrawHead(
	const Character *c, const direction_e dir, const Vec2i pos)
{
	const Pic *head = GetHeadPic(c->Class, dir, GUNSTATE_READY);
	const Vec2i drawPos = Vec2iMinus(pos, Vec2iNew(
		head->size.x / 2, head->size.y / 2));
	BlitCharMultichannel(&gGraphicsDevice, head, drawPos, &c->Colors);
}
示例#2
0
void DrawActorPics(
	const ActorPics *pics, const Vec2i picPos, const direction_e d)
{
	if (pics->IsDead)
	{
		if (pics->IsDying)
		{
			DrawBody(&gGraphicsDevice, pics, picPos);
		}
	}
	else
	{
		// Draw shadow
		if (!pics->IsTransparent)
		{
			DrawShadow(&gGraphicsDevice, picPos, Vec2iNew(8, 6));
		}
		for (int i = 0; i < 3; i++)
		{
			const Pic *picp = NULL;
			switch (pics->DrawOrder[i])
			{
			case BODY_PART_HEAD:
				picp = pics->Head;
				break;
			case BODY_PART_BODY:
				picp = pics->Body;
				break;
			case BODY_PART_GUN:
				picp = pics->Gun;
				break;
			}
			if (picp == NULL)
			{
				continue;
			}
			const Vec2i drawPos = GetActorDrawOffset(
				picPos, picp, pics->DrawOrder[i], d);
			if (pics->IsTransparent)
			{
				BlitBackground(
					&gGraphicsDevice, picp, drawPos, pics->Tint, true);
			}
			else if (pics->Mask != NULL)
			{
				BlitMasked(&gGraphicsDevice, picp, drawPos, *pics->Mask, true);
			}
			else
			{
				BlitCharMultichannel(
					&gGraphicsDevice, picp, drawPos, pics->Colors);
			}
		}
	}
}
示例#3
0
void DrawActorPics(const ActorPics *pics, const Vec2i pos)
{
	if (pics->IsDead)
	{
		if (pics->IsDying)
		{
			DrawDyingBody(&gGraphicsDevice, pics, pos);
		}
	}
	else
	{
		// Draw shadow
		if (!pics->IsTransparent)
		{
			DrawShadow(&gGraphicsDevice, pos, Vec2iNew(8, 6));
		}
		for (int i = 0; i < BODY_PART_COUNT; i++)
		{
			const Pic *pic = pics->OrderedPics[i];
			if (pic == NULL)
			{
				continue;
			}
			const Vec2i drawPos = Vec2iAdd(pos, pics->OrderedOffsets[i]);
			if (pics->IsTransparent)
			{
				BlitBackground(
					&gGraphicsDevice, pic, drawPos, pics->Tint, true);
			}
			else if (pics->Mask != NULL)
			{
				BlitMasked(&gGraphicsDevice, pic, drawPos, *pics->Mask, true);
			}
			else
			{
				BlitCharMultichannel(
					&gGraphicsDevice, pic, drawPos, pics->Colors);
			}
		}
	}
}