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


C++ csArray::Get方法代码示例

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


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

示例1: SetUV

  void csFurStrand::SetUV( const csArray<csGuideFur> &guideFurs,
    const csArray<csGuideFurLOD> &guideFursLOD )
  {
    csVector2 strandUV(0);

    for ( size_t j = 0 ; j < GUIDE_HAIRS_COUNT ; j ++ )
      if (guideHairsRef[j].index < guideFurs.GetSize() )
        strandUV += guideHairsRef[j].distance * 
          guideFurs.Get(guideHairsRef[j].index).uv;
      else
        strandUV += guideHairsRef[j].distance * 
          guideFursLOD.Get(guideHairsRef[j].index - guideFurs.GetSize()).uv;

    uv = strandUV;
  }
开发者ID:GameLemur,项目名称:Crystal-Space,代码行数:15,代码来源:furdata.cpp

示例2: Update

  void csFurStrand::Update( const csArray<csGuideFur> &guideFurs,
    const csArray<csGuideFurLOD> &guideFursLOD, float controlPointsLOD)
  {
    for ( size_t i = 0 ; i < GetControlPointsCount(controlPointsLOD); i++ )
    {
      controlPoints[i] = csVector3(0);

      for ( size_t j = 0 ; j < GUIDE_HAIRS_COUNT ; j ++ )
        if ( guideHairsRef[j].index < guideFurs.GetSize() )
          controlPoints[i] += guideHairsRef[j].distance * 
            (guideFurs.Get(guideHairsRef[j].index).controlPoints[i]);
        else
          controlPoints[i] += guideHairsRef[j].distance * (guideFursLOD.Get
            (guideHairsRef[j].index - guideFurs.GetSize()).controlPoints[i]);
    }
  }
开发者ID:GameLemur,项目名称:Crystal-Space,代码行数:16,代码来源:furdata.cpp

示例3: Generate

  void csFurStrand::Generate( size_t controlPointsCount,
    const csArray<csGuideFur> &guideFurs, 
    const csArray<csGuideFurLOD> &guideFursLOD )
  {
    // Allocate control points
    this -> controlPointsCount = controlPointsCount;

    controlPoints = new csVector3[ controlPointsCount ];

    for ( size_t i = 0 ; i < controlPointsCount ; i ++ )
    {
      controlPoints[i] = csVector3(0);

      for ( size_t j = 0 ; j < GUIDE_HAIRS_COUNT ; j ++ )
        if ( guideHairsRef[j].index < guideFurs.GetSize() )
          controlPoints[i] += guideHairsRef[j].distance *
            guideFurs.Get(guideHairsRef[j].index).controlPoints[i];
        else
          controlPoints[i] += guideHairsRef[j].distance *
            guideFursLOD.Get(guideHairsRef[j].index - 
            guideFurs.GetSize()).controlPoints[i];
    }
  }
开发者ID:GameLemur,项目名称:Crystal-Space,代码行数:23,代码来源:furdata.cpp

示例4: WriteProgram

void csPixelShaderParser::WriteProgram (
	const csArray<csPSProgramInstruction>& instrs, 
	csString& str) const
{
  for(size_t i = 0; i < instrs.GetSize (); i++)
  {
    const csPSProgramInstruction& instr = instrs.Get (i);

    csString line;
    GetInstructionLine (instr, line);
    str << line;
    str << '\n';
  }
}
开发者ID:GameLemur,项目名称:Crystal-Space,代码行数:14,代码来源:ps1_parser.cpp

示例5: AddPetitions

void pawsPetitionGMWindow::AddPetitions(csArray<psPetitionInfo> &petitions)
{
    // figure out the selected petition


    if (petitionList->GetRowCount() <= 0)
        petitionList->Select(NULL);

    int selRow = petitionList->GetSelectedRowNum();
    if (selRow != -1)
    {
        csString escalation = petitionList->GetTextCellValue(selRow, PGMCOL_LVL);
        if (escalation.GetData() != NULL)
            selectedPet.escalation = atoi(escalation.GetData());
        else
            selectedPet.escalation = -1;
        selectedPet.assignedgm =      petitionList->GetTextCellValue(selRow, PGMCOL_GM);
        selectedPet.player =          petitionList->GetTextCellValue(selRow, PGMCOL_PLAYER);
        selectedPet.status =          petitionList->GetTextCellValue(selRow, PGMCOL_STATUS);
        selectedPet.created =         petitionList->GetTextCellValue(selRow, PGMCOL_CREATED);
        selectedPet.petition =        petitionList->GetTextCellValue(selRow, PGMCOL_PETITION);
        selectedPet.online =          petitionList->GetTextCellValue(selRow, PGMCOL_ONLINE) == "yes";
    }
    else
    {
        selectedPet.escalation = -1;
    }
    petitionList->Select(NULL);

    // Clear the list box and add the user's petitions
    petitionList->Clear();
    psPetitionInfo info;
    petCount = 0;
    for (size_t i = 0; i < petitions.GetSize(); i++)
    {
        info = petitions.Get(i);
        petCount++;

        // Set the data for this row:
        petitionList->NewRow(i);
        SetText(i, PGMCOL_LVL, "%d", info.escalation);
        SetText(i, PGMCOL_GM, "%s", info.assignedgm.GetDataSafe());
        SetText(i, PGMCOL_PLAYER, "%s", info.player.GetData());
        SetText(i, PGMCOL_ONLINE, "%s", (info.online ? "yes" : "no"));
        SetText(i, PGMCOL_STATUS, "%s", info.status.GetData());
        SetText(i, PGMCOL_CREATED, "%s", info.created.GetData());
        SetText(i, PGMCOL_PETITION, "%s", info.petition.GetData());

        // reselect the petition
        if (selectedPet.escalation != -1)
        {
            if (selectedPet.created == info.created
             && selectedPet.player == info.player)
            {
                petitionList->Select(petitionList->GetRow(i));
            }
        }
    }
    // make absolutely sure that there are petitions
    if (petCount <= 0)
    {
        petitionList->NewRow(0);
        SetText(0, 1, PawsManager::GetSingleton().Translate("No Petitions"));
    }
}
开发者ID:randomcoding,项目名称:PlaneShift-PSAI,代码行数:65,代码来源:pawspetitiongmwindow.cpp

示例6: ApplyModifier

void LootRandomizer::ApplyModifier(psItemStats* baseItem, RandomizedOverlay* overlay, csArray<uint32_t> &modifierIds)
{
    LootModifier mod;

    //set up default mod data
    mod.cost_modifier = 1;
    mod.name = baseItem->GetName();
    csArray<ValueModifier> variableValues;

    //creates the full lootmodifier from the ids being applied.
    //0 should be left empty in the database as it acts as NO HIT.
    for(size_t i = 0; i < modifierIds.GetSize(); i++)
    {
        uint32_t modID = modifierIds.Get(i);
        if(modID) //0 means nothing to do, no need to search for the void.
        {
            LootModifier* partialModifier = GetModifier(modID);
            if(partialModifier)
            {
                overlay->active = true;
                AddModifier(&mod, partialModifier);
            }
        }
    }
    //all is done no modifiers where found. so we just get out
    if(overlay->active == false)
        return;

    overlay->name = mod.name;
    overlay->price = psMoney(baseItem->GetPrice().GetTrias() * mod.cost_modifier);
    if(mod.mesh.Length() > 0)
        overlay->mesh = mod.mesh;
    if(mod.icon.Length() > 0)
        overlay->icon = mod.icon;

    // Apply effect
    csString xmlItemMod;

    xmlItemMod.Append("<ModiferEffects>");
    xmlItemMod.Append(mod.effect);
    xmlItemMod.Append("</ModiferEffects>");

    // Read the ModiferEffects XML into a doc*/
    csRef<iDocument> xmlDoc = ParseString(xmlItemMod);
    if(!xmlDoc)
    {
        Error1("Parse error in Loot Randomizer");
        return;
    }
    csRef<iDocumentNode> root    = xmlDoc->GetRoot();
    if(!root)
    {
        Error1("No XML root in Loot Randomizer");
        return;
    }
    csRef<iDocumentNode> topNode = root->GetNode("ModiferEffects");//Are we sure it is "Modifer"?
    if(!topNode)
    {
        Error1("No <ModiferEffects> in Loot Randomizer");
        return;
    }

    csRef<iDocumentNodeIterator> nodeList = topNode->GetNodes("ModiferEffect");

    // For Each ModiferEffect
    csRef<iDocumentNode> node;
    while(nodeList->HasNext())
    {
        node = nodeList->Next();
        //Determine the Effect
        csString EffectOp = node->GetAttribute("operation")->GetValue();
        csString EffectName = node->GetAttribute("name")->GetValue();
        float EffectValue = node->GetAttribute("value")->GetValueAsFloat();

        //Add to the Attributes
        if(!SetAttribute(EffectOp, EffectName, EffectValue, overlay, baseItem, variableValues))
        {
            // display error and continue
            Error2("Unable to set attribute %s on new loot item.",EffectName.GetData());
        }
    }

    // Apply stat_req_modifier
    csString xmlStatReq;

    xmlStatReq.Append("<StatReqs>");
    xmlStatReq.Append(mod.stat_req_modifier);
    xmlStatReq.Append("</StatReqs>");

    // Read the Stat_Req XML into a doc
    xmlDoc = ParseString(xmlStatReq);
    if(!xmlDoc)
    {
        Error1("Parse error in Loot Randomizer");
        return;
    }
    root    = xmlDoc->GetRoot();
    if(!root)
    {
        Error1("No XML root in Loot Randomizer");
//.........这里部分代码省略.........
开发者ID:huigou,项目名称:planeshift,代码行数:101,代码来源:lootrandomizer.cpp


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