static void DrawObjective(
	UIObject *o, GraphicsDevice *g, Vec2i pos, void *vData)
{
	UNUSED(g);
	EditorBrushAndCampaign *data = vData;
	Mission *m = CampaignGetCurrentMission(data->Campaign);
	const Objective *obj = CArrayGet(&m->Objectives, data->Brush.u.ItemIndex);
	CharacterStore *store = &data->Campaign->Setting.characters;
	pos = Vec2iAdd(Vec2iAdd(pos, o->Pos), Vec2iScaleDiv(o->Size, 2));
	switch (obj->Type)
	{
	case OBJECTIVE_KILL:
		{
			Character *c = CArrayGet(
				&store->OtherChars,
				CharacterStoreGetSpecialId(store, data->Brush.Index2));
			DrawCharacterSimple(c, pos, DIRECTION_DOWN, false, false);
		}
		break;
	case OBJECTIVE_RESCUE:
		{
			Character *c = CArrayGet(
				&store->OtherChars,
				CharacterStoreGetPrisonerId(store, data->Brush.Index2));
			DrawCharacterSimple(c, pos, DIRECTION_DOWN, false, false);
		}
		break;
	case OBJECTIVE_COLLECT:
		{
			const Pic *p = obj->u.Pickup->Pic;
			pos = Vec2iMinus(pos, Vec2iScaleDiv(p->size, 2));
			Blit(&gGraphicsDevice, p, pos);
		}
		break;
	case OBJECTIVE_DESTROY:
		DisplayMapItem(pos, obj->u.MapObject);
		break;
	default:
		assert(0 && "invalid objective type");
		break;
	}
}
static void DrawCharacter(
	UIObject *o, GraphicsDevice *g, Vec2i pos, void *vData)
{
	UNUSED(g);
	EditorBrushAndCampaign *data = vData;
	CharacterStore *store = &data->Campaign->Setting.characters;
	Character *c = CArrayGet(&store->OtherChars, data->Brush.u.ItemIndex);
	DrawCharacterSimple(
		c,
		Vec2iAdd(Vec2iAdd(pos, o->Pos), Vec2iScaleDiv(o->Size, 2)),
		DIRECTION_DOWN, false, false);
}
Esempio n. 3
0
// Display a character and the player name above it, with the character
// centered around the target position
void DisplayCharacterAndName(Vec2i pos, Character *c, char *name)
{
	Vec2i namePos;
	// Move the point down a bit since the default character draw point is at
	// its feet
	pos.y += 8;
	namePos = Vec2iAdd(pos, Vec2iNew(-FontStrW(name) / 2, -30));
	DrawCharacterSimple(
		c, pos,
		DIRECTION_DOWN, STATE_IDLE, -1, GUNSTATE_READY, &c->table);
	FontStr(name, namePos);
}
Esempio n. 4
0
void DisplayCharacter(
    const Vec2i pos, const Character *c, const bool hilite, const bool showGun)
{
    DrawCharacterSimple(
        c, pos,
        DIRECTION_DOWN, STATE_IDLE, -1, GUNSTATE_READY, &c->table);
    if (hilite)
    {
        FontCh('>', Vec2iAdd(pos, Vec2iNew(-8, -16)));
        if (showGun)
        {
            FontStr(c->Gun->name, Vec2iAdd(pos, Vec2iNew(-8, 8)));
        }
    }
}
Esempio n. 5
0
void DisplayCharacter(Vec2i pos, Character *c, int hilite, int showGun)
{
	DrawCharacterSimple(
		c, pos,
		DIRECTION_DOWN, STATE_IDLE, -1, GUNSTATE_READY, &c->table);
	if (hilite)
	{
		CDogsTextGoto(pos.x - 8, pos.y - 16);
		CDogsTextChar('\020');
		if (showGun)
		{
			CDogsTextGoto(pos.x - 8, pos.y + 8);
			CDogsTextString(c->Gun->name);
		}
	}
}
Esempio n. 6
0
void DisplayPlayer(int x, const char *name, Character *c, int editingName)
{
	Vec2i pos = Vec2iNew(x, gGraphicsDevice.cachedConfig.Res.y / 10);
	Vec2i playerPos = Vec2iAdd(pos, Vec2iNew(20, 36));

	if (editingName)
	{
		char s[22];
		sprintf(s, "%c%s%c", '\020', name, '\021');
		CDogsTextStringAt(pos.x, pos.y, s);
	}
	else
	{
		CDogsTextStringAt(pos.x, pos.y, name);
	}

	DrawCharacterSimple(
		c, playerPos,
		DIRECTION_DOWN, STATE_IDLE, -1, GUNSTATE_READY, &c->table);
}