1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-10-16 09:46:34 +00:00

Use more fixed size integers

This commit is contained in:
Evil Eye 2023-10-24 17:23:54 +02:00
parent 26ff56f150
commit 77c978c226
6 changed files with 12 additions and 13 deletions

View file

@ -16,10 +16,10 @@ namespace ESM
struct AIData struct AIData
{ {
unsigned short mHello; // This is the base value for greeting distance [0, 65535] uint16_t mHello; // This is the base value for greeting distance [0, 65535]
unsigned char mFight, mFlee, mAlarm; // These are probabilities [0, 100] unsigned char mFight, mFlee, mAlarm; // These are probabilities [0, 100]
char mU1, mU2, mU3; // Unknown values char mU1, mU2, mU3; // Unknown values
int mServices; // See the Services enum int32_t mServices; // See the Services enum
void blank(); void blank();
///< Set record to default state (does not touch the ID). ///< Set record to default state (does not touch the ID).
@ -27,8 +27,8 @@ namespace ESM
struct AIWander struct AIWander
{ {
short mDistance; int16_t mDistance;
short mDuration; int16_t mDuration;
unsigned char mTimeOfDay; unsigned char mTimeOfDay;
unsigned char mIdle[8]; unsigned char mIdle[8];
unsigned char mShouldRepeat; unsigned char mShouldRepeat;
@ -44,7 +44,7 @@ namespace ESM
struct AITarget struct AITarget
{ {
float mX, mY, mZ; float mX, mY, mZ;
short mDuration; int16_t mDuration;
NAME32 mId; NAME32 mId;
unsigned char mShouldRepeat; unsigned char mShouldRepeat;
unsigned char mPadding; unsigned char mPadding;

View file

@ -9,7 +9,7 @@ namespace ESM
struct CreatureLevListState final : public ObjectState struct CreatureLevListState final : public ObjectState
{ {
int mSpawnActorId; int32_t mSpawnActorId;
bool mSpawn; bool mSpawn;
void load(ESMReader& esm) override; void load(ESMReader& esm) override;

View file

@ -47,9 +47,8 @@ namespace ESM
std::vector<int> mSummonGraveyard; std::vector<int> mSummonGraveyard;
TimeStamp mTradeTime; TimeStamp mTradeTime;
int mGoldPool; int32_t mGoldPool;
int mActorId; int32_t mActorId;
// int mHitAttemptActorId;
enum Flags enum Flags
{ {

View file

@ -24,14 +24,14 @@ namespace ESM
Flag_Global = 4 // make available from main menu (i.e. not location specific) Flag_Global = 4 // make available from main menu (i.e. not location specific)
}; };
unsigned int mRecordFlags; uint32_t mRecordFlags;
RefId mId; RefId mId;
std::string mDescription; std::string mDescription;
std::string mScriptText; std::string mScriptText;
unsigned int mFlags; uint32_t mFlags;
void load(ESMReader& esm, bool& isDeleted); void load(ESMReader& esm, bool& isDeleted);
void save(ESMWriter& esm, bool isDeleted = false) const; void save(ESMWriter& esm, bool isDeleted = false) const;

View file

@ -9,7 +9,7 @@ namespace ESM
struct DoorState final : public ObjectState struct DoorState final : public ObjectState
{ {
int mDoorState = 0; int32_t mDoorState = 0;
void load(ESMReader& esm) override; void load(ESMReader& esm) override;
void save(ESMWriter& esm, bool inInventory = false) const override; void save(ESMWriter& esm, bool inInventory = false) const override;

View file

@ -17,7 +17,7 @@ namespace ESM
static constexpr std::string_view getRecordType() { return "Filter"; } static constexpr std::string_view getRecordType() { return "Filter"; }
unsigned int mRecordFlags; uint32_t mRecordFlags;
RefId mId; RefId mId;
std::string mDescription; std::string mDescription;