Exemplo n.º 1
0
void plOneTimeParticleGenerator::IPrcParse(const pfPrcTag* tag, plResManager* mgr) {
    if (tag->getName() == "GeneratorParams") {
        fXSize = tag->getParam("XSize", "0").to_float();
        fYSize = tag->getParam("YSize", "0").to_float();
        fScaleMin = tag->getParam("ScaleMin", "0").to_float();
        fScaleMax = tag->getParam("ScaleMax", "0").to_float();
        fPartRadsPerSecRange = tag->getParam("RadsPerSecond", "0").to_float();
    } else if (tag->getName() == "ParticleSources") {
        size_t count = tag->countChildren();
        fPosition.resize(count);
        fDirection.resize(count);
        const pfPrcTag* child = tag->getFirstChild();
        for (size_t i = 0; i < count; ++i) {
            if (child->getName() != "Source")
                throw pfPrcTagException(__FILE__, __LINE__, child->getName());
            const pfPrcTag* subChild = child->getFirstChild();
            while (subChild != NULL) {
                if (subChild->getName() == "Position") {
                    if (subChild->hasChildren())
                        fPosition[i].prcParse(subChild->getFirstChild());
                } else if (subChild->getName() == "Direction") {
                    if (subChild->hasChildren())
                        fDirection[i].prcParse(subChild->getFirstChild());
                } else {
                    throw pfPrcTagException(__FILE__, __LINE__, subChild->getName());
                }
                subChild = subChild->getNextSibling();
            }
            child = child->getNextSibling();
        }
    } else {
        plCreatable::IPrcParse(tag, mgr);
    }
}
Exemplo n.º 2
0
void pfGUIColorScheme::prcParse(const pfPrcTag* tag) {
    if (tag->getName() != "pfGUIColorScheme")
        throw pfPrcTagException(__FILE__, __LINE__, tag->getName());

    fFontFace = tag->getParam("Face", "");
    fFontSize = tag->getParam("Size", "0").toUint();
    fTransparent = tag->getParam("transparent", "0").toInt();
    fFontFlags = tag->getParam("flags", "0").toUint();

    const pfPrcTag* child = tag->getFirstChild();
    while (child != NULL) {
        if (child->getName() == "Foreground") {
            if (child->hasChildren())
                fForeColor.prcParse(child->getFirstChild());
        } else if (child->getName() == "Background") {
            if (child->hasChildren())
                fBackColor.prcParse(child->getFirstChild());
        } else if (child->getName() == "SelForeground") {
            if (child->hasChildren())
                fSelForeColor.prcParse(child->getFirstChild());
        } else if (child->getName() == "SelBackground") {
            if (child->hasChildren())
                fSelBackColor.prcParse(child->getFirstChild());
        } else {
            throw pfPrcTagException(__FILE__, __LINE__, child->getName());
        }
        child = child->getNextSibling();
    }
}
Exemplo n.º 3
0
void plParallelIsect::IPrcParse(const pfPrcTag* tag, plResManager* mgr) {
    if (tag->getName() == "Planes") {
        fPlanes.resize(tag->countChildren());
        const pfPrcTag* planeChild = tag->getFirstChild();
        for (size_t i=0; i<fPlanes.size(); i++) {
            if (planeChild->getName() != "ParallelPlane")
                throw pfPrcTagException(__FILE__, __LINE__, planeChild->getName());
            fPlanes[i].fMin = planeChild->getParam("Min", "0").toFloat();
            fPlanes[i].fMax = planeChild->getParam("Max", "0").toFloat();

            const pfPrcTag* child = planeChild->getFirstChild();
            while (child != NULL) {
                if (child->getName() == "Normal") {
                    if (child->hasChildren())
                        fPlanes[i].fNorm.prcParse(child->getFirstChild());
                } else if (child->getName() == "Positions") {
                    if (child->countChildren() != 2)
                        throw pfPrcParseException(__FILE__, __LINE__, "ParallelPlane expects exactly 2 posiitons");
                    fPlanes[i].fPosOne.prcParse(child->getFirstChild());
                    fPlanes[i].fPosTwo.prcParse(child->getFirstChild()->getNextSibling());
                } else {
                    throw pfPrcTagException(__FILE__, __LINE__, child->getName());
                }
                child = child->getNextSibling();
            }
            planeChild = planeChild->getNextSibling();
        }
    } else {
        plCreatable::IPrcParse(tag, mgr);
    }
}
Exemplo n.º 4
0
void plArmatureLODMod::IPrcParse(const pfPrcTag* tag, plResManager* mgr) {
    if (tag->getName() == "Meshes") {
        fMeshKeys.resize(tag->countChildren());
        fUnusedBones.resize(fMeshKeys.size());
        const pfPrcTag* child = tag->getFirstChild();
        for (size_t i=0; i<fMeshKeys.size(); i++) {
            if (child->getName() != "Mesh")
                throw pfPrcTagException(__FILE__, __LINE__, child->getName());

            const pfPrcTag* subchild = child->getFirstChild();
            while (subchild != NULL) {
                if (subchild->getName() == "plKey") {
                    fMeshKeys[i] = mgr->prcParseKey(subchild);
                } else if (subchild->getName() == "UnusedBones") {
                    fUnusedBones[i].resize(subchild->countChildren());
                    const pfPrcTag* boneChild = subchild->getFirstChild();
                    for (size_t j=0; j<fUnusedBones[i].size(); j++) {
                        fUnusedBones[i][j] = mgr->prcParseKey(boneChild);
                        boneChild = boneChild->getNextSibling();
                    }
                } else {
                    throw pfPrcTagException(__FILE__, __LINE__, subchild->getName());
                }
                subchild = subchild->getNextSibling();
            }
            child = child->getNextSibling();
        }
    } else {
        plArmatureMod::IPrcParse(tag, mgr);
    }
}
Exemplo n.º 5
0
void plConeIsect::IPrcParse(const pfPrcTag* tag, plResManager* mgr) {
    if (tag->getName() == "ConeParams") {
        fCapped = tag->getParam("Capped", "0").toInt();
        fRadAngle = tag->getParam("RadAngle", "0").toFloat();
        fLength = tag->getParam("Length", "0").toFloat();
    } else if (tag->getName() == "WorldTip") {
        if (tag->hasChildren())
            fWorldTip.prcParse(tag->getFirstChild());
    } else if (tag->getName() == "WorldNorm") {
        if (tag->hasChildren())
            fWorldNorm.prcParse(tag->getFirstChild());
    } else if (tag->getName() == "WorldToNDC") {
        if (tag->hasChildren())
            fWorldToNDC.prcParse(tag->getFirstChild());
    } else if (tag->getName() == "LightToNDC") {
        if (tag->hasChildren())
            fLightToNDC.prcParse(tag->getFirstChild());
    } else if (tag->getName() == "Norms") {
        size_t count = 4 + (fCapped != 0 ? 1 : 0);
        if (tag->countChildren() != count)
            throw pfPrcTagException(__FILE__, __LINE__, "Incorrect number of Norms");
        const pfPrcTag* child = tag->getFirstChild();
        for (size_t i=0; i<count; i++) {
            if (child->getName() != "Normal")
                throw pfPrcTagException(__FILE__, __LINE__, child->getName());
            fDists[i] = child->getParam("Distance", "0").toFloat();
            if (child->hasChildren())
                fNorms[i].prcParse(child->getFirstChild());
            child = child->getNextSibling();
        }
    } else {
        plCreatable::IPrcParse(tag, mgr);
    }
}
Exemplo n.º 6
0
void plConvexIsect::IPrcParse(const pfPrcTag* tag, plResManager* mgr) {
    if (tag->getName() == "Planes") {
        fPlanes.resize(tag->countChildren());
        const pfPrcTag* planeChild = tag->getFirstChild();
        for (size_t i=0; i<fPlanes.size(); i++) {
            if (planeChild->getName() != "SinglePlane")
                throw pfPrcTagException(__FILE__, __LINE__, planeChild->getName());
            fPlanes[i].fDist = planeChild->getParam("Dist", "0").toFloat();
            fPlanes[i].fWorldDist = planeChild->getParam("WorldDist", "0").toFloat();

            const pfPrcTag* child = planeChild->getFirstChild();
            while (child != NULL) {
                if (child->getName() == "Normal") {
                    if (child->hasChildren())
                        fPlanes[i].fNorm.prcParse(child->getFirstChild());
                } else if (child->getName() == "Position") {
                    if (child->hasChildren())
                        fPlanes[i].fPos.prcParse(child->getFirstChild());
                } else if (child->getName() == "WorldNormal") {
                    if (child->hasChildren())
                        fPlanes[i].fWorldNorm.prcParse(child->getFirstChild());
                } else {
                    throw pfPrcTagException(__FILE__, __LINE__, child->getName());
                }
                child = child->getNextSibling();
            }
            planeChild = planeChild->getNextSibling();
        }
    } else {
        plCreatable::IPrcParse(tag, mgr);
    }
}
Exemplo n.º 7
0
void plTMController::IPrcParse(const pfPrcTag* tag, plResManager* mgr) {
    if (tag->getName() == "Position") {
        if (tag->hasChildren() && !tag->getFirstChild()->getParam("NULL", "false").toBool()) {
            if (tag->getFirstChild()->getName() == "plSimplePosController")
                setPosController(new plSimplePosController());
            else if (tag->getFirstChild()->getName() == "plCompoundPosController")
                setPosController(new plCompoundPosController());
            else
                throw pfPrcTagException(__FILE__, __LINE__, tag->getFirstChild()->getName());
            fPosController->prcParse(tag->getFirstChild(), mgr);
        }
    } else if (tag->getName() == "Rotation") {
        if (tag->hasChildren() && !tag->getFirstChild()->getParam("NULL", "false").toBool()) {
            if (tag->getFirstChild()->getName() == "plSimpleRotController")
                setRotController(new plSimpleRotController());
            else if (tag->getFirstChild()->getName() == "plCompoundRotController")
                setRotController(new plCompoundRotController());
            else
                throw pfPrcTagException(__FILE__, __LINE__, tag->getFirstChild()->getName());
            fRotController->prcParse(tag->getFirstChild(), mgr);
        }
    } else if (tag->getName() == "Scale") {
        if (tag->hasChildren() && !tag->getFirstChild()->getParam("NULL", "false").toBool()) {
            if (tag->getFirstChild()->getName() == "plSimpleScaleController")
                setScaleController(new plSimpleScaleController());
            else
                throw pfPrcTagException(__FILE__, __LINE__, tag->getFirstChild()->getName());
            fScaleController->prcParse(tag->getFirstChild(), mgr);
        }
    } else {
        plCreatable::IPrcParse(tag, mgr);
    }
}
Exemplo n.º 8
0
void plEAXSourceSettings::prcParse(const pfPrcTag* tag) {
    if (tag->getName() != "plEAXSourceSettings")
        throw pfPrcTagException(__FILE__, __LINE__, tag->getName());

    fEnabled = tag->getParam("enabled", "true").to_bool();
    if (fEnabled) {
        fRoom = tag->getParam("Room", "0").to_int();
        fRoomHF = tag->getParam("RoomHF", "0").to_int();
        fRoomAuto = tag->getParam("RoomAuto", "false").to_bool();
        fRoomHFAuto = tag->getParam("RoomHFAuto", "false").to_bool();
        fOutsideVolHF = tag->getParam("OutsideHF", "0").to_int();

        const pfPrcTag* child = tag->getFirstChild();
        while (child != NULL) {
            if (child->getName() == "Effects") {
                fAirAbsorptionFactor = child->getParam("AirAbsorption", "0").to_float();
                fRoomRolloffFactor = child->getParam("RoomRolloff", "0").to_float();
                fDopplerFactor = child->getParam("Doppler", "0").to_float();
                fRolloffFactor = child->getParam("Rolloff", "0").to_float();
                fOcclusionSoftValue = tag->getParam("SoftOcclusion", "0").to_float();
            } else if (child->getName() == "Starts") {
                if (tag->hasChildren())
                    fSoftStarts.prcParse(child->getFirstChild());
            } else if (child->getName() == "Ends") {
                if (tag->hasChildren())
                    fSoftEnds.prcParse(child->getFirstChild());
            } else {
                throw pfPrcTagException(__FILE__, __LINE__, child->getName());
            }
            child = child->getNextSibling();
        }
    } else {
        enable(false);
    }
}
Exemplo n.º 9
0
void plResponderModifier::IPrcParse(const pfPrcTag* tag, plResManager* mgr) {
    if (tag->getName() == "ResponderModParams") {
        fCurState = tag->getParam("CurState", "0").toInt();
        fEnabled = tag->getParam("Enabled", "false").toBool();
        fFlags = tag->getParam("Flags", "0").toUint();
    } else if (tag->getName() == "States") {
        clearStates();
        fStates.setSizeNull(tag->countChildren());
        const pfPrcTag* state = tag->getFirstChild();
        for (size_t i=0; i<fStates.getSize(); i++) {
            if (state->getName() != "plResponderState")
                throw pfPrcTagException(__FILE__, __LINE__, state->getName());
            fStates[i] = new plResponderState();
            fStates[i]->fNumCallbacks = state->getParam("NumCallbacks", "0").toInt();
            fStates[i]->fSwitchToState = state->getParam("SwitchToState", "-1").toInt();

            const pfPrcTag* child = state->getFirstChild();
            while (child != NULL) {
                if (child->getName() == "Commands") {
                    fStates[i]->fCmds.setSize(child->countChildren());
                    const pfPrcTag* cmdChild = child->getFirstChild();
                    for (size_t j=0; j<fStates[i]->fCmds.getSize(); j++) {
                        if (cmdChild->getName() != "Command")
                            throw pfPrcTagException(__FILE__, __LINE__, cmdChild->getName());
                        plMessage* msg = NULL;
                        int8_t waitOn = -1;
                        const pfPrcTag* subChild = cmdChild->getFirstChild();
                        while (subChild != NULL) {
                            if (subChild->getName() == "WaitOn") {
                                waitOn = subChild->getParam("value", "-1").toInt();
                            } else {
                                msg = plMessage::Convert(mgr->prcParseCreatable(subChild));
                            }
                            subChild = subChild->getNextSibling();
                        }
                        fStates[i]->fCmds[j] = new plResponderCmd(msg, waitOn);
                        cmdChild = cmdChild->getNextSibling();
                    }
                } else if (child->getName() == "WaitToCmdTable") {
                    size_t nWaits = child->countChildren();
                    const pfPrcTag* waitChild = child->getFirstChild();
                    for (size_t j=0; j<nWaits; j++) {
                        if (waitChild->getName() != "Item")
                            throw pfPrcTagException(__FILE__, __LINE__, waitChild->getName());
                        int8_t wait = waitChild->getParam("Wait", "0").toInt();
                        fStates[i]->fWaitToCmd[wait] = waitChild->getParam("Cmd", "0").toInt();
                        waitChild = waitChild->getNextSibling();
                    }
                } else {
                    throw pfPrcTagException(__FILE__, __LINE__, child->getName());
                }
                child = child->getNextSibling();
            }
            state = state->getNextSibling();
        }
    } else {
        plSingleModifier::IPrcParse(tag, mgr);
    }
}
Exemplo n.º 10
0
void plFixedWaterState6::prcParse(const pfPrcTag* tag) {
    if (tag->getName() != "plFixedWaterState6")
        throw pfPrcTagException(__FILE__, __LINE__, tag->getName());

    const pfPrcTag* child = tag->getFirstChild();
    while (child != NULL) {
        if (child->getName() == "WaterOffset") {
            if (child->hasChildren())
                fWaterOffset.prcParse(child->getFirstChild());
        } else if (child->getName() == "GeoState") {
            if (child->hasChildren())
                fGeoState.prcParse(child->getFirstChild());
        } else if (child->getName() == "TexState") {
            if (child->hasChildren())
                fTexState.prcParse(child->getFirstChild());
        } else if (child->getName() == "WaterStateParams") {
            fRippleScale = child->getParam("RippleScale", "0").to_float();
            fWaterHeight = child->getParam("WaterHeight", "0").to_float();
            fWispiness = child->getParam("Wispiness", "0").to_float();
            fPeriod = child->getParam("Period", "0").to_float();
            fFingerLength = child->getParam("FingerLength", "0").to_float();
        } else if (child->getName() == "WindDir") {
            if (child->hasChildren())
                fWindDir.prcParse(child->getFirstChild());
        } else if (child->getName() == "SpecVec") {
            if (child->hasChildren())
                fSpecVec.prcParse(child->getFirstChild());
        } else if (child->getName() == "MaxAtten") {
            if (child->hasChildren())
                fMaxAtten.prcParse(child->getFirstChild());
        } else if (child->getName() == "MinAtten") {
            if (child->hasChildren())
                fMinAtten.prcParse(child->getFirstChild());
        } else if (child->getName() == "ShoreTint") {
            if (child->hasChildren())
                fShoreTint.prcParse(child->getFirstChild());
        } else if (child->getName() == "MaxColor") {
            if (child->hasChildren())
                fMaxColor.prcParse(child->getFirstChild());
        } else if (child->getName() == "MinColor") {
            if (child->hasChildren())
                fMinColor.prcParse(child->getFirstChild());
        } else if (child->getName() == "Edge") {
            fEdgeOpac = child->getParam("Opacity", "0").to_float();
            fEdgeRadius = child->getParam("Radius", "0").to_float();
        } else if (child->getName() == "Env") {
            fEnvRefresh = child->getParam("Refresh", "0").to_float();
            fEnvRadius = child->getParam("Radius", "0").to_float();
        } else if (child->getName() == "EnvCenter") {
            if (child->hasChildren())
                fEnvCenter.prcParse(child->getFirstChild());
        } else {
            throw pfPrcTagException(__FILE__, __LINE__, child->getName());
        }
        child = child->getNextSibling();
    }
}
Exemplo n.º 11
0
void plClientGuid::IPrcParse(const pfPrcTag* tag, plResManager* mgr) {
    if (tag->getName() == "NetMsgParams") {
        fFlags = tag->getParam("Flags", "0").to_uint();
        const pfPrcTag* child = tag->getFirstChild();
        while (child != NULL) {
            if (child->getName() == "AccountUuid") {
                if (child->hasChildren())
                    fAcctUuid.prcParse(child->getFirstChild());
            } else if (child->getName() == "Player") {
                fPlayerID = child->getParam("ID", "0").to_uint();
                fPlayerName = child->getParam("Name", "");
            } else if (child->getName() == "CCR") {
                fCCRLevel = child->getParam("Level", "0").to_uint();
            } else if (child->getName() == "ProtectedLogin") {
                fProtectedLogin = child->getParam("value", "0").to_uint();
            } else if (child->getName() == "BuildType") {
                fBuildType = child->getParam("value", "0").to_uint();
            } else if (child->getName() == "SourceAddress") {
                fSrcAddr = child->getParam("IP", "0").to_uint();
                fSrcPort = child->getParam("Port", "0").to_uint();
            } else if (child->getName() == "Reserved") {
                fReserved = child->getParam("value", "0").to_uint();
            } else if (child->getName() == "ClientKey") {
                fClientKey = child->getParam("value", "");
            } else {
                throw pfPrcTagException(__FILE__, __LINE__, child->getName());
            }
            child = child->getNextSibling();
        }
    } else {
        plCreatable::IPrcParse(tag, mgr);
    }
}
Exemplo n.º 12
0
void plAvatarSetTypeMsg::IPrcParse(const pfPrcTag* tag, plResManager* mgr) {
    if (tag->getName() == "AvatarType") {
        fIsPlayer = tag->getParam("IsPlayer", "False").to_bool();
    } else {
        throw pfPrcTagException(__FILE__, __LINE__, tag->getName());
    }
}
Exemplo n.º 13
0
void plAvSeekMsg::IPrcParse(const pfPrcTag* tag, plResManager* mgr) {
    if (tag->getName() == "SeekParams") {
        fDuration = tag->getParam("Duration", "0").toFloat();
        fSmartSeek = tag->getParam("SmartSeek", "true").toBool();
        fAnimName = tag->getParam("AnimName", "");
        fAlignType = tag->getParam("AlignType", "0").toUint();
        fNoSeek = tag->getParam("NoSeek", "false").toBool();
        fFlags = tag->getParam("Flags", "0").toUint();
    } else if (tag->getName() == "SeekPoint") {
        const pfPrcTag* child = tag->getFirstChild();
        while (child != NULL) {
            if (child->getName() == "plKey") {
                fSeekPoint = mgr->prcParseKey(child);
            } else if (child->getName() == "TargetPos") {
                if (child->hasChildren())
                    fTargetPos.prcParse(child->getFirstChild());
            } else if (child->getName() == "TargetLook") {
                if (child->hasChildren())
                    fTargetLookAt.prcParse(child->getFirstChild());
            } else {
                throw pfPrcTagException(__FILE__, __LINE__, child->getName());
            }
            child = child->getNextSibling();
        }
    } else if (tag->getName() == "FinishKey") {
        if (tag->hasChildren())
            fFinishKey = mgr->prcParseKey(tag->getFirstChild());
    } else {
        plAvTaskMsg::IPrcParse(tag, mgr);
    }
}
Exemplo n.º 14
0
void plAGMasterMod::IPrcParse(const pfPrcTag* tag, plResManager* mgr) {
    if (tag->getName() == "Group") {
        fGroupName = tag->getParam("Name", "");
        fIsGrouped = tag->getParam("IsGrouped", "False").toBool();
        fIsGroupMaster = tag->getParam("IsGroupMaster", "False").toBool();
        if (tag->hasChildren()) {
            const pfPrcTag* child = tag->getFirstChild();
            if (child->getName() != "MsgForwarder")
                throw pfPrcTagException(__FILE__, __LINE__, child->getName());
            if (child->hasChildren())
                fMsgForwarder = mgr->prcParseKey(child->getFirstChild());;;;;;;
        }
    } else if (tag->getName() == "PrivateAnims") {
        fPrivateAnims.resize(tag->countChildren());
        const pfPrcTag* child = tag->getFirstChild();
        for (size_t i=0; i<fPrivateAnims.size(); i++) {
            fPrivateAnims[i] = mgr->prcParseKey(child);
            child = child->getNextSibling();
        }
    } else if (tag->getName() == "EoaKeys") {
        fEoaKeys2.resize(tag->countChildren());
        const pfPrcTag* child = tag->getFirstChild();
        for (size_t i=0; i<fEoaKeys2.size(); i++) {
            fEoaKeys2[i] = mgr->prcParseKey(child);
            child = child->getNextSibling();
        }
    } else {
        plSynchedObject::IPrcParse(tag, mgr);
    }
}
Exemplo n.º 15
0
void plSpanEncoding::prcParse(const pfPrcTag* tag) {
    if (tag->getName() != "plSpanEncoding")
        throw pfPrcTagException(__FILE__, __LINE__, tag->getName());

    fCode = tag->getParam("Code", "0").to_uint();
    fPosScale = tag->getParam("PosScale", "0").to_float();
}
Exemplo n.º 16
0
void plPageInfo::prcParse(const pfPrcTag* tag) {
    if (tag->getName() != "Page")
        throw pfPrcTagException(__FILE__, __LINE__, tag->getName());
    fAge = tag->getParam("AgeName", "");
    fPage = tag->getParam("PageName", "");
    fLocation.prcParse(tag);
}
Exemplo n.º 17
0
void hsBounds::IPrcParse(const pfPrcTag* tag) {
    if (tag->getName() == "BoundsInfo") {
        fType = tag->getParam("Type", "0").toInt();
    } else {
        throw pfPrcTagException(__FILE__, __LINE__, tag->getName());
    }
}
Exemplo n.º 18
0
void plSimpleParticleGenerator::IPrcParse(const pfPrcTag* tag, plResManager* mgr) {
    if (tag->getName() == "ParticleParams") {
        fGenLife = tag->getParam("GenLife", "0").to_float();
        fPartLifeMin = tag->getParam("PartLifeMin", "0").to_float();
        fPartLifeMax = tag->getParam("PartLifeMax", "0").to_float();
        fParticlesPerSecond = tag->getParam("ParticlesPerSecond", "0").to_float();
        fPartMassRange = tag->getParam("ParticleMass", "0").to_float();
        fPartRadsPerSecRange = tag->getParam("RadsPerSecond", "0").to_float();
    } else if (tag->getName() == "GeneratorParams") {
        fAngleRange = tag->getParam("AngleRange", "0").to_float();
        fVelMin = tag->getParam("VelMin", "0").to_float();
        fVelMax = tag->getParam("VelMax", "0").to_float();
        fXSize = tag->getParam("XSize", "0").to_float();
        fYSize = tag->getParam("YSize", "0").to_float();
        fScaleMin = tag->getParam("ScaleMin", "0").to_float();
        fScaleMax = tag->getParam("ScaleMax", "0").to_float();
    } else if (tag->getName() == "ParticleSources") {
        size_t count = tag->countChildren();
        fInitPos.resize(count);
        fInitPitch.resize(count);
        fInitYaw.resize(count);
        const pfPrcTag* child = tag->getFirstChild();
        for (size_t i = 0; i < count; ++i) {
            if (child->getName() != "Source")
                throw pfPrcTagException(__FILE__, __LINE__, child->getName());
            fInitPitch[i] = tag->getParam("Pitch", "0").to_float();
            fInitYaw[i] = tag->getParam("Yaw", "0").to_float();
            if (child->hasChildren())
                fInitPos[i].prcParse(child->getFirstChild());
            child = child->getNextSibling();
        }
    } else {
        plCreatable::IPrcParse(tag, mgr);
    }
}
Exemplo n.º 19
0
void plNetMessage::IPrcParse(const pfPrcTag* tag, plResManager* mgr) {
    if (tag->getName() == "NetMsgParams") {
        fFlags = tag->getParam("Flags", "0").to_uint();
        const pfPrcTag* child = tag->getFirstChild();
        while (child != NULL) {
            if (child->getName() == "ProtocolVersion") {
                fProtocolVerMaj = child->getParam("Major", "12").to_uint();
                fProtocolVerMin = child->getParam("Minor", "6").to_uint();
            } else if (child->getName() == "TimeSent") {
                if (child->hasChildren())
                    fTimeSent.prcParse(child->getFirstChild());
            } else if (child->getName() == "Context") {
                fContext = child->getParam("value", "0").to_uint();
            } else if (child->getName() == "Transaction") {
                fTransID = child->getParam("ID", "0").to_uint();
            } else if (child->getName() == "Player") {
                fPlayerID = child->getParam("ID", "0").to_uint();
            } else if (child->getName() == "AccountUuid") {
                if (child->hasChildren())
                    fAcctUuid.prcParse(child->getFirstChild());
            } else {
                throw pfPrcTagException(__FILE__, __LINE__, child->getName());
            }
            child = child->getNextSibling();
        }
    } else {
        plCreatable::IPrcParse(tag, mgr);
    }
}
Exemplo n.º 20
0
void hsBitVector::prcParse(const pfPrcTag* tag) {
    if (tag->getName() != "hsBitVector")
        throw pfPrcTagException(__FILE__, __LINE__, tag->getName());

    hsTList<plString> flags = tag->getContents();
    while (!flags.empty())
        setBit(getValue(flags.pop()));
}
Exemplo n.º 21
0
void plNetGroupId::prcParse(const pfPrcTag* tag) {
    if (tag->getName() != "plNetGroupId")
        throw pfPrcTagException(__FILE__, __LINE__, tag->getName());

    fFlags = tag->getParam("Flags", "0").to_uint();
    if (tag->hasChildren())
        fID.prcParse(tag->getFirstChild());
}
Exemplo n.º 22
0
void hsVector3::prcParse(const pfPrcTag* tag) {
    if (tag->getName() != "hsVector3")
        throw pfPrcTagException(__FILE__, __LINE__, tag->getName());

    X = tag->getParam("X", "0").toFloat();
    Y = tag->getParam("Y", "0").toFloat();
    Z = tag->getParam("Z", "0").toFloat();
}
Exemplo n.º 23
0
void hsQuat::prcParse(const pfPrcTag* tag) {
    if (tag->getName() != "hsQuat")
        throw pfPrcTagException(__FILE__, __LINE__, tag->getName());

    X = tag->getParam("X", "0").to_float();
    Y = tag->getParam("Y", "0").to_float();
    Z = tag->getParam("Z", "0").to_float();
    W = tag->getParam("W", "1").to_float();
}
Exemplo n.º 24
0
void plEAXSourceSoftSettings::prcParse(const pfPrcTag* tag) {
    if (tag->getName() != "plEAXSourceSoftSettings")
        throw pfPrcTagException(__FILE__, __LINE__, tag->getName());

    fOcclusion = tag->getParam("Occlusion", "0").to_int();
    fOcclusionLFRatio = tag->getParam("LFRatio", "0").to_float();
    fOcclusionRoomRatio = tag->getParam("RoomRatio", "0").to_float();
    fOcclusionDirectRatio = tag->getParam("DirectRatio", "0").to_float();
}
Exemplo n.º 25
0
void plAnimStage::prcParseAux(const pfPrcTag* tag) {
    if (tag->getName() != "plAnimStage_Aux")
        throw pfPrcTagException(__FILE__, __LINE__, tag->getName());

    fLocalTime = tag->getParam("LocalTime", "0").to_float();
    fLength = tag->getParam("Length", "0").to_float();
    fCurLoop = tag->getParam("CurLoop", "0").to_int();
    fAttached = tag->getParam("Attached", "False").to_bool();
}
Exemplo n.º 26
0
void plDynaDecalMgr::IPrcParse(const pfPrcTag* tag, plResManager* mgr) {
    if (tag->getName() == "PreShade") {
        if (tag->hasChildren())
            fMatPreShade = mgr->prcParseKey(tag->getFirstChild());
    } else if (tag->getName() == "RTShade") {
        if (tag->hasChildren())
            fMatRTShade = mgr->prcParseKey(tag->getFirstChild());
    } else if (tag->getName() == "Targets") {
        fTargets.resize(tag->countChildren());
        const pfPrcTag* child = tag->getFirstChild();
        for (size_t i=0; i<fTargets.size(); i++) {
            fTargets[i] = mgr->prcParseKey(child);
            child = child->getNextSibling();
        }
    } else if (tag->getName() == "PartyObjects") {
        fPartyObjects.resize(tag->countChildren());
        const pfPrcTag* child = tag->getFirstChild();
        for (size_t i=0; i<fPartyObjects.size(); i++) {
            fPartyObjects[i] = mgr->prcParseKey(child);
            child = child->getNextSibling();
        }
    } else if (tag->getName() == "DynaDecalParams") {
        fMaxNumVerts = tag->getParam("MaxNumVerts", "0").toUint();
        fMaxNumIdx = tag->getParam("MaxNumIndices", "0").toUint();
        fWaitOnEnable = tag->getParam("WaintOnEnable", "0").toUint();
        fPartyTime = tag->getParam("PartyTime", "0").toFloat();
    } else if (tag->getName() == "DynaDecalMetrics") {
        fIntensity = tag->getParam("Intensity", "0").toFloat();
        fWetLength = tag->getParam("WetLength", "0").toFloat();
        fRampEnd = tag->getParam("RampEnd", "0").toFloat();
        fDecayStart = tag->getParam("DecayStart", "0").toFloat();
        fLifeSpan = tag->getParam("LifeSpan", "0").toFloat();

        const pfPrcTag* child = tag->getFirstChild();
        while (child != NULL) {
            if (child->getName() == "GridSize") {
                fGridSizeU = child->getParam("U", "0").toFloat();
                fGridSizeV = child->getParam("V", "0").toFloat();
            } else if (child->getName() == "Scale") {
                if (child->hasChildren())
                    fScale.prcParse(child->getFirstChild());
            } else {
                throw pfPrcTagException(__FILE__, __LINE__, child->getName());
            }
            child = child->getNextSibling();
        }
    } else if (tag->getName() == "Notifies") {
        fNotifies.resize(tag->countChildren());
        const pfPrcTag* child = tag->getFirstChild();
        for (size_t i=0; i<fNotifies.size(); i++) {
            fNotifies[i] = mgr->prcParseKey(child);
            child = child->getNextSibling();
        }
    } else {
        plSynchedObject::IPrcParse(tag, mgr);
    }
}
Exemplo n.º 27
0
void hsColorRGBA::prcParse(const pfPrcTag* tag) {
    if (tag->getName() != "hsColorRGBA")
        throw pfPrcTagException(__FILE__, __LINE__, tag->getName());

    r = tag->getParam("red", "0").to_float();
    g = tag->getParam("green", "0").to_float();
    b = tag->getParam("blue", "0").to_float();
    a = tag->getParam("alpha", "1").to_float();
}
Exemplo n.º 28
0
void hsPlane3::prcParse(const pfPrcTag* tag) {
    if (tag->getName() != "hsPlane3")
        throw pfPrcTagException(__FILE__, __LINE__, tag->getName());

    N.X = tag->getParam("X", "0").toFloat();
    N.Y = tag->getParam("Y", "0").toFloat();
    N.Z = tag->getParam("Z", "0").toFloat();
    W = tag->getParam("W", "0").toFloat();
}
Exemplo n.º 29
0
void hsBounds::prcParse(const pfPrcTag* tag) {
    if (tag->getName() != ClassName())
        throw pfPrcTagException(__FILE__, __LINE__, tag->getName());

    const pfPrcTag* child = tag->getFirstChild();
    while (child != NULL) {
        IPrcParse(child);
        child = child->getNextSibling();
    }
}
Exemplo n.º 30
0
proEventData* proEventData::ICreateEventDataType(const char* typeName) {
    int type = -1;
    for (int i=0; i<kNone; i++) {
        if (strcmp(typeName, fEventNames[i]) == 0)
           type = i;
    }
    if (type < 0)
        throw pfPrcTagException(__FILE__, __LINE__, typeName);
    return ICreateEventDataType(type);
}