mirror of
https://github.com/minetest/minetest.git
synced 2025-01-11 15:57:29 +01:00
Fix uninitialized variable warning
This commit is contained in:
parent
6b4307791a
commit
f0ae2da89e
@ -83,6 +83,7 @@ GUIFormSpecMenu::GUIFormSpecMenu(irr::IrrlichtDevice* dev,
|
|||||||
m_selected_amount(0),
|
m_selected_amount(0),
|
||||||
m_selected_dragging(false),
|
m_selected_dragging(false),
|
||||||
m_tooltip_element(NULL),
|
m_tooltip_element(NULL),
|
||||||
|
m_hovered_time(0),
|
||||||
m_old_tooltip_id(-1),
|
m_old_tooltip_id(-1),
|
||||||
m_allowclose(true),
|
m_allowclose(true),
|
||||||
m_lock(false),
|
m_lock(false),
|
||||||
@ -2346,18 +2347,20 @@ void GUIFormSpecMenu::drawMenu()
|
|||||||
|
|
||||||
if (hovered != NULL) {
|
if (hovered != NULL) {
|
||||||
s32 id = hovered->getID();
|
s32 id = hovered->getID();
|
||||||
u32 delta;
|
|
||||||
|
u32 delta = 0;
|
||||||
if (id == -1) {
|
if (id == -1) {
|
||||||
m_old_tooltip_id = id;
|
m_old_tooltip_id = id;
|
||||||
m_old_tooltip = "";
|
m_old_tooltip = "";
|
||||||
delta = 0;
|
} else {
|
||||||
} else if (id != m_old_tooltip_id) {
|
if (id == m_old_tooltip_id) {
|
||||||
m_hoovered_time = getTimeMs();
|
delta = porting::getDeltaMs(m_hovered_time, getTimeMs());
|
||||||
m_old_tooltip_id = id;
|
} else {
|
||||||
delta = 0;
|
m_hovered_time = getTimeMs();
|
||||||
} else if (id == m_old_tooltip_id) {
|
m_old_tooltip_id = id;
|
||||||
delta = porting::getDeltaMs(m_hoovered_time, getTimeMs());
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (id != -1 && delta >= m_tooltip_show_delay) {
|
if (id != -1 && delta >= m_tooltip_show_delay) {
|
||||||
for(std::vector<FieldSpec>::iterator iter = m_fields.begin();
|
for(std::vector<FieldSpec>::iterator iter = m_fields.begin();
|
||||||
iter != m_fields.end(); iter++) {
|
iter != m_fields.end(); iter++) {
|
||||||
|
@ -324,7 +324,7 @@ protected:
|
|||||||
gui::IGUIStaticText *m_tooltip_element;
|
gui::IGUIStaticText *m_tooltip_element;
|
||||||
|
|
||||||
u32 m_tooltip_show_delay;
|
u32 m_tooltip_show_delay;
|
||||||
s32 m_hoovered_time;
|
s32 m_hovered_time;
|
||||||
s32 m_old_tooltip_id;
|
s32 m_old_tooltip_id;
|
||||||
std::string m_old_tooltip;
|
std::string m_old_tooltip;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user