1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-20 15:40:32 +00:00

Initialize some missing variables

This commit is contained in:
Andrei Kortunov 2022-07-02 23:25:51 +04:00
parent 523ad825c2
commit aa349f2ed9
11 changed files with 30 additions and 25 deletions

View File

@ -21,6 +21,7 @@ void CSMDoc::Document::addGmsts()
ESM::GameSetting gmst;
gmst.mId = CSMWorld::DefaultGmsts::Floats[i];
gmst.mValue.setType (ESM::VT_Float);
gmst.mRecordFlags = 0;
gmst.mValue.setFloat (CSMWorld::DefaultGmsts::FloatsDefaultValues[i]);
getData().getGmsts().add (gmst);
}
@ -30,6 +31,7 @@ void CSMDoc::Document::addGmsts()
ESM::GameSetting gmst;
gmst.mId = CSMWorld::DefaultGmsts::Ints[i];
gmst.mValue.setType (ESM::VT_Int);
gmst.mRecordFlags = 0;
gmst.mValue.setInteger (CSMWorld::DefaultGmsts::IntsDefaultValues[i]);
getData().getGmsts().add (gmst);
}
@ -39,6 +41,7 @@ void CSMDoc::Document::addGmsts()
ESM::GameSetting gmst;
gmst.mId = CSMWorld::DefaultGmsts::Strings[i];
gmst.mValue.setType (ESM::VT_String);
gmst.mRecordFlags = 0;
gmst.mValue.setString ("");
getData().getGmsts().add (gmst);
}
@ -164,6 +167,7 @@ void CSMDoc::Document::createBase()
{
ESM::Global record;
record.mId = sGlobals[i];
record.mRecordFlags = 0;
record.mValue.setType (i==2 ? ESM::VT_Float : ESM::VT_Long);
if (i==0 || i==1)

View File

@ -1032,6 +1032,7 @@ void CSMWorld::Data::loadFallbackEntries()
ESM::Static newMarker;
newMarker.mId = marker.first;
newMarker.mModel = marker.second;
newMarker.mRecordFlags = 0;
auto record = std::make_unique<CSMWorld::Record<ESM::Static>>();
record->mBase = newMarker;
record->mState = CSMWorld::RecordBase::State_BaseOnly;
@ -1046,6 +1047,7 @@ void CSMWorld::Data::loadFallbackEntries()
ESM::Door newMarker;
newMarker.mId = marker.first;
newMarker.mModel = marker.second;
newMarker.mRecordFlags = 0;
auto record = std::make_unique<CSMWorld::Record<ESM::Door>>();
record->mBase = newMarker;
record->mState = CSMWorld::RecordBase::State_BaseOnly;

View File

@ -27,7 +27,10 @@ namespace CSMWorld
const RefIdColumn *mType;
const RefIdColumn *mBlocked;
BaseColumns () : mBlocked(nullptr) {}
BaseColumns () : mId(nullptr)
, mModified(nullptr)
, mType(nullptr)
, mBlocked(nullptr) {}
};
/// \brief Base adapter for all refereceable record types

View File

@ -459,6 +459,7 @@ OMW::Engine::Engine(Files::ConfigurationManager& configurationManager)
, mScriptBlacklistUse (true)
, mNewGame (false)
, mCfgMgr(configurationManager)
, mGlMaxTextureImageUnits(0)
{
SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0"); // We use only gamepads

View File

@ -494,6 +494,7 @@ namespace MWGui
klass.mDescription = mCreateClassDialog->getDescription();
klass.mData.mSpecialization = mCreateClassDialog->getSpecializationId();
klass.mData.mIsPlayable = 0x1;
klass.mRecordFlags = 0;
std::vector<int> attributes = mCreateClassDialog->getFavoriteAttributes();
assert(attributes.size() == 2);

View File

@ -11,17 +11,8 @@ namespace
const T* base = list.find(name);
ESM::CellRef cellRef;
cellRef.mRefNum.unset();
cellRef.blank();
cellRef.mRefID = name;
cellRef.mScale = 1;
cellRef.mFactionRank = 0;
cellRef.mChargeInt = -1;
cellRef.mChargeIntRemainder = 0.0f;
cellRef.mGoldValue = 1;
cellRef.mEnchantmentCharge = -1;
cellRef.mTeleport = false;
cellRef.mLockLevel = 0;
cellRef.mReferenceBlocked = 0;
MWWorld::LiveCellRef<T> ref(cellRef, base);

View File

@ -490,6 +490,7 @@ namespace MWWorld
ESM::Global record;
record.mId = params.first;
record.mValue = params.second;
record.mRecordFlags = 0;
mStore.insertStatic(record);
}
}
@ -509,6 +510,7 @@ namespace MWWorld
ESM::Static record;
record.mId = params.first;
record.mModel = params.second;
record.mRecordFlags = 0;
mStore.insertStatic(record);
}
}
@ -523,6 +525,7 @@ namespace MWWorld
ESM::Door record;
record.mId = params.first;
record.mModel = params.second;
record.mRecordFlags = 0;
mStore.insertStatic(record);
}
}

View File

@ -19,7 +19,7 @@ class ESMWriter;
struct ContItem
{
int mCount;
int mCount{0};
std::string mItem;
};

View File

@ -66,8 +66,8 @@ namespace fx
void initialiseOverride() override;
void notifyMouseButtonClick(MyGUI::Widget* sender);
MyGUI::Button* mCheckbutton;
MyGUI::Widget* mFill;
MyGUI::Button* mCheckbutton{nullptr};
MyGUI::Widget* mFill{nullptr};
};
template <class T, class UType>
@ -236,11 +236,11 @@ namespace fx
increment(uniform->mStep);
}
MyGUI::Button* mButtonDecrease;
MyGUI::Button* mButtonIncrease;
MyGUI::Widget* mDragger;
MyGUI::Widget* mFill;
MyGUI::TextBox* mValueLabel;
MyGUI::Button* mButtonDecrease{nullptr};
MyGUI::Button* mButtonIncrease{nullptr};
MyGUI::Widget* mDragger{nullptr};
MyGUI::Widget* mFill{nullptr};
MyGUI::TextBox* mValueLabel{nullptr};
T mValue;
int mLastPointerX;
@ -271,9 +271,9 @@ namespace fx
void initialiseOverride() override;
Gui::AutoSizedButton* mReset;
Gui::AutoSizedTextBox* mLabel;
MyGUI::Widget* mClient;
Gui::AutoSizedButton* mReset{nullptr};
Gui::AutoSizedTextBox* mLabel{nullptr};
MyGUI::Widget* mClient{nullptr};
std::vector<EditBase*> mBases;
};
}

View File

@ -23,8 +23,8 @@ namespace LuaUi
void textChange(MyGUI::EditBox*);
MyGUI::EditBox* mEditBox = nullptr;
bool mMultiline;
bool mAutoSize;
bool mMultiline{0};
bool mAutoSize{0};
};
}

View File

@ -160,7 +160,7 @@ namespace LuaUi
sol::object WidgetExtension::keyEvent(MyGUI::KeyCode code) const
{
SDL_Keysym keySym;
auto keySym = SDL_Keysym();
keySym.sym = SDLUtil::myGuiKeyToSdl(code);
keySym.scancode = SDL_GetScancodeFromKey(keySym.sym);
keySym.mod = SDL_GetModState();