0mg

by adsdsadsadsa on December 25th, 2009
No notes
Syntax: No syntax
Show lines - Hide lines - Show in textbox - Download
	if(Cvars.xqz==1)
	{
 
	IMaterial* Material = NULL;
	char * name;	char * group;
    for(int i=HalFLife2.m_pMaterialSystem->FirstMaterial(); i < HalFLife2.m_pMaterialSystem->GetNumMaterials(); i++)
	{
		Material = HalFLife2.m_pMaterialSystem->GetMaterial(i);
		name = (char*) Material->GetName();
		group = (char*) Material->GetTextureGroupName();
		/* perfect xqz */
		if(strstr( name, "player" ) || strstr( name, "w_models" ) || strstr( name, "hostage" ))
		{
			Material->SetMaterialVarFlag( MATERIAL_VAR_IGNOREZ, true ); 
			Material->SetMaterialVarFlag( MATERIAL_VAR_ZNEARER, true ); 
			Material->SetMaterialVarFlag( MATERIAL_VAR_FLAT, true );
		}
        /* fps boost by removing useless textures */ 
		if(strstr( name, "Lightmaps" ) || strstr( name, "Particle textures" ) || strstr( name, "Decal textures" ) || strstr( name, "CubeMap textures" ) || strstr( name, "Dynamic Indices" ) || strstr( name, "Dynamic Verts" ) || strstr( name, "World Verts" ) || strstr( name, "Lighting Verts" ))
			Material->SetMaterialVarFlag( MATERIAL_VAR_NO_DRAW, true );
	}
}
else if (Cvars.xqz==0)
	{
		IMaterial* Material = NULL;
	char * name;	char * group;
    for(int i=HalFLife2.m_pMaterialSystem->FirstMaterial(); i < HalFLife2.m_pMaterialSystem->GetNumMaterials(); i++)
	{
		Material = HalFLife2.m_pMaterialSystem->GetMaterial(i);
		name = (char*) Material->GetName();
		group = (char*) Material->GetTextureGroupName();
		/* perfect xqz */
		if(strstr( name, "player" ) || strstr( name, "w_models" ) || strstr( name, "hostage" ))
		{
			Material->SetMaterialVarFlag( MATERIAL_VAR_IGNOREZ, false ); 
			Material->SetMaterialVarFlag( MATERIAL_VAR_ZNEARER, false ); 
			Material->SetMaterialVarFlag( MATERIAL_VAR_FLAT, false );
		}
        /* fps boost by removing useless textures */ 
		if(strstr( name, "Lightmaps" ) || strstr( name, "Particle textures" ) || strstr( name, "Decal textures" ) || strstr( name, "CubeMap textures" ) || strstr( name, "Dynamic Indices" ) || strstr( name, "Dynamic Verts" ) || strstr( name, "World Verts" ) || strstr( name, "Lighting Verts" ))
			Material->SetMaterialVarFlag( MATERIAL_VAR_NO_DRAW, false );
 
	}
}

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS