forked from teamnwah/openmw-tes3coop
ESSImport: convert camera first/third person state
This commit is contained in:
parent
f3c79c0aa0
commit
c4038f7021
4 changed files with 22 additions and 4 deletions
|
@ -261,13 +261,23 @@ private:
|
||||||
class ConvertPCDT : public Converter
|
class ConvertPCDT : public Converter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
ConvertPCDT() : mFirstPersonCam(true) {}
|
||||||
|
|
||||||
virtual void read(ESM::ESMReader &esm)
|
virtual void read(ESM::ESMReader &esm)
|
||||||
{
|
{
|
||||||
PCDT pcdt;
|
PCDT pcdt;
|
||||||
pcdt.load(esm);
|
pcdt.load(esm);
|
||||||
|
|
||||||
convertPCDT(pcdt, mContext->mPlayer, mContext->mDialogueState.mKnownTopics);
|
convertPCDT(pcdt, mContext->mPlayer, mContext->mDialogueState.mKnownTopics, mFirstPersonCam);
|
||||||
}
|
}
|
||||||
|
virtual void write(ESM::ESMWriter &esm)
|
||||||
|
{
|
||||||
|
esm.startRecord(ESM::REC_CAM_);
|
||||||
|
esm.writeHNT("FIRS", mFirstPersonCam);
|
||||||
|
esm.endRecord(ESM::REC_CAM_);
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
bool mFirstPersonCam;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ConvertCNTC : public Converter
|
class ConvertCNTC : public Converter
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
namespace ESSImport
|
namespace ESSImport
|
||||||
{
|
{
|
||||||
|
|
||||||
void convertPCDT(const PCDT& pcdt, ESM::Player& out, std::vector<std::string>& outDialogueTopics)
|
void convertPCDT(const PCDT& pcdt, ESM::Player& out, std::vector<std::string>& outDialogueTopics, bool& firstPersonCam)
|
||||||
{
|
{
|
||||||
out.mBirthsign = pcdt.mBirthsign;
|
out.mBirthsign = pcdt.mBirthsign;
|
||||||
out.mObject.mNpcStats.mBounty = pcdt.mBounty;
|
out.mObject.mNpcStats.mBounty = pcdt.mBounty;
|
||||||
|
@ -24,6 +24,8 @@ namespace ESSImport
|
||||||
if (pcdt.mPNAM.mDrawState & PCDT::DrawState_Spell)
|
if (pcdt.mPNAM.mDrawState & PCDT::DrawState_Spell)
|
||||||
out.mObject.mCreatureStats.mDrawState = 2;
|
out.mObject.mCreatureStats.mDrawState = 2;
|
||||||
|
|
||||||
|
firstPersonCam = (pcdt.mPNAM.mCameraState == PCDT::CameraState_FirstPerson);
|
||||||
|
|
||||||
for (std::vector<std::string>::const_iterator it = pcdt.mKnownDialogueTopics.begin();
|
for (std::vector<std::string>::const_iterator it = pcdt.mKnownDialogueTopics.begin();
|
||||||
it != pcdt.mKnownDialogueTopics.end(); ++it)
|
it != pcdt.mKnownDialogueTopics.end(); ++it)
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
namespace ESSImport
|
namespace ESSImport
|
||||||
{
|
{
|
||||||
|
|
||||||
void convertPCDT(const PCDT& pcdt, ESM::Player& out, std::vector<std::string>& outDialogueTopics);
|
void convertPCDT(const PCDT& pcdt, ESM::Player& out, std::vector<std::string>& outDialogueTopics, bool& firstPersonCam);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,11 @@ struct PCDT
|
||||||
DrawState_Weapon = 0x80,
|
DrawState_Weapon = 0x80,
|
||||||
DrawState_Spell = 0x100
|
DrawState_Spell = 0x100
|
||||||
};
|
};
|
||||||
|
enum CameraState
|
||||||
|
{
|
||||||
|
CameraState_FirstPerson = 0x8,
|
||||||
|
CameraState_ThirdPerson = 0xa
|
||||||
|
};
|
||||||
|
|
||||||
#pragma pack(push)
|
#pragma pack(push)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
|
@ -58,7 +63,8 @@ struct PCDT
|
||||||
|
|
||||||
struct PNAM
|
struct PNAM
|
||||||
{
|
{
|
||||||
int mDrawState; // DrawState
|
short mDrawState; // DrawState
|
||||||
|
short mCameraState; // CameraState
|
||||||
unsigned char mLevelProgress;
|
unsigned char mLevelProgress;
|
||||||
unsigned char mUnknown2[111];
|
unsigned char mUnknown2[111];
|
||||||
unsigned char mSkillIncreases[8]; // number of skill increases for each attribute
|
unsigned char mSkillIncreases[8]; // number of skill increases for each attribute
|
||||||
|
|
Loading…
Reference in a new issue