All pastes #398118 Raw Edit

Stuff

public text v1 · immutable
·published 2007-03-16 23:16 UTC
rendered paste body
void hookVisuals::DrawSimpleItems()
{
	idVec3 screen;
	int numentities;
	const idMaterial* material;
	const char* name;
	numentities = tck.entManager.GetNumEntities();
	q4Import.renderSystem->SetColor4(1.0f,1.0f,1.0f, 1.0f);
	for(int i = 32; i < numentities; i++)
	{
		if(!entities[i] || entities[i]->entityDefNumber < 0 || entities[i]->fl.networkStale)
			continue;
		float distance = tck.entManager.GetLocalPlayer()->DistanceTo(entities[i]);
		if(distance > 1750.0f)
			continue;
		name = q4Import.declManager->DeclByIndex( DECL_ENTITYDEF, entities[i]->entityDefNumber, false )->GetName();
		if(!espCheckFov(entities[i]->GetPhysics()->GetOrigin()))
			continue;
		if(!strstr(name, "item")&&!strstr(name, "weapon")&&!strstr(name, "powerup"))
			continue;
		if(strstr(name, "viewweapon"))
			continue;
		if(!entities[i]->fl.hidden)
		{
			if(eu_simpleItems.GetInteger() > 2 && !tck.entManager.GetLocalPlayer()->CanSeeFrom(tck.view.vieworg, entities[i]->GetPhysics()->GetOrigin(), false))
				continue;
			oRenderWorld->WorldToScreen(&tck.view, entities[i]->GetPhysics()->GetOrigin());
			material = q4Import.declManager->FindMaterial(entities[i]->spawnArgs.GetString("inv_icon"));
			if(distance>550.0f)
				q4Import.renderSystem->DrawStretchPic(screen.x-(7000/distance), screen.y-(14000/distance), 14000.0f/distance, 14000.0f/distance, 0.0f, 0.0f, 1.0f, 1.0f, material);
			else
				q4Import.renderSystem->DrawStretchPic(screen.x-(5500/distance), screen.y-(11000/distance), 11000.0f/distance, 11000.0f/distance, 0.0f, 0.0f, 1.0f, 1.0f, material);
		}
	}
}