1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-01 03:21:41 +00:00
OpenMW/apps/essimporter/importercontext.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

90 lines
2.6 KiB
C++
Raw Normal View History

#ifndef OPENMW_ESSIMPORT_CONTEXT_H
#define OPENMW_ESSIMPORT_CONTEXT_H
#include <map>
#include <components/esm3/controlsstate.hpp>
#include <components/esm3/dialoguestate.hpp>
#include <components/esm3/globalmap.hpp>
#include <components/esm3/loadcrea.hpp>
#include <components/esm3/loadnpc.hpp>
#include <components/esm3/player.hpp>
2015-01-19 12:16:12 +00:00
#include "importcntc.hpp"
#include "importcrec.hpp"
#include "importnpcc.hpp"
#include "importsplm.h"
namespace ESSImport
{
struct Context
{
// set from the TES3 header
std::string mPlayerCellName;
ESM::Player mPlayer;
ESM::NPC mPlayerBase;
std::string mCustomPlayerClassName;
ESM::DialogueState mDialogueState;
ESM::ControlsState mControlsState;
// cells which should show an explored overlay on the global map
std::set<std::pair<int, int>> mExploredCells;
2015-01-22 23:15:57 +00:00
ESM::GlobalMap mGlobalMapState;
int mDay, mMonth, mYear;
float mHour;
// key <refIndex, refId>
std::map<std::pair<int, ESM::RefId>, CREC> mCreatureChanges;
std::map<std::pair<int, ESM::RefId>, NPCC> mNpcChanges;
std::map<std::pair<int, ESM::RefId>, CNTC> mContainerChanges;
std::map<std::pair<int, ESM::RefId>, int> mActorIdMap;
int mNextActorId;
std::map<ESM::RefId, ESM::Creature> mCreatures;
std::map<ESM::RefId, ESM::NPC> mNpcs;
2015-01-30 21:07:21 +00:00
std::vector<SPLM::ActiveSpell> mActiveSpells;
Context()
2015-07-11 01:33:31 +00:00
: mDay(0)
, mMonth(0)
, mYear(0)
, mHour(0.f)
, mNextActorId(0)
{
ESM::CellId playerCellId;
playerCellId.mPaged = true;
playerCellId.mIndex.mX = playerCellId.mIndex.mY = 0;
mPlayer.mCellId = playerCellId;
mPlayer.mLastKnownExteriorPosition[0] = mPlayer.mLastKnownExteriorPosition[1]
= mPlayer.mLastKnownExteriorPosition[2] = 0.0f;
2016-12-18 03:37:59 +00:00
mPlayer.mHasMark = 0;
mPlayer.mCurrentCrimeId = -1; // TODO
mPlayer.mPaidCrimeId = -1;
mPlayer.mObject.blank();
mPlayer.mObject.mEnabled = true;
mPlayer.mObject.mRef.mRefID = ESM::RefId::stringRefId("player"); // REFR.mRefID would be PlayerSaveGame
mPlayer.mObject.mCreatureStats.mActorId = generateActorId();
2015-01-22 23:15:57 +00:00
mGlobalMapState.mBounds.mMinX = 0;
mGlobalMapState.mBounds.mMaxX = 0;
mGlobalMapState.mBounds.mMinY = 0;
mGlobalMapState.mBounds.mMaxY = 0;
2019-02-17 07:56:24 +00:00
mPlayerBase.blank();
}
int generateActorId() { return mNextActorId++; }
};
}
#endif