engine/material.c
/*	Returns a material from the given ID.
*/
Returns a material from the given ID.
Returns a material from the given ID .
Material_t *Material_Get(int iMaterialID)
{
	int i;
	if (iMaterialID < 0 || iMaterialID > MATERIAL_MAX)
	{
		Con_Warning("Invalid material ID! (%i)\n",iMaterialID);
		return NULL;
	}
	for (i = 0; i < iMaterialCount; i++)
		if (mMaterials[i].iIdentification == iMaterialID)
		{
			mMaterials[i].bBind = true;
			return &mMaterials[i];
		}
	return NULL;
}
Material_t * Material_Get ( int iMaterialID ) { int i ; if ( iMaterialID < 0 || iMaterialID > MATERIAL_MAX ) { Con_Warning ( " \n " , iMaterialID ) ; return NULL ; } for ( i = 0 ; i < iMaterialCount ; i ++ ) if ( mMaterials [ i ] . iIdentification == iMaterialID ) { mMaterials [ i ] . bBind = true ; return & mMaterials [ i ] ; } return NULL ; }
Returns a material from the given ID.
Returns a material from the given ID .
// The identification would never be less than 0, and never more than our maximum.