⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rpparser.cpp

📁 linux下的一款播放器
💻 CPP
📖 第 1 页 / 共 5 页
字号:
                            UINT32 ulTmp = strtoul((const char*) pAttrValue->GetBuffer(), NULL, 10);                            pEffect->SetSrcX(ulTmp);                        }                        break;                    case kAttrSrcy:                        {                            UINT32 ulTmp = strtoul((const char*) pAttrValue->GetBuffer(), NULL, 10);                            pEffect->SetSrcY(ulTmp);                        }                        break;                    case kAttrSrcw:                        {                            UINT32 ulTmp = strtoul((const char*) pAttrValue->GetBuffer(), NULL, 10);                            pEffect->SetSrcWidth(ulTmp);                        }                        break;                    case kAttrSrch:                        {                            UINT32 ulTmp = strtoul((const char*) pAttrValue->GetBuffer(), NULL, 10);                            pEffect->SetSrcHeight(ulTmp);                        }                        break;                    case kAttrStartsrcx:                        {                            UINT32 ulTmp = strtoul((const char*) pAttrValue->GetBuffer(), NULL, 10);                            pEffect->SetStartSrcX(ulTmp);                            bNeedLastRects = FALSE;                            ulMinVer       = REDSTONE_VERSION;                        }                        break;                    case kAttrStartsrcy:                        {                            UINT32 ulTmp = strtoul((const char*) pAttrValue->GetBuffer(), NULL, 10);                            pEffect->SetStartSrcY(ulTmp);                            bNeedLastRects = FALSE;                            ulMinVer       = REDSTONE_VERSION;                        }                        break;                    case kAttrStartsrcw:                        {                            UINT32 ulTmp = strtoul((const char*) pAttrValue->GetBuffer(), NULL, 10);                            pEffect->SetStartSrcWidth(ulTmp);                            bNeedLastRects = FALSE;                            ulMinVer       = REDSTONE_VERSION;                        }                        break;                    case kAttrStartsrch:                        {                            UINT32 ulTmp = strtoul((const char*) pAttrValue->GetBuffer(), NULL, 10);                            pEffect->SetStartSrcHeight(ulTmp);                            bNeedLastRects = FALSE;                            ulMinVer       = REDSTONE_VERSION;                        }                        break;                    case kAttrDstx:                        {                            UINT32 ulTmp = strtoul((const char*) pAttrValue->GetBuffer(), NULL, 10);                            pEffect->SetDstX(ulTmp);                        }                        break;                    case kAttrDsty:                        {                            UINT32 ulTmp = strtoul((const char*) pAttrValue->GetBuffer(), NULL, 10);                            pEffect->SetDstY(ulTmp);                        }                        break;                    case kAttrDstw:                        {                            UINT32 ulTmp = strtoul((const char*) pAttrValue->GetBuffer(), NULL, 10);                            pEffect->SetDstWidth(ulTmp);                        }                        break;                    case kAttrDsth:                        {                            UINT32 ulTmp = strtoul((const char*) pAttrValue->GetBuffer(), NULL, 10);                            pEffect->SetDstHeight(ulTmp);                        }                        break;                    case kAttrStartdstx:                        {                            UINT32 ulTmp = strtoul((const char*) pAttrValue->GetBuffer(), NULL, 10);                            pEffect->SetStartDstX(ulTmp);                            bNeedLastRects = FALSE;                            ulMinVer       = REDSTONE_VERSION;                        }                        break;                    case kAttrStartdsty:                        {                            UINT32 ulTmp = strtoul((const char*) pAttrValue->GetBuffer(), NULL, 10);                            pEffect->SetStartDstY(ulTmp);                            bNeedLastRects = FALSE;                            ulMinVer       = REDSTONE_VERSION;                        }                        break;                    case kAttrStartdstw:                        {                            UINT32 ulTmp = strtoul((const char*) pAttrValue->GetBuffer(), NULL, 10);                            pEffect->SetStartDstWidth(ulTmp);                            bNeedLastRects = FALSE;                            ulMinVer       = REDSTONE_VERSION;                        }                        break;                    case kAttrStartdsth:                        {                            UINT32 ulTmp = strtoul((const char*) pAttrValue->GetBuffer(), NULL, 10);                            pEffect->SetDstHeight(ulTmp);                            bNeedLastRects = FALSE;                            ulMinVer       = REDSTONE_VERSION;                        }                        break;                    case kAttrUrl:                        {                            retVal = CheckStringContents(pAttrValue);                            if (SUCCEEDED(retVal))                            {                                pEffect->SetURL((const char*) pAttrValue->GetBuffer());                            }                            else                            {                                if (m_ulStrictnessLevel == REALPIX_STRICTNESS_LOW ||                                    m_ulStrictnessLevel == REALPIX_STRICTNESS_MEDIUM)                                {                                    bThrowError = FALSE;                                }                            }                        }                        break;                    case kAttrMaxfps:                        {                            UINT32 ulTmp = strtoul((const char*) pAttrValue->GetBuffer(), NULL, 10);                            pEffect->SetMaxFps(ulTmp);                        }                        break;                    case kAttrAspect:                        {                            BOOL bTmp = FALSE;                            retVal    = ConvertBoolValue(pAttrValue, bTmp);                            if (SUCCEEDED(retVal))                            {                                pEffect->SetAspectFlag(bTmp);                            }                        }                        break;                    case kAttrCenter:                        {                            BOOL bTmp = FALSE;                            retVal    = ConvertBoolValue(pAttrValue, bTmp);                            if (SUCCEEDED(retVal))                            {                                pEffect->SetCenterFlag(bTmp);                                ulMinVer = REDSTONE_VERSION;                            }                        }                        break;                    case kAttrBackgroundcolor:                        ulMinVer = REDSTONE_VERSION;                    case kAttrColor:                        {                            BYTE ucRed   = 0;                            BYTE ucGreen = 0;                            BYTE ucBlue  = 0;                            retVal       = ConvertColorValue(pAttrValue, ucRed, ucGreen, ucBlue);                            if (SUCCEEDED(retVal))                            {                                pEffect->SetColor(ucRed, ucGreen, ucBlue);                            }                        }                        break;                    case kAttrDirection:                        {                            BYTE ucTmp = 0;                            retVal     = ConvertWipeDirectionValue(pAttrValue, ucTmp);                            if (SUCCEEDED(retVal))                            {                                pEffect->SetWipeDirection(ucTmp);                            }                        }                        break;                    case kAttrType:                        {                            BYTE ucTmp = 0;                            retVal     = ConvertWipeTypeValue(pAttrValue, ucTmp);                            if (SUCCEEDED(retVal))                            {                                pEffect->SetWipeType(ucTmp);                            }                        }                        break;                    case kAttrPackage:                        {                            retVal = CheckStringContents(pAttrValue);                            if (SUCCEEDED(retVal))                            {                                pEffect->SetExFxPackage((const char*) pAttrValue->GetBuffer());                            }                        }                        break;                    case kAttrName:                        {                            retVal = CheckStringContents(pAttrValue);                            if (SUCCEEDED(retVal))                            {                                pEffect->SetExFxName((const char*) pAttrValue->GetBuffer());                            }                        }                        break;                    case kAttrData:                        {                            retVal = CheckStringContents(pAttrValue);                            if (SUCCEEDED(retVal))                            {                                pEffect->SetExFxData((const char*) pAttrValue->GetBuffer());                            }                        }                        break;                    case kAttrFile:                        {                            retVal = CheckStringContents(pAttrValue);                            if (SUCCEEDED(retVal))                            {                                pEffect->SetExFxFile((const char*) pAttrValue->GetBuffer());                            }                        }                        break;                }                if (SUCCEEDED(retVal) ||                    (FAILED(retVal) && !bThrowError))                {                    if (FAILED(retVal))                    {                        if (m_ulStrictnessLevel >= REALPIX_STRICTNESS_MEDIUM)                        {                            // We detected bad syntax but were told not to throw an error,                            // so we will log a warning instead.                            IHXBuffer* pErr = NULL;                            SetError(IDS_ERR_PIX_BADATTRVALUE, ulLine, ulCol, pszAttrName, pszTagName, pErr);                            ReportError(HXLOG_WARNING, HXR_OK, pErr);                            HX_RELEASE(pErr);                        }                    }                    retVal = CheckVersion(ulMinVer);                    if (SUCCEEDED(retVal))                    {                        // Get the next attribute                        HX_RELEASE(pAttrValue);                        if (SUCCEEDED(retVal))                        {                            rv = pAttr->GetNextPropertyCString(pszAttrName, pAttrValue);                        }                    }                    else                    {                        SetError(IDS_ERR_PIX_INCOMPATVERSION, ulLine, ulCol, (const char*) pAttrValue->GetBuffer(), NULL, rpError);                    }                }                else                {                    SetError(IDS_ERR_PIX_BADATTRVALUE, ulLine, ulCol, pszAttrName, pszTagName, rpError);                }            }            HX_RELEASE(pAttrValue);            if (SUCCEEDED(retVal))            {                // Here we do the hack to make sure that viewchange effects get the proper target                if (pEffect->GetEffectType() == PXEffect::kEffectTypeViewChange &&                    pEffect->GetTarget()     == 0                               &&                    m_pLastEffect                                               &&                    bNeedLastTarget)                {                    if (m_pLastEffect->HasTarget())                    {                        pEffect->SetTarget(m_pLastEffect->GetTarget());                    }                }                // Here we do the hack to make sure that viewchange effects get the proper start rects                if (pEffect->GetEffectType() == PXEffect::kEffectTypeViewChange &&                    m_pLastEffect                                               &&                    bNeedLastRects)                {                    if (m_pLastEffect->HasTarget())                    {                        pEffect->SetStartSrcRect(m_pLastEffect->GetSrcRect());                    }                    pEffect->SetStartDstRect(m_pLastEffect->GetDstRect());                }                // Part of the hack requires we save the last effect                HX_RELEASE(m_pLastEffect);                m_pLastEffect = pEffect;                m_pLastEffect->AddRef();                // Set the dst width and height if they defaulted to zero.                if (!pEffect->GetDstWidth())                {                    pEffect->SetDstWidth(m_pRealPixFile->GetDisplayWidth());                }                if (!pEffect->GetDstHeight())                {                    pEffect->SetDstHeight(m_pRealPixFile->GetDisplayHeight());                }                if (!pEffect->GetStartDstWidth())                {                    pEffect->SetStartDstWidth(m_pRealPixFile->GetDisplayWidth());                }                if (!pEffect->GetStartDstHeight())                {                    pEffect->SetStartDstHeight(m_pRealPixFile->GetDisplayHeight());                }                // Do some error checking on dst rect                if (pEffect->GetDstX()      + pEffect->GetDstWidth()       > m_pRealPixFile->GetDisplayWidth()  ||                    pEffect->GetDstY()      + pEffect->GetDstHeight()      > m_pRealPixFile->GetDisplayHeight() ||                    pEffect->GetStartDstX() + pEffect->GetStartDstWidth()  > m_pRealPixFile->GetDisplayWidth()  ||                    pEffect->GetStartDstY() + pEffect->GetStartDstHeight() > m_pRealPixFile->GetDisplayHeight())                {                    if (m_ulStrictnessLevel == REALPIX_STRICTNESS_HIGH)                    {                        SetError(IDS_ERR_PIX_BADDSTRECT, ulLine, ulCol, NULL, NULL, rpError);               

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -