OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
converter.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_ESSIMPORT_CONVERTER_H
2 #define OPENMW_ESSIMPORT_CONVERTER_H
3 
4 #include <limits>
5 
6 #include <osg/Image>
7 #include <osg/ref_ptr>
8 
11 
25 
26 #include "importcrec.hpp"
27 #include "importcntc.hpp"
28 
29 #include "importercontext.hpp"
30 #include "importcellref.hpp"
31 #include "importklst.hpp"
32 #include "importgame.hpp"
33 #include "importinfo.hpp"
34 #include "importdial.hpp"
35 #include "importques.hpp"
36 #include "importjour.hpp"
37 #include "importscpt.hpp"
38 
39 #include "convertacdt.hpp"
40 #include "convertnpcc.hpp"
41 #include "convertscpt.hpp"
42 #include "convertplayer.hpp"
43 
44 namespace ESSImport
45 {
46 
47 class Converter
48 {
49 public:
51  virtual int getStage() { return 1; }
52 
53  virtual ~Converter() {}
54 
55  void setContext(Context& context) { mContext = &context; }
56 
59  virtual void read(ESM::ESMReader& esm)
60  {
61  }
62 
65  virtual void write(ESM::ESMWriter& esm)
66  {
67 
68  }
69 
70 protected:
72 };
73 
75 template <typename T>
77 {
78 public:
79  virtual int getStage() { return 0; }
80 
81  virtual void read(ESM::ESMReader& esm)
82  {
83  T record;
84  bool isDeleted = false;
85 
86  record.load(esm, isDeleted);
87  mRecords[record.mId] = record;
88  }
89 
90  virtual void write(ESM::ESMWriter& esm)
91  {
92  for (typename std::map<std::string, T>::const_iterator it = mRecords.begin(); it != mRecords.end(); ++it)
93  {
94  esm.startRecord(T::sRecordId);
95  it->second.save(esm);
96  esm.endRecord(T::sRecordId);
97  }
98  }
99 
100 protected:
101  std::map<std::string, T> mRecords;
102 };
103 
104 class ConvertNPC : public Converter
105 {
106 public:
107  virtual void read(ESM::ESMReader &esm)
108  {
109  ESM::NPC npc;
110  bool isDeleted = false;
111 
112  npc.load(esm, isDeleted);
113  if (npc.mId != "player")
114  {
115  // Handles changes to the NPC struct, but since there is no index here
116  // it will apply to ALL instances of the class. seems to be the reason for the
117  // "feature" in MW where changing AI settings of one guard will change it for all guards of that refID.
119  }
120  else
121  {
123  mContext->mPlayerBase = npc;
125  // FIXME: player start spells and birthsign spells aren't listed here,
126  // need to fix openmw to account for this
127  for (std::vector<std::string>::const_iterator it = npc.mSpells.mList.begin(); it != npc.mSpells.mList.end(); ++it)
129 
130  // Clear the list now that we've written it, this prevents issues cropping up with
131  // ensureCustomData() in OpenMW tripping over no longer existing spells, where an error would be fatal.
133 
134  // Same with inventory. Actually it's strange this would contain something, since there's already an
135  // inventory list in NPCC. There seems to be a fair amount of redundancy in this format.
137  }
138  }
139 };
140 
141 class ConvertCREA : public Converter
142 {
143 public:
144  virtual void read(ESM::ESMReader &esm)
145  {
146  // See comment in ConvertNPC
147  ESM::Creature creature;
148  bool isDeleted = false;
149 
150  creature.load(esm, isDeleted);
151  mContext->mCreatures[Misc::StringUtils::lowerCase(creature.mId)] = creature;
152  }
153 };
154 
155 // Do we need ConvertCONT?
156 // I've seen a CONT record in a certain save file, but the container contents in it
157 // were identical to a corresponding CNTC record. See previous comment about redundancy...
158 
159 class ConvertGlobal : public DefaultConverter<ESM::Global>
160 {
161 public:
162  virtual void read(ESM::ESMReader &esm)
163  {
164  ESM::Global global;
165  bool isDeleted = false;
166 
167  global.load(esm, isDeleted);
168  if (Misc::StringUtils::ciEqual(global.mId, "gamehour"))
169  mContext->mHour = global.mValue.getFloat();
170  if (Misc::StringUtils::ciEqual(global.mId, "day"))
171  mContext->mDay = global.mValue.getInteger();
172  if (Misc::StringUtils::ciEqual(global.mId, "month"))
173  mContext->mMonth = global.mValue.getInteger();
174  if (Misc::StringUtils::ciEqual(global.mId, "year"))
175  mContext->mYear = global.mValue.getInteger();
176  mRecords[global.mId] = global;
177  }
178 };
179 
180 class ConvertClass : public DefaultConverter<ESM::Class>
181 {
182 public:
183  virtual void read(ESM::ESMReader &esm)
184  {
185  ESM::Class class_;
186  bool isDeleted = false;
187 
188  class_.load(esm, isDeleted);
189  if (class_.mId == "NEWCLASSID_CHARGEN")
191 
192  mRecords[class_.mId] = class_;
193  }
194 };
195 
196 class ConvertBook : public DefaultConverter<ESM::Book>
197 {
198 public:
199  virtual void read(ESM::ESMReader &esm)
200  {
201  ESM::Book book;
202  bool isDeleted = false;
203 
204  book.load(esm, isDeleted);
205  if (book.mData.mSkillID == -1)
207 
208  mRecords[book.mId] = book;
209  }
210 };
211 
212 class ConvertNPCC : public Converter
213 {
214 public:
215  virtual void read(ESM::ESMReader &esm)
216  {
217  std::string id = esm.getHNString("NAME");
218  NPCC npcc;
219  npcc.load(esm);
220  if (id == "PlayerSaveGame")
221  {
223  }
224  else
225  {
226  int index = npcc.mNPDT.mIndex;
227  mContext->mNpcChanges.insert(std::make_pair(std::make_pair(index,id), npcc));
228  }
229  }
230 };
231 
232 class ConvertREFR : public Converter
233 {
234 public:
235  virtual void read(ESM::ESMReader &esm)
236  {
237  REFR refr;
238  refr.load(esm);
239  assert(refr.mRefID == "PlayerSaveGame");
241 
243  convertACDT(refr.mActorData.mACDT, cStats);
244 
246  convertNpcData(refr.mActorData, npcStats);
247 
249  if (!refr.mActorData.mSelectedEnchantItem.empty())
250  {
252 
253  for (unsigned int i=0; i<invState.mItems.size(); ++i)
254  {
255  // FIXME: in case of conflict (multiple items with this refID) use the already equipped one?
256  if (Misc::StringUtils::ciEqual(invState.mItems[i].mRef.mRefID, refr.mActorData.mSelectedEnchantItem))
257  invState.mSelectedEnchantItem = i;
258  }
259  }
260  }
261  virtual void write(ESM::ESMWriter& esm)
262  {
264  esm.writeHNString("ID__", mSelectedSpell);
266  }
267 private:
268  std::string mSelectedSpell;
269 };
270 
271 class ConvertPCDT : public Converter
272 {
273 public:
275  : mFirstPersonCam(true),
276  mTeleportingEnabled(true),
277  mLevitationEnabled(true)
278  {}
279 
280  virtual void read(ESM::ESMReader &esm)
281  {
282  PCDT pcdt;
283  pcdt.load(esm);
284 
286  }
287  virtual void write(ESM::ESMWriter &esm)
288  {
290  esm.writeHNT("TELE", mTeleportingEnabled);
291  esm.writeHNT("LEVT", mLevitationEnabled);
293 
295  esm.writeHNT("FIRS", mFirstPersonCam);
297  }
298 private:
302 };
303 
304 class ConvertCNTC : public Converter
305 {
306  virtual void read(ESM::ESMReader &esm)
307  {
308  std::string id = esm.getHNString("NAME");
309  CNTC cntc;
310  cntc.load(esm);
311  mContext->mContainerChanges.insert(std::make_pair(std::make_pair(cntc.mIndex,id), cntc));
312  }
313 };
314 
315 class ConvertCREC : public Converter
316 {
317 public:
318  virtual void read(ESM::ESMReader &esm)
319  {
320  std::string id = esm.getHNString("NAME");
321  CREC crec;
322  crec.load(esm);
323  mContext->mCreatureChanges.insert(std::make_pair(std::make_pair(crec.mIndex,id), crec));
324  }
325 };
326 
327 class ConvertFMAP : public Converter
328 {
329 public:
330  virtual void read(ESM::ESMReader &esm);
331  virtual void write(ESM::ESMWriter &esm);
332 
333 private:
334  osg::ref_ptr<osg::Image> mGlobalMapImage;
335 };
336 
337 class ConvertCell : public Converter
338 {
339 public:
340  virtual void read(ESM::ESMReader& esm);
341  virtual void write(ESM::ESMWriter& esm);
342 
343 private:
344  struct Cell
345  {
347  std::vector<CellRef> mRefs;
348  std::vector<unsigned int> mFogOfWar;
349  };
350 
351  std::map<std::string, Cell> mIntCells;
352  std::map<std::pair<int, int>, Cell> mExtCells;
353 
354  std::vector<ESM::CustomMarker> mMarkers;
355 
356  void writeCell(const Cell& cell, ESM::ESMWriter &esm);
357 };
358 
359 class ConvertKLST : public Converter
360 {
361 public:
362  virtual void read(ESM::ESMReader& esm)
363  {
364  KLST klst;
365  klst.load(esm);
366  mKillCounter = klst.mKillCounter;
367 
369  }
370 
371  virtual void write(ESM::ESMWriter &esm)
372  {
374  for (std::map<std::string, int>::const_iterator it = mKillCounter.begin(); it != mKillCounter.end(); ++it)
375  {
376  esm.writeHNString("ID__", it->first);
377  esm.writeHNT ("COUN", it->second);
378  }
380  }
381 
382 private:
383  std::map<std::string, int> mKillCounter;
384 };
385 
386 class ConvertFACT : public Converter
387 {
388 public:
389  virtual void read(ESM::ESMReader& esm)
390  {
391  ESM::Faction faction;
392  bool isDeleted = false;
393 
394  faction.load(esm, isDeleted);
395  std::string id = Misc::StringUtils::lowerCase(faction.mId);
396 
397  for (std::map<std::string, int>::const_iterator it = faction.mReactions.begin(); it != faction.mReactions.end(); ++it)
398  {
399  std::string faction2 = Misc::StringUtils::lowerCase(it->first);
400  mContext->mDialogueState.mChangedFactionReaction[id].insert(std::make_pair(faction2, it->second));
401  }
402  }
403 };
404 
406 class ConvertSTLN : public Converter
407 {
408 public:
409  virtual void read(ESM::ESMReader &esm)
410  {
411  std::string itemid = esm.getHNString("NAME");
413 
414  while (esm.isNextSub("FNAM") || esm.isNextSub("ONAM"))
415  {
416  if (esm.retSubName().toString() == "FNAM")
417  {
418  std::string factionid = esm.getHString();
419  mStolenItems[itemid].insert(std::make_pair(Misc::StringUtils::lowerCase(factionid), true));
420  }
421  else
422  {
423  std::string ownerid = esm.getHString();
424  mStolenItems[itemid].insert(std::make_pair(Misc::StringUtils::lowerCase(ownerid), false));
425  }
426  }
427  }
428  virtual void write(ESM::ESMWriter &esm)
429  {
430  ESM::StolenItems items;
431  for (std::map<std::string, std::set<Owner> >::const_iterator it = mStolenItems.begin(); it != mStolenItems.end(); ++it)
432  {
433  std::map<std::pair<std::string, bool>, int> owners;
434  for (std::set<Owner>::const_iterator ownerIt = it->second.begin(); ownerIt != it->second.end(); ++ownerIt)
435  {
436  owners.insert(std::make_pair(std::make_pair(ownerIt->first, ownerIt->second)
437  // Since OpenMW doesn't suffer from the owner contamination bug,
438  // it needs a count argument. But for legacy savegames, we don't know
439  // this count, so must assume all items of that ID are stolen,
440  // like vanilla MW did.
441  ,std::numeric_limits<int>::max()));
442  }
443 
444  items.mStolenItems.insert(std::make_pair(it->first, owners));
445  }
446 
448  items.write(esm);
450  }
451 
452 private:
453  typedef std::pair<std::string, bool> Owner; // <owner id, bool isFaction>
454 
455  std::map<std::string, std::set<Owner> > mStolenItems;
456 };
457 
464 class ConvertINFO : public Converter
465 {
466 public:
467  virtual void read(ESM::ESMReader& esm)
468  {
469  INFO info;
470  info.load(esm);
471  }
472 };
473 
474 class ConvertDIAL : public Converter
475 {
476 public:
477  virtual void read(ESM::ESMReader& esm)
478  {
479  std::string id = esm.getHNString("NAME");
480  DIAL dial;
481  dial.load(esm);
482  if (dial.mIndex > 0)
483  mDials[id] = dial;
484  }
485  virtual void write(ESM::ESMWriter &esm)
486  {
487  for (std::map<std::string, DIAL>::const_iterator it = mDials.begin(); it != mDials.end(); ++it)
488  {
490  ESM::QuestState state;
491  state.mFinished = 0;
492  state.mState = it->second.mIndex;
493  state.mTopic = Misc::StringUtils::lowerCase(it->first);
494  state.save(esm);
496  }
497  }
498 private:
499  std::map<std::string, DIAL> mDials;
500 };
501 
502 class ConvertQUES : public Converter
503 {
504 public:
505  virtual void read(ESM::ESMReader& esm)
506  {
507  std::string id = esm.getHNString("NAME");
508  QUES quest;
509  quest.load(esm);
510  }
511 };
512 
513 class ConvertJOUR : public Converter
514 {
515 public:
516  virtual void read(ESM::ESMReader& esm)
517  {
518  JOUR journal;
519  journal.load(esm);
520  }
521 };
522 
523 class ConvertGAME : public Converter
524 {
525 public:
526  ConvertGAME() : mHasGame(false) {}
527 
528  virtual void read(ESM::ESMReader &esm)
529  {
530  mGame.load(esm);
531  mHasGame = true;
532  }
533 
534  int validateWeatherID(int weatherID)
535  {
536  if(weatherID >= -1 && weatherID < 10)
537  {
538  return weatherID;
539  }
540  else
541  {
542  std::stringstream error;
543  error << "Invalid weather ID:" << weatherID << std::endl;
544  throw std::runtime_error(error.str());
545  }
546  }
547 
548  virtual void write(ESM::ESMWriter &esm)
549  {
550  if (!mHasGame)
551  return;
553  ESM::WeatherState weather;
554  weather.mTimePassed = 0.0f;
555  weather.mFastForward = false;
557  weather.mTransitionFactor = 1 - (mGame.mGMDT.mWeatherTransition / 100.0f);
560  weather.mQueuedWeather = -1;
561  // TODO: Determine how ModRegion modifiers are saved in Morrowind.
562  weather.save(esm);
564  }
565 
566 private:
567  bool mHasGame;
569 };
570 
572 class ConvertSCPT : public Converter
573 {
574 public:
575  virtual void read(ESM::ESMReader &esm)
576  {
577  SCPT script;
578  script.load(esm);
579  ESM::GlobalScript out;
580  convertSCPT(script, out);
581  mScripts.push_back(out);
582  }
583  virtual void write(ESM::ESMWriter &esm)
584  {
585  for (std::vector<ESM::GlobalScript>::const_iterator it = mScripts.begin(); it != mScripts.end(); ++it)
586  {
588  it->save(esm);
590  }
591  }
592 private:
593  std::vector<ESM::GlobalScript> mScripts;
594 };
595 
596 }
597 
598 #endif
bool mLevitationEnabled
Definition: converter.hpp:301
Definition: converter.hpp:513
void load(ESMReader &esm, bool &isDeleted)
Definition: loadbook.cpp:11
virtual void write(ESM::ESMWriter &esm)
Definition: converter.cpp:400
std::string mName
Definition: loadclas.hpp:73
std::map< std::string, int > mKillCounter
RefId, kill count.
Definition: importklst.hpp:21
static bool ciEqual(const std::string &x, const std::string &y)
Definition: stringops.hpp:62
int mMonth
Definition: importercontext.hpp:43
virtual void write(ESM::ESMWriter &esm)
Definition: converter.hpp:583
std::string getHNString(const char *name)
Definition: esmreader.cpp:108
Definition: defs.hpp:121
Definition: stolenitems.hpp:13
std::string mSelectedSpell
Definition: converter.hpp:268
Definition: defs.hpp:112
virtual void write(ESM::ESMWriter &esm)
Definition: converter.hpp:261
void writeHNT(const std::string &name, const T &data)
Definition: esmwriter.hpp:78
void load(ESM::ESMReader &esm)
Definition: importinfo.cpp:8
Definition: defs.hpp:128
GAME mGame
Definition: converter.hpp:568
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:409
virtual void write(ESM::ESMWriter &esm)
Definition: converter.hpp:548
std::map< std::string, std::set< Owner > > mStolenItems
Definition: converter.hpp:455
float mTimeOfNextTransition
Definition: importgame.hpp:22
std::string mId
Definition: loadcrea.hpp:88
void load(ESM::ESMReader &esm)
Definition: importklst.cpp:8
std::vector< ESM::GlobalScript > mScripts
Definition: converter.hpp:593
std::string mTopic
Definition: queststate.hpp:15
virtual int getStage()
Definition: converter.hpp:51
std::map< std::string, T > mRecords
Definition: converter.hpp:101
Definition: converter.hpp:315
int mIndex
Definition: importcntc.hpp:17
std::vector< ObjectState > mItems
Definition: inventorystate.hpp:18
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:107
void load(ESM::ESMReader &esm)
Definition: importgame.cpp:8
Definition: converter.hpp:474
Definition: defs.hpp:129
Context * mContext
Definition: converter.hpp:71
std::string mRefID
Definition: importplayer.hpp:26
Definition: esmreader.hpp:21
std::map< std::pair< int, int >, Cell > mExtCells
Definition: converter.hpp:352
void startRecord(const std::string &name, uint32_t flags=0)
Definition: esmwriter.cpp:89
Definition: queststate.hpp:13
Definition: importques.hpp:18
void load(ESMReader &esm, bool &isDeleted)
Definition: loadglob.cpp:11
virtual void write(ESM::ESMWriter &esm)
Definition: converter.hpp:485
int mNextWeather
Definition: importgame.hpp:20
int mLevel
Definition: creaturestats.hpp:63
ConvertGAME()
Definition: converter.hpp:526
CreatureStats mCreatureStats
Definition: npcstate.hpp:17
Definition: converter.hpp:327
void load(ESM::ESMReader &esm)
Definition: importplayer.cpp:19
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:389
int mNextWeather
Definition: weatherstate.hpp:27
void convertACDT(const ACDT &acdt, ESM::CreatureStats &cStats)
Definition: convertacdt.cpp:21
static std::string lowerCase(const std::string &in)
Returns lower case copy of input string.
Definition: stringops.hpp:103
Definition: importercontext.hpp:25
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:306
Definition: converter.hpp:271
std::map< std::pair< int, std::string >, CREC > mCreatureChanges
Definition: importercontext.hpp:47
Storage structure for global script state (only used in saved games)
Definition: globalscript.hpp:13
Definition: converter.hpp:523
std::map< std::string, int > mKillCounter
Definition: converter.hpp:383
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:318
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:199
int mDay
Definition: importercontext.hpp:43
std::vector< CellRef > mRefs
Definition: converter.hpp:347
ESM::NPC mPlayerBase
Definition: importercontext.hpp:31
void writeHNString(const std::string &name, const std::string &data)
Definition: esmwriter.cpp:158
Definition: defs.hpp:118
NpcStats mNpcStats
Definition: npcstate.hpp:16
std::string mId
Definition: loadbook.hpp:29
Definition: defs.hpp:113
Definition: loadcrea.hpp:22
Definition: converter.hpp:196
struct ESSImport::NPCC::NPDT mNPDT
void load(ESMReader &esm, bool &isDeleted)
Definition: loadclas.cpp:41
NpcState mObject
Definition: player.hpp:22
virtual void write(ESM::ESMWriter &esm)
Definition: converter.hpp:428
int mWerewolfKills
Definition: npcstats.hpp:37
void load(ESMReader &esm, bool &isDeleted)
Definition: loadfact.cpp:29
int mIndex
Definition: importdial.hpp:13
Definition: loadglob.hpp:18
Definition: importnpcc.hpp:18
std::string mSelectedSpell
Definition: importacdt.hpp:81
ActorData mActorData
Definition: importplayer.hpp:24
SpellList mSpells
Definition: loadnpc.hpp:117
ConvertPCDT()
Definition: converter.hpp:274
InventoryList mInventory
Definition: loadnpc.hpp:116
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:144
BKDTstruct mData
Definition: loadbook.hpp:27
virtual void write(ESM::ESMWriter &esm)
Definition: converter.hpp:287
void write(ESM::ESMWriter &esm) const
Definition: stolenitems.cpp:9
std::vector< std::string > mKnownTopics
Definition: dialoguestate.hpp:18
bool mHasGame
Definition: converter.hpp:567
Definition: importscpt.hpp:17
Journal.
Definition: importjour.hpp:15
Variant mValue
Definition: loadglob.hpp:25
int mState
Definition: queststate.hpp:16
Definition: converter.hpp:47
void save(ESMWriter &esm) const
Definition: queststate.cpp:13
Definition: converter.hpp:386
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:215
std::string mId
Definition: loadfact.hpp:36
void load(ESM::ESMReader &esm)
Definition: importnpcc.cpp:8
std::map< std::string, ESM::NPC > mNpcs
Definition: importercontext.hpp:52
Kill Stats.
Definition: importklst.hpp:16
Definition: esmwriter.hpp:17
virtual void write(ESM::ESMWriter &esm)
Definition: converter.hpp:371
virtual void write(ESM::ESMWriter &esm)
Definition: converter.cpp:87
Definition: converter.hpp:159
std::vector< ContItem > mList
Definition: loadcont.hpp:28
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:183
Definition: creaturestats.hpp:23
std::string mId
Definition: loadclas.hpp:73
void save(ESMWriter &esm) const
Definition: weatherstate.cpp:50
void convertPCDT(const PCDT &pcdt, ESM::Player &out, std::vector< std::string > &outDialogueTopics, bool &firstPersonCam, bool &teleportingEnabled, bool &levitationEnabled, ESM::ControlsState &controls)
Definition: convertplayer.cpp:8
int mWerewolfKills
Definition: importklst.hpp:23
virtual ~Converter()
Definition: converter.hpp:53
void load(ESMReader &esm, bool &isDeleted)
Definition: loadnpc.cpp:11
Definition: converter.hpp:359
int mSkillID
Definition: loadbook.hpp:24
bool mFastForward
Definition: weatherstate.hpp:23
Definition: converter.hpp:304
int mWeatherTransition
Definition: importgame.hpp:21
Definition: loadnpc.hpp:23
void setContext(Context &context)
Definition: converter.hpp:55
std::string mSelectedEnchantItem
Definition: importacdt.hpp:82
ESM::Position mPosition
Definition: objectstate.hpp:27
virtual int getStage()
Definition: converter.hpp:79
void load(ESM::ESMReader &esm)
Definition: importcntc.cpp:8
std::string mId
Definition: loadnpc.hpp:128
SpellState mSpells
Definition: creaturestats.hpp:65
Running global script.
Definition: converter.hpp:572
Creature changes.
Definition: importcrec.hpp:16
std::string toString() const
Definition: esmcommon.hpp:58
virtual void write(ESM::ESMWriter &esm)
Definition: converter.hpp:65
void load(ESM::ESMReader &esm)
Definition: importdial.cpp:8
int mYear
Definition: importercontext.hpp:43
std::vector< unsigned int > mFogOfWar
Definition: converter.hpp:348
void load(ESMReader &esm, bool &isDeleted)
Definition: loadcrea.cpp:13
int mCurrentWeather
Definition: importgame.hpp:20
ESM::ControlsState mControlsState
Definition: importercontext.hpp:36
float mWeatherUpdateTime
Definition: weatherstate.hpp:24
TypesetBook::Ptr book
Definition: journalbooks.cpp:156
Definition: defs.hpp:127
int getInteger() const
Definition: variant.cpp:82
virtual void read(ESM::ESMReader &esm)
Definition: converter.cpp:68
void load(ESM::ESMReader &esm)
Definition: importplayer.cpp:8
virtual void read(ESM::ESMReader &esm)
Definition: converter.cpp:161
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:162
State for inventories and containers.
Definition: inventorystate.hpp:16
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:362
TContainer mSpells
Definition: spellstate.hpp:37
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:81
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:59
Definition: spellstate.hpp:32
static void lowerCaseInPlace(std::string &inout)
Transforms input string to lower case w/o copy.
Definition: stringops.hpp:97
Definition: loadcell.hpp:64
std::map< std::string, int > mReactions
Definition: loadfact.hpp:60
Default converter: simply reads the record and writes it unmodified to the output.
Definition: converter.hpp:76
int mIndex
Definition: importcrec.hpp:18
void load(ESM::ESMReader &esm)
Definition: importcrec.cpp:8
std::vector< std::string > mUsedIds
Definition: npcstats.hpp:41
void convertNpcData(const ActorData &actorData, ESM::NpcStats &npcStats)
Definition: convertacdt.cpp:46
Definition: converter.hpp:180
float mTimePassed
Definition: weatherstate.hpp:22
std::string mId
Definition: loadglob.hpp:24
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:528
Definition: weatherstate.hpp:19
InventoryState mInventory
Definition: npcstate.hpp:15
ESM::Cell mCell
Definition: converter.hpp:346
StolenItemsMap mStolenItems
Definition: stolenitems.hpp:16
std::pair< std::string, bool > Owner
Definition: converter.hpp:453
const NAME & retSubName() const
Definition: esmreader.hpp:41
ESM::Player mPlayer
Definition: importercontext.hpp:30
int mSelectedEnchantItem
Definition: inventorystate.hpp:28
ESM::DialogueState mDialogueState
Definition: importercontext.hpp:34
int mIndex
Definition: importnpcc.hpp:26
Definition: loadclas.hpp:18
std::map< std::pair< int, std::string >, CNTC > mContainerChanges
Definition: importercontext.hpp:49
std::string getHString()
Definition: esmreader.cpp:114
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:280
Definition: converter.hpp:464
void endRecord(const std::string &name)
Definition: esmwriter.cpp:132
void convertSCPT(const SCPT &scpt, ESM::GlobalScript &out)
Definition: convertscpt.cpp:10
Definition: importinfo.hpp:14
virtual void write(ESM::ESMWriter &esm)
Definition: converter.hpp:90
float getFloat() const
Will throw an exception, if value can not be represented as a float value.
Definition: variant.cpp:90
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:477
bool mTeleportingEnabled
Definition: converter.hpp:300
Player-agnostic player data.
Definition: importplayer.hpp:22
Weather data.
Definition: importgame.hpp:13
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:575
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:235
Definition: converter.hpp:141
void load(ESM::ESMReader &esm)
Definition: importscpt.cpp:10
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:467
Definition: converter.hpp:104
ESM::Position mPos
Definition: importplayer.hpp:27
std::vector< std::string > mList
Definition: spelllist.hpp:18
float mTransitionFactor
Definition: weatherstate.hpp:25
std::map< std::string, Cell > mIntCells
Definition: converter.hpp:351
Definition: npcstats.hpp:17
int validateWeatherID(int weatherID)
Definition: converter.hpp:534
std::vector< ESM::CustomMarker > mMarkers
Definition: converter.hpp:354
Stolen items.
Definition: converter.hpp:406
Definition: loadfact.hpp:30
Other player data.
Definition: importplayer.hpp:34
bool isNextSub(const char *name)
Definition: esmreader.cpp:164
std::map< std::string, DIAL > mDials
Definition: converter.hpp:499
int mCurrentWeather
Definition: weatherstate.hpp:26
std::map< std::string, ESM::Creature > mCreatures
Definition: importercontext.hpp:51
osg::ref_ptr< osg::Image > mGlobalMapImage
Definition: converter.hpp:334
std::map< std::string, std::map< std::string, int > > mChangedFactionReaction
Definition: dialoguestate.hpp:21
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:516
void writeCell(const Cell &cell, ESM::ESMWriter &esm)
Definition: converter.cpp:286
int mQueuedWeather
Definition: weatherstate.hpp:28
unsigned char mFinished
Definition: queststate.hpp:17
std::string mCustomPlayerClassName
Definition: importercontext.hpp:32
GMDT mGMDT
Definition: importgame.hpp:26
Definition: converter.hpp:212
Definition: loadbook.hpp:15
Definition: converter.hpp:232
Definition: converter.hpp:337
void convertNPCC(const NPCC &npcc, ESM::NpcState &npcState)
Definition: convertnpcc.cpp:8
NPDTstruct52 mNpdt52
Definition: loadnpc.hpp:107
Definition: defs.hpp:125
void load(ESM::ESMReader &esm)
Definition: importjour.cpp:8
std::map< std::pair< int, std::string >, NPCC > mNpcChanges
Definition: importercontext.hpp:48
void load(ESM::ESMReader &esm)
Definition: importques.cpp:8
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:505
Changed container contents.
Definition: importcntc.hpp:15
Definition: converter.hpp:344
float mHour
Definition: importercontext.hpp:44
short mLevel
Definition: loadnpc.hpp:76
Definition: importdial.hpp:11
ACDT mACDT
Definition: importacdt.hpp:69
Definition: converter.hpp:502
bool mFirstPersonCam
Definition: converter.hpp:299