MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / ResFX

Method ResFX

LuaSTGPlus/ResourceMgr.cpp:420–469  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// ResFX ///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

418/// ResFX
419////////////////////////////////////////////////////////////////////////////////
420ResFX::ResFX(const char* name, fcyRefPointer<f2dEffect> shader)
421 : Resource(ResourceType::FX, name), m_pShader(shader)
422{
423 // ɨ�����еı���ע��
424 for (fuInt i = 0; i < m_pShader->GetParamCount(); ++i)
425 {
426 f2dEffectParam* pParam = m_pShader->GetParam(i);
427
428 if (pParam->GetType() == F2DEPTYPE_VALUE)
429 {
430 f2dEffectParamValue* pValue = (f2dEffectParamValue*)pParam;
431
432 // ע�Ͱ�
433 f2dEffectParam* pAnnotation = pValue->GetAnnotation("binding");
434 if (pAnnotation && pAnnotation->GetType() == F2DEPTYPE_VALUE)
435 {
436 f2dEffectParamValue* pAnnotationVal = (f2dEffectParamValue*)pAnnotation;
437 if (pAnnotationVal->GetValueType() == F2DEPVTYPE_STRING && pAnnotationVal->GetString())
438 {
439 fcStr tBindingVar = pAnnotationVal->GetString(); // ���󶨵Ľű�����
440 m_pBindingVar[tBindingVar].push_back(pValue);
441 }
442 }
443
444 // �����
445 fcStr pSemantic = pValue->GetSemantic();
446 if (pSemantic)
447 {
448 if (_stricmp(pSemantic, "POSTEFFECTTEXTURE") == 0)
449 {
450 if (pValue->GetValueType() != F2DEPVTYPE_TEXTURE2D)
451 throw fcyException("ResFX::ResFX", "Invalid binding for 'POSTEFFECTTEXTURE'.");
452 m_pBindingPostEffectTexture.push_back(pValue);
453 }
454 else if (_stricmp(pSemantic, "VIEWPORT") == 0)
455 {
456 if (pValue->GetValueType() != F2DEPVTYPE_VECTOR)
457 throw fcyException("ResFX::ResFX", "Invalid binding for 'VIEWPORT'.");
458 m_pBindingViewport.push_back(pValue);
459 }
460 else if (_stricmp(pSemantic, "SCREENSIZE") == 0)
461 {
462 if (pValue->GetValueType() != F2DEPVTYPE_VECTOR)
463 throw fcyException("ResFX::ResFX", "Invalid binding for 'SCREENSIZE'.");
464 m_pBindingScreenSize.push_back(pValue);
465 }
466 }
467 }
468 }
469}
470
471void ResFX::SetPostEffectTexture(f2dTexture2D* val)LNOEXCEPT
472{

Callers

nothing calls this directly

Calls 1

GetTypeMethod · 0.80

Tested by

no test coverage detected