コード例 #1
0
ファイル: loadmgef.cpp プロジェクト: RavuAlHemio/openmw
void MagicEffect::load(ESMReader &esm)
{
  esm.getHNT(mIndex, "INDX");

  esm.getHNT(mData, "MEDT", 36);
  if (esm.getFormat() == 0)
  {
      // don't allow mods to change fixed flags in the legacy format
      mData.mFlags &= (AllowSpellmaking | AllowEnchanting | NegativeLight);
      if (mIndex>=0 && mIndex<NumberOfHardcodedFlags)
        mData.mFlags |= HardcodedFlags[mIndex];
  }

  mIcon = esm.getHNOString("ITEX");
  mParticle = esm.getHNOString("PTEX");

  mBoltSound = esm.getHNOString("BSND");
  mCastSound = esm.getHNOString("CSND");
  mHitSound = esm.getHNOString("HSND");
  mAreaSound = esm.getHNOString("ASND");

  mCasting = esm.getHNOString("CVFX");
  mBolt = esm.getHNOString("BVFX");
  mHit = esm.getHNOString("HVFX");
  mArea = esm.getHNOString("AVFX");

  mDescription = esm.getHNOString("DESC");
}
コード例 #2
0
ファイル: cellref.cpp プロジェクト: psi29a/openmw
void ESM::RefNum::load (ESMReader& esm, bool wide, const std::string& tag)
{
    if (wide)
        esm.getHNT (*this, tag.c_str(), 8);
    else
        esm.getHNT (mIndex, tag.c_str());
}
コード例 #3
0
ファイル: loadlevlist.cpp プロジェクト: Adrian-Revk/openmw
void LeveledListBase::load(ESMReader &esm)
{
    esm.getHNT(mFlags, "DATA");
    esm.getHNT(mChanceNone, "NNAM");

    if (esm.isNextSub("INDX"))
    {
        int len;
        esm.getHT(len);
        mList.resize(len);
    }
    else
        return;

    // TODO: Merge with an existing lists here. This can be done
    // simply by adding the lists together, making sure that they are
    // sorted by level. A better way might be to exclude repeated
    // items. Also, some times we don't want to merge lists, just
    // overwrite. Figure out a way to give the user this option.

    for (size_t i = 0; i < mList.size(); i++)
    {
        LevelItem &li = mList[i];
        li.mId = esm.getHNString(mRecName);
        esm.getHNT(li.mLevel, "INTV");
    }
}
コード例 #4
0
ファイル: projectilestate.cpp プロジェクト: 0xmono/openmw
 void BaseProjectileState::load(ESMReader &esm)
 {
     mId = esm.getHNString("ID__");
     esm.getHNT (mPosition, "VEC3");
     esm.getHNT (mOrientation, "QUAT");
     esm.getHNT (mActorId, "ACTO");
 }
コード例 #5
0
ファイル: loadcrea.cpp プロジェクト: 0xmono/openmw
void Creature::load(ESMReader &esm)
{
    mPersistent = esm.getRecordFlags() & 0x0400;

    mModel = esm.getHNString("MODL");
    mOriginal = esm.getHNOString("CNAM");
    mName = esm.getHNOString("FNAM");
    mScript = esm.getHNOString("SCRI");

    esm.getHNT(mData, "NPDT", 96);

    esm.getHNT(mFlags, "FLAG");
    mScale = 1.0;
    esm.getHNOT(mScale, "XSCL");

    mInventory.load(esm);
    mSpells.load(esm);

    if (esm.isNextSub("AIDT"))
    {
        esm.getHExact(&mAiData, sizeof(mAiData));
        mHasAI = true;
    }
    else
        mHasAI = false;

    mAiPackage.load(esm);
    esm.skipRecord();
}
コード例 #6
0
ファイル: spellstate.cpp プロジェクト: 0xmono/openmw
    void SpellState::load(ESMReader &esm)
    {
        while (esm.isNextSub("SPEL"))
        {
            std::string id = esm.getHString();

            std::map<const int, float> random;
            while (esm.isNextSub("INDX"))
            {
                int index;
                esm.getHT(index);

                float magnitude;
                esm.getHNT(magnitude, "RAND");

                random[index] = magnitude;
            }

            mSpells[id] = random;
        }

        while (esm.isNextSub("USED"))
        {
            std::string id = esm.getHString();
            TimeStamp time;
            esm.getHNT(time, "TIME");

            mUsedPowers[id] = time;
        }

        mSelectedSpell = esm.getHNOString("SLCT");
    }
コード例 #7
0
ファイル: aisequence.cpp プロジェクト: EmperorArthur/openmw
 void AiEscort::load(ESMReader &esm)
 {
     esm.getHNT (mData, "DATA");
     mTargetId = esm.getHNString("TARG");
     esm.getHNT (mRemainingDuration, "DURA");
     mCellId = esm.getHNOString ("CELL");
 }
コード例 #8
0
ファイル: aisequence.cpp プロジェクト: Allxere/openmw
 void AiFollow::load(ESMReader &esm)
 {
     esm.getHNT (mData, "DATA");
     mTargetId = esm.getHNString("TARG");
     esm.getHNT (mRemainingDuration, "DURA");
     mCellId = esm.getHNOString ("CELL");
     esm.getHNT (mAlwaysFollow, "ALWY");
 }
コード例 #9
0
ファイル: loadskil.cpp プロジェクト: 0xmono/openmw
void Skill::load(ESMReader &esm)
{
    esm.getHNT(mIndex, "INDX");
    esm.getHNT(mData, "SKDT", 24);
    mDescription = esm.getHNOString("DESC");

    // create an ID from the index and the name (only used in the editor and likely to change in the
    // future)
    mId = indexToId (mIndex);
}
コード例 #10
0
ファイル: weatherstate.cpp プロジェクト: A1-Triard/openmw
    void WeatherState::load(ESMReader& esm)
    {
        mCurrentRegion = esm.getHNString(currentRegionRecord);
        esm.getHNT(mTimePassed, timePassedRecord);
        esm.getHNT(mFastForward, fastForwardRecord);
        esm.getHNT(mWeatherUpdateTime, weatherUpdateTimeRecord);
        esm.getHNT(mTransitionFactor, transitionFactorRecord);
        esm.getHNT(mCurrentWeather, currentWeatherRecord);
        esm.getHNT(mNextWeather, nextWeatherRecord);
        esm.getHNT(mQueuedWeather, queuedWeatherRecord);

        while(esm.peekNextSub(regionNameRecord))
        {
            std::string regionID = esm.getHNString(regionNameRecord);
            RegionWeatherState region;
            esm.getHNT(region.mWeather, regionWeatherRecord);
            while(esm.peekNextSub(regionChanceRecord))
            {
                char chance;
                esm.getHNT(chance, regionChanceRecord);
                region.mChances.push_back(chance);
            }

            mRegions.insert(std::make_pair(regionID, region));
        }
    }
コード例 #11
0
ファイル: aisequence.cpp プロジェクト: EmperorArthur/openmw
 void AiWander::load(ESMReader &esm)
 {
     esm.getHNT (mData, "DATA");
     esm.getHNT(mDurationData, "STAR"); // was mStartTime
     mStoredInitialActorPosition = false;
     if (esm.isNextSub("POS_"))
     {
         mStoredInitialActorPosition = true;
         esm.getHT(mInitialActorPosition);
     }
 }
コード例 #12
0
ファイル: aisequence.cpp プロジェクト: EmperorArthur/openmw
 void AiFollow::load(ESMReader &esm)
 {
     esm.getHNT (mData, "DATA");
     mTargetId = esm.getHNString("TARG");
     esm.getHNT (mRemainingDuration, "DURA");
     mCellId = esm.getHNOString ("CELL");
     esm.getHNT (mAlwaysFollow, "ALWY");
     mCommanded = false;
     esm.getHNOT (mCommanded, "CMND");
     mActive = false;
     esm.getHNOT (mActive, "ACTV");
 }
コード例 #13
0
ファイル: loadcont.cpp プロジェクト: DavidBairamian/openmw
void Container::load(ESMReader &esm)
{
    mModel = esm.getHNString("MODL");
    mName = esm.getHNOString("FNAM");
    esm.getHNT(mWeight, "CNDT", 4);
    esm.getHNT(mFlags, "FLAG", 4);

    if (mFlags & 0xf4)
        esm.fail("Unknown flags");
    if (!(mFlags & 0x8))
        esm.fail("Flag 8 not set");

    mScript = esm.getHNOString("SCRI");

    mInventory.load(esm);
}
コード例 #14
0
ファイル: loadrace.cpp プロジェクト: Adrian-Revk/openmw
void Race::load(ESMReader &esm)
{
    mName = esm.getHNString("FNAM");
    esm.getHNT(mData, "RADT", 140);
    mPowers.load(esm);
    mDescription = esm.getHNOString("DESC");
}
コード例 #15
0
ファイル: journalentry.cpp プロジェクト: 0xmono/openmw
void ESM::JournalEntry::load (ESMReader &esm)
{
    esm.getHNOT (mType, "JETY");
    mTopic = esm.getHNString ("YETO");
    mInfo = esm.getHNString ("YEIN");
    mText = esm.getHNString ("TEXT");

    if (mType==Type_Journal)
    {
        esm.getHNT (mDay, "JEDA");
        esm.getHNT (mMonth, "JEMO");
        esm.getHNT (mDayOfMonth, "JEDM");
    }
    else if (mType==Type_Topic)
        mActorName = esm.getHNOString("ACT_");
}
コード例 #16
0
ファイル: projectilestate.cpp プロジェクト: 0xmono/openmw
    void ProjectileState::load(ESMReader &esm)
    {
        BaseProjectileState::load(esm);

        mBowId = esm.getHNString ("BOW_");
        esm.getHNT (mVelocity, "VEL_");
    }
コード例 #17
0
ファイル: loadland.hpp プロジェクト: am0s/openmw
  void load(ESMReader &esm)
  {
    // Get the grid location
    esm.getSubNameIs("INTV");
    esm.getT(X);
    esm.getT(Y);

    esm.getHNT(flags, "DATA");

    // Store the file position
    context = esm.getContext();

    hasData = false;
    int cnt = 0;

    // Skip these here. Load the actual data when the cell is loaded.
    if(esm.isNextSub("VNML")) {esm.skipHSubSize(12675);cnt++;}
    if(esm.isNextSub("VHGT")) {esm.skipHSubSize(4232);cnt++;}
    if(esm.isNextSub("WNAM")) esm.skipHSubSize(81);
    if(esm.isNextSub("VCLR")) esm.skipHSubSize(12675);
    if(esm.isNextSub("VTEX")) {esm.skipHSubSize(512);cnt++;}

    // We need all three of VNML, VHGT and VTEX in order to use the
    // landscape.
    hasData = (cnt == 3);
  }
コード例 #18
0
ファイル: player.cpp プロジェクト: alisci01/openmw
void ESM::Player::load (ESMReader &esm)
{
    mObject.load (esm);

    mCellId.load (esm);

    esm.getHNT (mLastKnownExteriorPosition, "LKEP", 12);

    if (esm.isNextSub ("MARK"))
    {
        mHasMark = true;
        esm.getHT (mMarkedPosition, 24);
        mMarkedCell.load (esm);
    }
    else
        mHasMark = false;

    mAutoMove = 0;
    esm.getHNOT (mAutoMove, "AMOV");

    mBirthsign = esm.getHNString ("SIGN");

    mCurrentCrimeId = -1;
    esm.getHNOT (mCurrentCrimeId, "CURD");
    mPayedCrimeId = -1;
    esm.getHNOT (mPayedCrimeId, "PAYD");
}
コード例 #19
0
ファイル: loadscpt.cpp プロジェクト: AAlderman/openmw
    void Script::load(ESMReader &esm)
    {
        SCHD data;
        esm.getHNT(data, "SCHD", 52);
        mData = data.mData;
        mId = data.mName.toString();

        mVarNames.clear();

        while (esm.hasMoreSubs())
        {
            esm.getSubName();
            uint32_t name = esm.retSubName().val;
            switch (name)
            {
                case ESM::FourCC<'S','C','V','R'>::value:
                    // list of local variables
                    loadSCVR(esm);
                    break;
                case ESM::FourCC<'S','C','D','T'>::value:
                    // compiled script
                    mScriptData.resize(mData.mScriptDataSize);
                    esm.getHExact(&mScriptData[0], mScriptData.size());
                    break;
                case ESM::FourCC<'S','C','T','X'>::value:
                    mScriptText = esm.getHString();
                    break;
                default:
                    esm.fail("Unknown subrecord");
            }
        }
    }
コード例 #20
0
ファイル: loadsndg.cpp プロジェクト: AlfredBroda/openmw
void SoundGenerator::load(ESMReader &esm)
{
  esm.getHNT(type, "DATA", 4);

  creature = esm.getHNOString("CNAM");
  sound = esm.getHNOString("SNAM");
}
コード例 #21
0
ファイル: loadpgrd.cpp プロジェクト: StableOrbital/openmw
void PathGrid::load(ESMReader &esm)
{
    esm.getHNT(data, "DATA", 12);
    cell = esm.getHNString("NAME");

    // Remember this file position
    context = esm.getContext();

    // Check that the sizes match up. Size = 16 * s2 (path points?)
    if (esm.isNextSub("PGRP"))
    {
        esm.skipHSub();
        int size = esm.getSubSize();
        if (size != 16 * data.s2)
            esm.fail("Path grid table size mismatch");
    }

    // Size varies. Path grid chances? Connections? Multiples of 4
    // suggest either int or two shorts, or perhaps a float. Study
    // it later.
    if (esm.isNextSub("PGRC"))
    {
        esm.skipHSub();
        int size = esm.getSubSize();
        if (size % 4 != 0)
            esm.fail("PGRC size not a multiple of 4");
    }
}
コード例 #22
0
ファイル: cellref.cpp プロジェクト: Kleptoid/openmw
void ESM::CellRef::loadId(ESMReader &esm, bool wideRefNum)
{
    // According to Hrnchamd, this does not belong to the actual ref. Instead, it is a marker indicating that
    // the following refs are part of a "temp refs" section. A temp ref is not being tracked by the moved references system.
    // Its only purpose is a performance optimization for "immovable" things. We don't need this, and it's problematic anyway,
    // because any item can theoretically be moved by a script.
    if (esm.isNextSub ("NAM0"))
        esm.skipHSub();

    if (wideRefNum)
        esm.getHNT (mRefNum, "FRMR", 8);
    else
        esm.getHNT (mRefNum.mIndex, "FRMR");

    mRefID = esm.getHNString ("NAME");
}
コード例 #23
0
ファイル: loadingr.cpp プロジェクト: AlfredBroda/openmw
void Ingredient::load(ESMReader &esm)
{
    model = esm.getHNString("MODL");
    name = esm.getHNString("FNAM");
    esm.getHNT(data, "IRDT", 56);
    script = esm.getHNOString("SCRI");
    icon = esm.getHNOString("ITEX");
}
コード例 #24
0
ファイル: loadmisc.hpp プロジェクト: dhardy/openmw
 void load(ESMReader &esm)
 {
   model = esm.getHNString("MODL");
   name = esm.getHNOString("FNAM");
   esm.getHNT(data, "MCDT", 12);
   script = esm.getHNOString("SCRI");
   icon = esm.getHNOString("ITEX");
 }
コード例 #25
0
ファイル: loadfact.cpp プロジェクト: ChairGraveyard/TES3MP
    void Faction::load(ESMReader &esm, bool &isDeleted)
    {
        isDeleted = false;

        mReactions.clear();
        for (int i=0;i<10;++i)
            mRanks[i].clear();

        int rankCounter = 0;
        bool hasName = false;
        bool hasData = false;
        while (esm.hasMoreSubs())
        {
            esm.getSubName();
            switch (esm.retSubName().val)
            {
                case ESM::SREC_NAME:
                    mId = esm.getHString();
                    hasName = true;
                    break;
                case ESM::FourCC<'F','N','A','M'>::value:
                    mName = esm.getHString();
                    break;
                case ESM::FourCC<'R','N','A','M'>::value:
                    if (rankCounter >= 10)
                        esm.fail("Rank out of range");
                    mRanks[rankCounter++] = esm.getHString();
                    break;
                case ESM::FourCC<'F','A','D','T'>::value:
                    esm.getHT(mData, 240);
                    if (mData.mIsHidden > 1)
                        esm.fail("Unknown flag!");
                    hasData = true;
                    break;
                case ESM::FourCC<'A','N','A','M'>::value:
                {
                    std::string faction = esm.getHString();
                    int reaction;
                    esm.getHNT(reaction, "INTV");
                    mReactions[faction] = reaction;
                    break;
                }
                case ESM::SREC_DELE:
                    esm.skipHSub();
                    isDeleted = true;
                    break;
                default:
                    esm.fail("Unknown subrecord");
                    break;
            }
        }

        if (!hasName)
            esm.fail("Missing NAME subrecord");
        if (!hasData && !isDeleted)
            esm.fail("Missing FADT subrecord");
    }
コード例 #26
0
ファイル: loadweap.cpp プロジェクト: Adrian-Revk/openmw
void Weapon::load(ESMReader &esm)
{
    mModel = esm.getHNString("MODL");
    mName = esm.getHNOString("FNAM");
    esm.getHNT(mData, "WPDT", 32);
    mScript = esm.getHNOString("SCRI");
    mIcon = esm.getHNOString("ITEX");
    mEnchant = esm.getHNOString("ENAM");
}
コード例 #27
0
ファイル: globalmap.cpp プロジェクト: Chiur/openmw
void ESM::GlobalMap::load (ESMReader &esm)
{
    esm.getHNT(mBounds, "BNDS");

    esm.getSubNameIs("DATA");
    esm.getSubHeader();
    mImageData.resize(esm.getSubSize());
    esm.getExact(&mImageData[0], mImageData.size());
}
コード例 #28
0
ファイル: loadnpc.cpp プロジェクト: Adrian-Revk/openmw
void NPC::load(ESMReader &esm)
{
    mNpdt52.mGold = -10;

    mPersistent = esm.getRecordFlags() & 0x0400;

    mModel = esm.getHNOString("MODL");
    mName = esm.getHNOString("FNAM");

    mRace = esm.getHNString("RNAM");
    mClass = esm.getHNString("CNAM");
    mFaction = esm.getHNString("ANAM");
    mHead = esm.getHNString("BNAM");
    mHair = esm.getHNString("KNAM");

    mScript = esm.getHNOString("SCRI");

    esm.getSubNameIs("NPDT");
    esm.getSubHeader();
    if (esm.getSubSize() == 52)
    {
        mNpdtType = 52;
        esm.getExact(&mNpdt52, 52);
    }
    else if (esm.getSubSize() == 12)
    {
        mNpdtType = 12;
        esm.getExact(&mNpdt12, 12);
    }
    else
        esm.fail("NPC_NPDT must be 12 or 52 bytes long");

    esm.getHNT(mFlags, "FLAG");

    mInventory.load(esm);
    mSpells.load(esm);

    if (esm.isNextSub("AIDT"))
    {
        esm.getHExact(&mAiData, sizeof(mAiData));
        mHasAI= true;
    }
    else
        mHasAI = false;

    while (esm.isNextSub("DODT") || esm.isNextSub("DNAM")) {
        if (esm.retSubName() == 0x54444f44) { // DODT struct
            Dest dodt;
            esm.getHExact(&dodt.mPos, 24);
            mTransport.push_back(dodt);
        } else if (esm.retSubName() == 0x4d414e44) { // DNAM struct
            mTransport.back().mCellName = esm.getHString();
        }
    }
    mAiPackage.load(esm);
    esm.skipRecord();
}
コード例 #29
0
ファイル: loadclas.cpp プロジェクト: 0xmono/openmw
void Class::load(ESMReader &esm)
{
    mName = esm.getHNOString("FNAM");
    esm.getHNT(mData, "CLDT", 60);

    if (mData.mIsPlayable > 1)
        esm.fail("Unknown bool value");

    mDescription = esm.getHNOString("DESC");
}
コード例 #30
0
ファイル: projectilestate.cpp プロジェクト: A1-Triard/openmw
    void ProjectileState::load(ESMReader &esm)
    {
        BaseProjectileState::load(esm);

        mBowId = esm.getHNString ("BOW_");
        esm.getHNT (mVelocity, "VEL_");

        mAttackStrength = 1.f;
        esm.getHNOT(mAttackStrength, "STR_");
    }