当前位置: 首页>>代码示例>>C++>>正文


C++ List::AppendList方法代码示例

本文整理汇总了C++中List::AppendList方法的典型用法代码示例。如果您正苦于以下问题:C++ List::AppendList方法的具体用法?C++ List::AppendList怎么用?C++ List::AppendList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在List的用法示例。


在下文中一共展示了List::AppendList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AppWarning

void  D3D10Shader::UpdateParams()
{
    List<BYTE> shaderConstantData;
    bool bUpload = false;

    for(UINT i=0; i<Params.Num(); i++)
    {
        ShaderParam &param = Params[i];

        if(param.type != Parameter_Texture)
        {
            if(!param.curValue.Num())
            {
                AppWarning(TEXT("D3D10Shader::UpdateParams: shader parameter '%s' not set"), param.name.Array());
                bUpload = false;
                break;
            }

            shaderConstantData.AppendList(param.curValue);

            if(param.bChanged)
            {
                bUpload = true;
                param.bChanged = false;
            }
        }
        else
        {
            if(param.curValue.Num())
            {
                Texture *texture = *(Texture**)param.curValue.Array();
                LoadTexture(texture, param.textureID);
            }
        }
    }

    if(shaderConstantData.Num() != constantSize)
    {
        AppWarning(TEXT("D3D10Shader::UpdateParams: invalid parameter specifications, constant size given: %d, constant size expected: %d"), shaderConstantData.Num(), constantSize);
        bUpload = false;
    }

    if(bUpload)
    {
        D3D11_MAPPED_SUBRESOURCE map;

        HRESULT err;
        if(FAILED(err = GetD3DCtx()->Map(constantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map)))
        {
            AppWarning(TEXT("D3D10Shader::UpdateParams: could not map constant buffer, result = %08lX"), err);
            return;
        }

        mcpy(map.pData, shaderConstantData.Array(), shaderConstantData.Num());
        GetD3DCtx()->Unmap(constantBuffer, 0);
    }
}
开发者ID:Heli-GitHub,项目名称:OBS,代码行数:57,代码来源:D3D10Shader.cpp

示例2: ConnectChibiLoops


//.........这里部分代码省略.........
            for(k=0; k<childLoop.Num(); k++)
            {
                if(AlreadyUsed.FindValueIndex(childLoop[k].v1) != INVALID)
                    continue;

                Vect2 &v2 = Verts[childLoop[k].v1];

                BOOL bBadChoice = LineIntersectsShape(v1, v2, CurLoop);

                if(bBadChoice)
                    continue;

                for(l=0; l<CurChildren.Num(); l++)
                {
                    if(LineIntersectsShape(v1, v2, LoopList[loopNode.Children[CurChildren[l]].loop]))
                    {
                        bBadChoice = TRUE;
                        break;
                    }
                }

                if(bBadChoice)
                    continue;

                float dist = v2.Dist(v1);

                if((curBestChoiceLoop1 != INVALID) && (dist > closestPos))
                    continue;

                closestPos = dist;
                curBestChoiceLoop1 = j;
                curBestChoiceLoop2 = k;
            }
        }

        if(curBestChoiceLoop1 == INVALID)
        {
            i = (i == CurChildren.Num()-1) ? 0 : (i+1);
            if(i == 0)
            {
                AppWarning(TEXT("...almost infinitely looped there.  Fortunately I have measures against such devious things."));
                break;
            }
            continue;
        }

        AlreadyUsed << CurLoop[curBestChoiceLoop1].v1;
        AlreadyUsed << childLoop[curBestChoiceLoop2].v1;

        //---------------------------------------------
        // connect loops

        if(CurLoop[0].lineData && !childLoop[0].lineData)
        {
            for(j=0; j<childLoop.Num(); j++)
                childLoop[j].lineData = CurLoop[0].lineData;
        }

        SetNewLoopStartPosition(CurLoop,   curBestChoiceLoop1);
        SetNewLoopStartPosition(childLoop, curBestChoiceLoop2);

        if(!CurLoop[0].lineData && childLoop[0].lineData)
        {
            for(j=0; j<CurLoop.Num(); j++)
                CurLoop[j].lineData = childLoop[0].lineData;
        }

        PolyLine &lastLine = CurLoop.Last();
        PolyLine *pLine = CurLoop.CreateNew();
        pLine->v1 = lastLine.v2;
        pLine->v2 = childLoop[0].v1;

        CurLoop.AppendList(childLoop);
        pLine = CurLoop.CreateNew();
        pLine->v1 = childLoop[0].v1;
        pLine->v2 = CurLoop[0].v1;

        /*for(j=0; j<CurLoop.Num(); j++)
        {
            String chong;
            chong << long(j) << TEXT(": x: ") << FormattedString(TEXT("%0.4f"), Verts[CurLoop[j].v1].x) << TEXT("\ty: ") << FormattedString(TEXT("%0.4f"), Verts[CurLoop[j].v1].y) << TEXT("\r\n");
            OutputDebugString(chong);
        }
        OutputDebugString(TEXT("====================================\r\n"));*/

        CurChildren.Remove(i);
        i = 0;
    }

    NewLoopList.CreateNew()->CopyList(CurLoop);
    CurLoop.Clear();

    for(i=0; i<loopNode.Children.Num(); i++)
    {
        ChibiLoopNode &childNode = loopNode.Children[i];

        for(j=0; j<childNode.Children.Num(); j++)
            ConnectChibiLoops(childNode.Children[j], LoopList, NewLoopList);
    }
}
开发者ID:alanzw,项目名称:JimEngine,代码行数:101,代码来源:Triangulator.cpp


注:本文中的List::AppendList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。