Quote:
Originally Posted by MysteryX
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.