Esempio n. 1
0
static int ISearchLayerRecur(hsGMaterial* mat, const plString &segName, hsTArray<plKey>& keys)
{
    plString name = ( segName.Compare( ENTIRE_ANIMATION_NAME ) == 0 ) ? "" : segName;
    int i;
    for( i = 0; i < mat->GetNumLayers(); i++ )
        ISearchLayerRecur(mat->GetLayer(i), name, keys);
    return keys.GetCount();
}
Esempio n. 2
0
// AddAnim ----------------------------------------------
// --------
void plAGAnim::AddAnim(const plString & name, plAGAnim *anim)
{
    // Only register the animation if it's got a "real" name. Unnamed animations
    // all get the same standard name.
    if(name.Compare(ENTIRE_ANIMATION_NAME) != 0)
    {
        hsAssert(anim, "registering nil anim");
        fAllAnims[name] = anim;
    }
}
Esempio n. 3
0
unsigned plNetClientMgr::GetPlayerIdByName (const plString & name) const {
    // local case
    if (name.CompareI(NetCommGetPlayer()->playerName) == 0)
        return NetCommGetPlayer()->playerInt;

    unsigned n = TransportMgr().GetNumMembers();
    for (unsigned i = 0; i < n; ++i)
        if (plNetTransportMember * member = TransportMgr().GetMember(i))
            if (0 == name.Compare(member->GetPlayerName()))
                return member->GetPlayerID();
    return 0;
}
Esempio n. 4
0
plLocation plPluginResManager::ICreateLocation(const plString& age, const plString& page, int32_t seqNum, bool itinerant)
{
    bool willBeReserved = age.CompareI("global") == 0;

    int32_t oldNum = seqNum;
    seqNum = VerifySeqNumber(seqNum, age, page);
    if (seqNum != oldNum)
    {
        hsAssert(false, "Conflicting page sequence number. Somebody called NameToLoc without verifying their seq# first!"); 
    }

    if (seqNum < 0)
    {
        willBeReserved = true;
        seqNum = -seqNum;
    }

    plLocation newLoc;
    if (willBeReserved)
        newLoc = plLocation::MakeReserved(seqNum);
    else
        newLoc = plLocation::MakeNormal(seqNum);

    // Flag common pages
    for (int i = 0; i < plAgeDescription::kNumCommonPages; i++)
    {
        if (page.Compare(plAgeDescription::GetCommonPage(i)) == 0)
        {
            newLoc.SetFlags(plLocation::kBuiltIn);
            break;
        }
    }

    // If we have an age description file for the age we're creating a location
    // for, grab some extra flags from it
    plAgeDescription* ageDesc = plPageInfoUtils::GetAgeDesc(age.c_str());
    plAgePage* agePage = ageDesc ? ageDesc->FindPage(page.c_str()) : nil;
    if (agePage)
    {
        if (agePage->GetFlags() & plAgePage::kIsLocalOnly)
            newLoc.SetFlags(plLocation::kLocalOnly);

        if (agePage->GetFlags() & plAgePage::kIsVolatile)
            newLoc.SetFlags(plLocation::kVolatile);
    }
    if (itinerant)
        newLoc.SetFlags(plLocation::kItinerant);

    delete ageDesc;
    return newLoc;
}