forked from mirror/openmw-tes3mp
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
|
||||
{
|
||||
public:
|
||||
ConvertPCDT() : mFirstPersonCam(true) {}
|
||||
|
||||
virtual void read(ESM::ESMReader &esm)
|
||||
{
|
||||
PCDT pcdt;
|
||||
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
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
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.mObject.mNpcStats.mBounty = pcdt.mBounty;
|
||||
|
@ -24,6 +24,8 @@ namespace ESSImport
|
|||
if (pcdt.mPNAM.mDrawState & PCDT::DrawState_Spell)
|
||||
out.mObject.mCreatureStats.mDrawState = 2;
|
||||
|
||||
firstPersonCam = (pcdt.mPNAM.mCameraState == PCDT::CameraState_FirstPerson);
|
||||
|
||||
for (std::vector<std::string>::const_iterator it = pcdt.mKnownDialogueTopics.begin();
|
||||
it != pcdt.mKnownDialogueTopics.end(); ++it)
|
||||
{
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
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_Spell = 0x100
|
||||
};
|
||||
enum CameraState
|
||||
{
|
||||
CameraState_FirstPerson = 0x8,
|
||||
CameraState_ThirdPerson = 0xa
|
||||
};
|
||||
|
||||
#pragma pack(push)
|
||||
#pragma pack(1)
|
||||
|
@ -58,7 +63,8 @@ struct PCDT
|
|||
|
||||
struct PNAM
|
||||
{
|
||||
int mDrawState; // DrawState
|
||||
short mDrawState; // DrawState
|
||||
short mCameraState; // CameraState
|
||||
unsigned char mLevelProgress;
|
||||
unsigned char mUnknown2[111];
|
||||
unsigned char mSkillIncreases[8]; // number of skill increases for each attribute
|
||||
|
|
Loading…
Reference in a new issue