mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 20:29:57 +00:00
Fix coverity uninitialized variables
This commit is contained in:
parent
4fbbb67e98
commit
eceed558be
7 changed files with 24 additions and 9 deletions
|
@ -3,10 +3,13 @@
|
||||||
|
|
||||||
namespace LuaUi
|
namespace LuaUi
|
||||||
{
|
{
|
||||||
|
LuaText::LuaText()
|
||||||
|
: mAutoSized(true)
|
||||||
|
{}
|
||||||
|
|
||||||
void LuaText::initialize()
|
void LuaText::initialize()
|
||||||
{
|
{
|
||||||
WidgetExtension::initialize();
|
WidgetExtension::initialize();
|
||||||
mAutoSized = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LuaText::setPropertyRaw(std::string_view name, sol::object value)
|
bool LuaText::setPropertyRaw(std::string_view name, sol::object value)
|
||||||
|
|
|
@ -12,6 +12,7 @@ namespace LuaUi
|
||||||
MYGUI_RTTI_DERIVED(LuaText)
|
MYGUI_RTTI_DERIVED(LuaText)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
LuaText();
|
||||||
virtual void initialize() override;
|
virtual void initialize() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -8,6 +8,13 @@
|
||||||
|
|
||||||
namespace LuaUi
|
namespace LuaUi
|
||||||
{
|
{
|
||||||
|
WidgetExtension::WidgetExtension()
|
||||||
|
: mForcedCoord()
|
||||||
|
, mAbsoluteCoord()
|
||||||
|
, mRelativeCoord()
|
||||||
|
, mAnchor()
|
||||||
|
{}
|
||||||
|
|
||||||
void WidgetExtension::triggerEvent(std::string_view name, const sol::object& argument = sol::nil) const
|
void WidgetExtension::triggerEvent(std::string_view name, const sol::object& argument = sol::nil) const
|
||||||
{
|
{
|
||||||
auto it = mCallbacks.find(name);
|
auto it = mCallbacks.find(name);
|
||||||
|
@ -27,11 +34,6 @@ namespace LuaUi
|
||||||
|
|
||||||
void WidgetExtension::initialize()
|
void WidgetExtension::initialize()
|
||||||
{
|
{
|
||||||
mAbsoluteCoord = MyGUI::IntCoord();
|
|
||||||
mRelativeCoord = MyGUI::FloatCoord();
|
|
||||||
mAnchor = MyGUI::FloatSize();
|
|
||||||
mForcedCoord = MyGUI::IntCoord();
|
|
||||||
|
|
||||||
// \todo might be more efficient to only register these if there are Lua callbacks
|
// \todo might be more efficient to only register these if there are Lua callbacks
|
||||||
mWidget->eventKeyButtonPressed += MyGUI::newDelegate(this, &WidgetExtension::keyPress);
|
mWidget->eventKeyButtonPressed += MyGUI::newDelegate(this, &WidgetExtension::keyPress);
|
||||||
mWidget->eventKeyButtonReleased += MyGUI::newDelegate(this, &WidgetExtension::keyRelease);
|
mWidget->eventKeyButtonReleased += MyGUI::newDelegate(this, &WidgetExtension::keyRelease);
|
||||||
|
|
|
@ -19,6 +19,7 @@ namespace LuaUi
|
||||||
class WidgetExtension
|
class WidgetExtension
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
WidgetExtension();
|
||||||
// must be called after creating the underlying MyGUI::Widget
|
// must be called after creating the underlying MyGUI::Widget
|
||||||
void create(lua_State* lua, MyGUI::Widget* self);
|
void create(lua_State* lua, MyGUI::Widget* self);
|
||||||
// must be called after before destroying the underlying MyGUI::Widget
|
// must be called after before destroying the underlying MyGUI::Widget
|
||||||
|
@ -42,7 +43,6 @@ namespace LuaUi
|
||||||
void updateCoord();
|
void updateCoord();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
~WidgetExtension() {}
|
|
||||||
sol::table makeTable() const;
|
sol::table makeTable() const;
|
||||||
sol::object keyEvent(MyGUI::KeyCode) const;
|
sol::object keyEvent(MyGUI::KeyCode) const;
|
||||||
sol::object mouseEvent(int left, int top, MyGUI::MouseButton button) const;
|
sol::object mouseEvent(int left, int top, MyGUI::MouseButton button) const;
|
||||||
|
|
|
@ -4,6 +4,12 @@
|
||||||
|
|
||||||
namespace LuaUi
|
namespace LuaUi
|
||||||
{
|
{
|
||||||
|
LuaWindow::LuaWindow()
|
||||||
|
: mCaption()
|
||||||
|
, mPreviousMouse()
|
||||||
|
, mChangeScale()
|
||||||
|
{}
|
||||||
|
|
||||||
void LuaWindow::initialize()
|
void LuaWindow::initialize()
|
||||||
{
|
{
|
||||||
WidgetExtension::initialize();
|
WidgetExtension::initialize();
|
||||||
|
|
|
@ -13,6 +13,9 @@ namespace LuaUi
|
||||||
{
|
{
|
||||||
MYGUI_RTTI_DERIVED(LuaWindow)
|
MYGUI_RTTI_DERIVED(LuaWindow)
|
||||||
|
|
||||||
|
public:
|
||||||
|
LuaWindow();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// \todo replace with LuaText when skins are properly implemented
|
// \todo replace with LuaText when skins are properly implemented
|
||||||
MyGUI::TextBox* mCaption;
|
MyGUI::TextBox* mCaption;
|
||||||
|
|
Loading…
Reference in a new issue