示例#1
0
extern "C" int DLL_EXPORT SetFlagValue(int idx, int v)
{
	if (v > 0)
	{
		if (GetFlagValue(idx) == 0)
		{
			FlagValue = FlagValue ^ ((1 << idx));
		}
	}
	else
	{
		FlagValue = FlagValue & (~(1 << idx));
	}
	return 0;
}
示例#2
0
void MeshInstancePropertyControl::OnBoolPropertyChanged(PropertyList *forList, const String &forKey, bool newValue)
{
    if(forKey[0] == '#')
    {
        int32 index = GetIndexFromKey(forKey);
        
        String keyPrefix = Format("#%d", index);
        int32 vertexFormat = EVF_VERTEX;

		vertexFormat |= GetFlagValue(keyPrefix + ". fmt.NORMAL", EVF_NORMAL);
		vertexFormat |= GetFlagValue(keyPrefix + ". fmt.COLOR", EVF_COLOR);
		vertexFormat |= GetFlagValue(keyPrefix + ". fmt.TEXCOORD0", EVF_TEXCOORD0);
		vertexFormat |= GetFlagValue(keyPrefix + ". fmt.TEXCOORD1", EVF_TEXCOORD1);
		vertexFormat |= GetFlagValue(keyPrefix + ". fmt.TEXCOORD2", EVF_TEXCOORD2);
		vertexFormat |= GetFlagValue(keyPrefix + ". fmt.TEXCOORD3", EVF_TEXCOORD3);
		vertexFormat |= GetFlagValue(keyPrefix + ". fmt.TANGENT", EVF_TANGENT);
		vertexFormat |= GetFlagValue(keyPrefix + ". fmt.BINORMAL", EVF_BINORMAL);
		vertexFormat |= GetFlagValue(keyPrefix + ". fmt.JOINTWEIGHT", EVF_JOINTWEIGHT);

		//TODO: need to save new vertex format
    }

	if(forKey == "property.meshinstance.dynamicshadow.enable")
	{
		currentSceneNode->GetCustomProperties()->SetBool(forKey, newValue);
		if(newValue)
		{
			((MeshInstanceNode*)currentSceneNode)->CreateDynamicShadowNode();
		}
		else
		{
			((MeshInstanceNode*)currentSceneNode)->DeleteDynamicShadowNode();
		}
	}

    NodesPropertyControl::OnBoolPropertyChanged(forList, forKey, newValue);
}