engine/material.c
/*	Set flags for the material.
*/
Set flags for the material.
Set flags for the material .
void _Material_SetFlags(Material_t *mCurrentMaterial, MaterialFunctionContext_t mftContext, char *cArg)
{
	int	i;
	for (i = 0; i < pARRAYELEMENTS(mfMaterialFlags); i++)
	{
		if (strstr(cArg, mfMaterialFlags[i].ccName))
		{
			if (mfMaterialFlags[i].mftContext != mftContext)
				continue;
			switch (mftContext)
			{
			case MATERIAL_FUNCTION_MATERIAL:
				if (mfMaterialFlags[i].flags == MATERIAL_FLAG_ANIMATED)
				{
					mCurrentMaterial->iAnimationFrame = 0;
					mCurrentMaterial->dAnimationTime = 0;
				}
				mCurrentMaterial->iFlags |= mfMaterialFlags[i].flags;
				break;
			case MATERIAL_FUNCTION_SKIN:
				mCurrentMaterial->msSkin[mCurrentMaterial->iSkins].uiFlags |= mfMaterialFlags[i].flags;
				break;
			case MATERIAL_FUNCTION_TEXTURE:
				mCurrentMaterial->msSkin[mCurrentMaterial->iSkins].mtTexture
					[mCurrentMaterial->msSkin[mCurrentMaterial->iSkins].uiTextures].uiFlags |= mfMaterialFlags[i].flags;
				break;
			default:
				Con_Warning("Invalid context! (%s) (%s) (%i)\n", mCurrentMaterial->cName, mfMaterialFlags[i].ccName, mftContext);
			}
		}
	}
}
void _Material_SetFlags ( Material_t * mCurrentMaterial , MaterialFunctionContext_t mftContext , char * cArg ) { int i ; for ( i = 0 ; i < pARRAYELEMENTS ( mfMaterialFlags ) ; i ++ ) { if ( strstr ( cArg , mfMaterialFlags [ i ] . ccName ) ) { if ( mfMaterialFlags [ i ] . mftContext != mftContext ) continue ; switch ( mftContext ) { case MATERIAL_FUNCTION_MATERIAL : if ( mfMaterialFlags [ i ] . flags == MATERIAL_FLAG_ANIMATED ) { mCurrentMaterial -> iAnimationFrame = 0 ; mCurrentMaterial -> dAnimationTime = 0 ; } mCurrentMaterial -> iFlags |= mfMaterialFlags [ i ] . flags ; break ; case MATERIAL_FUNCTION_SKIN : mCurrentMaterial -> msSkin [ mCurrentMaterial -> iSkins ] . uiFlags |= mfMaterialFlags [ i ] . flags ; break ; case MATERIAL_FUNCTION_TEXTURE : mCurrentMaterial -> msSkin [ mCurrentMaterial -> iSkins ] . mtTexture [ mCurrentMaterial -> msSkin [ mCurrentMaterial -> iSkins ] . uiTextures ] . uiFlags |= mfMaterialFlags [ i ] . flags ; break ; default : Con_Warning ( " \n " , mCurrentMaterial -> cName , mfMaterialFlags [ i ] . ccName , mftContext ) ; } } } }
Set flags for the material.
Set flags for the material .
// Search through and copy each flag into the materials list of flags.