Пример #1
0
static void restore_blends( buffer_vector<sblend_save>& buffer )
{
	buffer_vector<sblend_save>::iterator i = buffer.begin(), e = buffer.end();
	for(; i != e; ++i )
		(*i).restore();
	buffer.clear();
}
Пример #2
0
void UIPlayerItem::GetIconParamValue(game_PlayerState const * ps,
									 shared_str const & param_name,
									 buffer_vector<char> & dest)
{
	VERIFY(ps);
	game_cl_mp* cl_game = static_cast<game_cl_mp*>(&Game());
	VERIFY(cl_game);
	if (param_name.equal("rank"))
	{
		if (ETeam(cl_game->ModifyTeam(ps->team)) == etGreenTeam)
		{
			sprintf_s(dest.begin(), dest.size(), "ui_hud_status_green_0%d", ps->rank + 1);
		} else if (ETeam(cl_game->ModifyTeam(ps->team)) == etBlueTeam)
		{
			sprintf_s(dest.begin(), dest.size(), "ui_hud_status_blue_0%d", ps->rank + 1);
		}
	} else if (param_name.equal("death_atf"))
	{
		if (ps->testFlag(GAME_PLAYER_FLAG_VERY_VERY_DEAD))
		{
			strcpy_s(dest.begin(), dest.size(), "death");
			return;
		}
		if (cl_game->Type() == eGameIDCaptureTheArtefact)
		{
			game_cl_CaptureTheArtefact* cta_cl_game = static_cast<game_cl_CaptureTheArtefact*>(cl_game);
			R_ASSERT(cta_cl_game);
			if (ps->GameID == cta_cl_game->GetGreenArtefactOwnerID() ||
				ps->GameID == cta_cl_game->GetBlueArtefactOwnerID())
			{
				strcpy_s(dest.begin(), dest.size(), "artefact");
			}
		} else if (cl_game->Type() == eGameIDArtefactHunt)
		{
			game_cl_ArtefactHunt* ahunt_cl_game = static_cast<game_cl_ArtefactHunt*>(cl_game);
			R_ASSERT(ahunt_cl_game);
			if (ps->GameID == ahunt_cl_game->artefactBearerID)
			{
				strcpy_s(dest.begin(), dest.size(), "artefact");
			}
		}
	} else
	{
		VERIFY2(false, make_string("unknown icon parameter: %s", param_name.c_str()).c_str());
	}

}
Пример #3
0
void UIPlayerItem::GetTextParamValue(game_PlayerState const * ps, 
									 shared_str const & param_name,
									 buffer_vector<char> & dest)
{
	VERIFY(ps);
	if (param_name.equal("mp_name"))
	{
		strcpy_s(dest.begin(), dest.size(), ps->name);
	} else if (param_name.equal("mp_frags"))
	{
		sprintf_s(dest.begin(), dest.size(), "%d", ps->m_iRivalKills - ps->m_iSelfKills);
	} else if (param_name.equal("mp_deaths"))
	{
		sprintf_s(dest.begin(), dest.size(), "%d", ps->m_iDeaths);
	} else if (param_name.equal("mp_artefacts"))
	{
		sprintf_s(dest.begin(), dest.size(), "%d", ps->af_count);
	} else if (param_name.equal("mp_spots"))
	{
		sprintf_s(dest.begin(), dest.size(), "%d", m_checkPoints);
	}else if (param_name.equal("mp_status"))
	{
		CStringTable st;
		if (ps->testFlag(GAME_PLAYER_FLAG_READY))
			strcpy_s(dest.begin(), dest.size(), st.translate("st_mp_ready").c_str());
	} else if (param_name.equal("mp_ping"))
	{
		sprintf_s(dest.begin(), dest.size(), "%d", ps->ping);
	}
}