Thread: Avisynth+
View Single Post
Old 28th May 2016, 15:59   #1622  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 595
Quote:
Originally Posted by MysteryX View Post
Code:
	void* is_plus = env->FunctionExists("SetFilterMTMode") ? "true" : nullptr;
	if (is_plus != nullptr) {
		auto env2 = static_cast<IScriptEnvironment2*>(env);
		env2->SetFilterMTMode("ConvertToShader", MT_NICE_FILTER, true);
		env2->SetFilterMTMode("ConvertFromShader", MT_NICE_FILTER, true);
		env2->SetFilterMTMode("Shader", MT_NICE_FILTER, true);
		env2->SetFilterMTMode("ExecuteShader", MT_MULTI_INSTANCE, true);
	}
Why do you convert bool to void* there is no need to do it ?

Code:
	if (env->FunctionExists("SetFilterMTMode")) {
		auto env2 = static_cast<IScriptEnvironment2*>(env);
		env2->SetFilterMTMode("ConvertToShader", MT_NICE_FILTER, true);
		env2->SetFilterMTMode("ConvertFromShader", MT_NICE_FILTER, true);
		env2->SetFilterMTMode("Shader", MT_NICE_FILTER, true);
		env2->SetFilterMTMode("ExecuteShader", MT_MULTI_INSTANCE, true);
	}
I think this is smart and better.
__________________
my repositories
Chikuzen is offline