Exemplo n.º 1
0
void plProgressMgr::IUpdateFlags(plOperationProgress* progress)
{
    // Init update is done, clear it and set first update
    if (hsCheckBits(progress->fFlags, plOperationProgress::kInitUpdate))
    {
        hsClearBits(progress->fFlags, plOperationProgress::kInitUpdate);
        hsSetBits(progress->fFlags, plOperationProgress::kFirstUpdate);
    }
    // First update is done, clear it
    else if (hsCheckBits(progress->fFlags, plOperationProgress::kFirstUpdate))
        hsClearBits(progress->fFlags, plOperationProgress::kFirstUpdate);
}
Exemplo n.º 2
0
// MoveRelative ------------------------------
// -------------
// A true result means that the stage is done.
bool plAnimStage::MoveRelative(double time, float delta, float &overage, plArmatureMod *avMod)
{
    bool result;        // true means the stage is done

    if(fLocalTime == 0.0f && delta >= 0.0f && !hsCheckBits(fSentNotifies, kNotifyEnter))
    {
        // we send the "enter" notify if we're at the start and either moving forward
        // or standing still.
        ISendNotify(kNotifyEnter, proEventData::kEnterStage, avMod, fBrain);
        hsSetBits(fSentNotifies, kNotifyEnter);
    }

    // aborting...
    if( fAdvanceType == kAdvanceOnMove && (avMod->HasMovementFlag() || avMod->ExitModeKeyDown()))
    {   // special case: advance when any key is pressed, regardless of position in stage.
        ISendNotify(kNotifyAdvance, proEventData::kAdvanceNextStage, avMod, fBrain);
        result = true;
    } else {
        if(delta == 0.0f)
        {
            return false;
        }   
        else
        if(delta < 0.0f)
            result = IMoveBackward(time, delta, overage, avMod);
        else
            result = IMoveForward(time, delta, overage, avMod);
    }

    return result;
}
Exemplo n.º 3
0
void plOperationProgress::IChildUpdateEnd(plOperationProgress* child)
{
    // If we're aborting, modify the total bytes to reflect any data we didn't download
    if (hsCheckBits(child->fFlags, plOperationProgress::kAborting))
        fMax += child->GetProgress() - child->GetMax();
    else if (!child->IsLastUpdate())
        fValue -= child->GetProgress();
}
Exemplo n.º 4
0
    virtual uint32_t Write(uint32_t count, const void* buf)
    {
        // tick whatever progress bar we have
        IUpdateProgress(count);

        // write the appropriate blargs
        if (hsCheckBits(fFlags, pfPatcherWorker::kFlagZipped))
            return plZlibStream::Write(count, buf);
        else
            return fOutput->Write(count, buf);
    }
Exemplo n.º 5
0
void plDispatchLog::DumpMsg(plMessage* msg, int numReceivers, int sendTimeMs, int32_t indent)
{
    if (!msg)
        return;

    bool found=fIncludeTypes.IsBitSet(msg->ClassIndex());
    if (found && !hsCheckBits(fFlags, plDispatchLogBase::kInclude))
        // it's an exclude list and we found it
        return;
    if (!found && hsCheckBits(fFlags, plDispatchLogBase::kInclude))
        // it's an include list and we didn't find it
        return;

    static float lastTime=0;
    float curTime = (float)hsTimer::GetSysSeconds();

    if (lastTime!=curTime)
    {
        // add linebreak for new frame
        fLog->AddLine("\n");
    }

    float sendTime = hsTimer::FullTicksToMs(hsTimer::GetFullTickCount() - fStartTicks);

    char indentStr[50];
    indent = hsMinimum(indent, sizeof(indentStr)-1);
    memset(indentStr, ' ', indent);
    indentStr[indent] = '\0';

    fLog->AddLineF("%sDispatched (%d) %d ms: time=%d CName=%s, sndr=%s, rcvr(%d)=%s, flags=0x%lx, tstamp=%f\n",
        indentStr, numReceivers, sendTimeMs,
        int(sendTime), msg->ClassName(), msg->fSender?msg->fSender->GetName().c_str():"nil",
        msg->GetNumReceivers(), msg->GetNumReceivers() && msg->GetReceiver(0)
            ? msg->GetReceiver(0)->GetName().c_str():"nil",
        msg->fBCastFlags, msg->fTimeStamp);

    lastTime=curTime;
}
Exemplo n.º 6
0
    plManifestFile* IReadManifestFile(const char* token, hsStringTokenizer* tokenizer, uint32_t userData, bool isPage)
    {
        char name[256];
        strcpy(name, token);
        uint32_t size = atoi(tokenizer->next());
        plMD5Checksum sum;
        sum.SetFromHexString(tokenizer->next());
        uint32_t flags = atoi(tokenizer->next());
        uint32_t zippedSize = 0;
        if (hsCheckBits(flags, plManifestFile::kFlagZipped))
            zippedSize = atoi(tokenizer->next());

        return new plManifestFile(name, "", sum, size, zippedSize, flags);
    }
Exemplo n.º 7
0
void GetConvexTri(NxConvexMeshDesc& desc, int idx, uint16_t* out)
{
    if (hsCheckBits(desc.flags, NX_MF_16_BIT_INDICES))
    {
        uint16_t* descTris = ((uint16_t*)(((char*)desc.triangles)+desc.pointStrideBytes*idx));
        out[0] = descTris[0];
        out[1] = descTris[1];
        out[2] = descTris[2];
    }
    else
    {
        uint32_t* descTris = ((uint32_t*)(((char*)desc.triangles)+desc.pointStrideBytes*idx));
        out[0] = (uint16_t)descTris[0];
        out[1] = (uint16_t)descTris[1];
        out[2] = (uint16_t)descTris[2];
    }
}
Exemplo n.º 8
0
// ITRYFINISH
bool plAvTaskSeek::ITryFinish(plArmatureMod *avatar, plAvBrainHuman *brain, double time, float elapsed)
{
    hsBool animsDone = brain->IsMovementZeroBlend();

    hsPoint3 newPosition = fPosition;
    hsQuat newRotation = fRotation;

    if (!(fFlags & kSeekFlagRotationOnly) && (fStillPositioning || !animsDone))
        fStillPositioning = IFinishPosition(newPosition, avatar, brain, time, elapsed);
    if (fStillRotating || !animsDone)
        fStillRotating = IFinishRotation(newRotation, avatar, brain, time, elapsed);

    newRotation.Normalize();
    if (hsCheckBits(fFlags, kSeekFlagRotationOnly))
        avatar->SetPositionAndRotationSim(nil, &newRotation);
    else
        avatar->SetPositionAndRotationSim(&newPosition, &newRotation);

    return fStillPositioning || fStillRotating || !animsDone;
}
Exemplo n.º 9
0
bool plAnimStage::ITryAdvance(plArmatureMod *avMod)
{
    bool stageDone = false;


    // hsStatusMessageF("Sending advance message for stage <%s>\n", fAnimName);
    if(fAdvanceType == kAdvanceAuto || fAdvanceType == kAdvanceOnMove) {
        stageDone = true;
    }

    if(!hsCheckBits(fSentNotifies, kNotifyAdvance))
    {
        // we send the advance message at the point where we *would* advance, whether
        // or not we actually do. this is misleading but better suited to actual current usage.
        // we may want to rename this to "ReachedStageEnd"
        ISendNotify(kNotifyAdvance, proEventData::kAdvanceNextStage, avMod, fBrain);
        hsSetBits(fSentNotifies, kNotifyAdvance);
    }

    return stageDone;
}
Exemplo n.º 10
0
 bool IsSelfPatch() const { return hsCheckBits(fFlags, pfPatcherWorker::kSelfPatch); }
Exemplo n.º 11
0
 bool IsRedistUpdate() const { return hsCheckBits(fFlags, pfPatcherWorker::kRedistUpdate); }
Exemplo n.º 12
0
bool plLocation::IsItinerant() const
{
    return hsCheckBits(fFlags, kItinerant);
}
Exemplo n.º 13
0
bool plLocation::IsReserved() const
{
    return hsCheckBits(fFlags, kReserved);
}