From b72932626779e06489f4a8f0e23b334dfb643da4 Mon Sep 17 00:00:00 2001 From: stujones11 Date: Wed, 5 Sep 2018 19:04:31 +0100 Subject: [PATCH] Fix unused variable warnings --- src/dialog.cpp | 23 ++++++++++------------- src/gui.cpp | 42 ++++++++++++++++++++---------------------- 2 files changed, 30 insertions(+), 35 deletions(-) diff --git a/src/dialog.cpp b/src/dialog.cpp index bc19557..86d2305 100644 --- a/src/dialog.cpp +++ b/src/dialog.cpp @@ -72,8 +72,8 @@ ColorCtrl::ColorCtrl(IGUIEnvironment *env, IGUIElement *parent, s32 id, IGUIElement(EGUIET_ELEMENT, env, parent, id, rectangle) { IVideoDriver *driver = env->getVideoDriver(); - IGUIStaticText *text = env->addStaticText(label, rect(0,0,160,20), - false, false, this); + env->addStaticText(label, rect(0,0,160,20), false, false, this); + IGUIEditBox *edit = env->addEditBox(L"", rect(180,0,250,20), true, this, E_DIALOG_ID_COLOR_EDIT); edit->setMax(6); @@ -167,7 +167,7 @@ AboutDialog::AboutDialog(IGUIEnvironment *env, IGUIElement *parent, rect(32,200,268,216), D_ABOUT_LINK_TEXT, D_ABOUT_LINK_URL); link->drop(); - IGUIButton *button = env->addButton(rect(110,235,190,265), this, + env->addButton(rect(110,235,190,265), this, E_DIALOG_ID_ABOUT_OK, L"OK"); } @@ -182,11 +182,8 @@ SettingsDialog::SettingsDialog(IGUIEnvironment *env, IGUIElement *parent, IGUITab *tab_general = tabs->addTab(L"General"); IGUITab *tab_debug = tabs->addTab(L"Debug"); - IGUIStaticText *text; - IGUIEditBox *edit; IGUISpinBox *spin; IGUICheckBox *check; - IGUIButton *button; ColorCtrl *color; color = new ColorCtrl(env, tab_general, E_DIALOG_ID_BG_COLOR, @@ -199,20 +196,20 @@ SettingsDialog::SettingsDialog(IGUIEnvironment *env, IGUIElement *parent, color->setColor(conf->get("grid_color")); color->drop(); - text = env->addStaticText(L"Wield Attachment Bone:", rect(20,80,180,100), + env->addStaticText(L"Wield Attachment Bone:", rect(20,80,180,100), false, false, tab_general, -1); stringw bone_name = conf->getCStr("wield_bone"); - edit = env->addEditBox(bone_name.c_str(), rect(200,80,320,100), + env->addEditBox(bone_name.c_str(), rect(200,80,320,100), true, tab_general, E_DIALOG_ID_WIELD_BONE); - text = env->addStaticText(L"Default Screen Width:", + env->addStaticText(L"Default Screen Width:", rect(20,110,180,130), false, false, tab_general, -1); spin = env->addSpinBox(L"", rect(200,110,270,130), true, tab_general, E_DIALOG_ID_SCREEN_WIDTH); spin->setValue(conf->getInt("screen_width")); spin->setDecimalPlaces(0); - text = env->addStaticText(L"Default Screen Height:", + env->addStaticText(L"Default Screen Height:", rect(20,140,180,160), false, false, tab_general, -1); spin = env->addSpinBox(L"", rect(200,140,270,160), true, tab_general, E_DIALOG_ID_SCREEN_HEIGHT); @@ -238,9 +235,9 @@ SettingsDialog::SettingsDialog(IGUIEnvironment *env, IGUIElement *parent, E_DIALOG_ID_DEBUG_BUFFERS, L"Show all mesh buffers"); check->setChecked(conf->getInt("debug_flags") & EDS_BBOX_BUFFERS); - button = env->addButton(rect(315,255,395,285), this, + env->addButton(rect(315,255,395,285), this, E_DIALOG_ID_SETTINGS_OK, L"OK"); - button = env->addButton(rect(230,255,310,285), this, + env->addButton(rect(230,255,310,285), this, E_DIALOG_ID_SETTINGS_CANCEL, L"Cancel"); } @@ -523,4 +520,4 @@ bool TexturesDialog::OnEvent(const SEvent &event) } } return IGUIElement::OnEvent(event); -} +} \ No newline at end of file diff --git a/src/gui.cpp b/src/gui.cpp index e481c13..3356e50 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -12,8 +12,8 @@ VertexCtrl::VertexCtrl(IGUIEnvironment *env, IGUIElement *parent, s32 id, IGUIElement(EGUIET_ELEMENT, env, parent, id, rectangle), vertex(0) { - IGUIStaticText *text = env->addStaticText(label, - rect(0,0,20,20), false, false, this); + env->addStaticText(label, rect(0,0,20,20), + false, false, this); IGUISpinBox *spin = env->addSpinBox(L"", rect(20,0,120,20), true, this, E_GUI_ID_VERTEX); @@ -56,8 +56,8 @@ VectorCtrl::VectorCtrl(IGUIEnvironment *env, IGUIElement *parent, s32 id, IGUIElement(EGUIET_ELEMENT, env, parent, id, rectangle), vector(vector3df(0,0,0)) { - IGUIStaticText *text = env->addStaticText(label, - rect(10,0,150,20), false, false, this); + env->addStaticText(label, rect(10,0,150,20), + false, false, this); VertexCtrl *x = new VertexCtrl(env, this, E_GUI_ID_VECTOR_X, rect(10,30,150,50), step, L"X"); @@ -215,12 +215,11 @@ ToolBox::ToolBox(IGUIEnvironment *env, IGUIElement *parent, s32 id, VectorCtrl *rotation = new VectorCtrl(env, this, E_GUI_ID_ROTATION, rect(10,130,150,250), 15.0, L"Rotation:"); - IGUIStaticText *text; - text = env->addStaticText(L"Scale:", - rect(20,260,150,280), false, false, this); + env->addStaticText(L"Scale:", rect(20,260,150,280), + false, false, this); - text = env->addStaticText(L"%", - rect(20,290,40,310), false, false, this); + env->addStaticText(L"%", rect(20,290,40,310), + false, false, this); IGUISpinBox *scale = env->addSpinBox(L"", rect(40,290,140,310), true, this, E_GUI_ID_SCALE); @@ -235,8 +234,8 @@ ToolBox::ToolBox(IGUIEnvironment *env, IGUIElement *parent, s32 id, rotation->drop(); scale->setValue(node->getScale().Y * 100); - text = env->addStaticText(L"Transparency:", - rect(20,330,150,350), false, false, this); + env->addStaticText(L"Transparency:", rect(20,330,150,350), + false, false, this); IGUIComboBox *combo = env->addComboBox(rect(20,360,140,380), this, E_GUI_ID_MATERIAL); @@ -416,36 +415,35 @@ void GUI::initToolBar() { IVideoDriver *driver = device->getVideoDriver(); IGUIEnvironment *env = device->getGUIEnvironment(); - IGUIStaticText *text; IGUISpinBox *spin; IGUIToolBar *toolbar = env->addToolBar(0, E_GUI_ID_TOOLBAR); - text = env->addStaticText(L"Animation:", - rect(20,6,120,25), false, false, toolbar); + env->addStaticText(L"Animation:", rect(20,6,120,25), + false, false, toolbar); - text = env->addStaticText(L"Start", - rect(130,6,160,25), false, false, toolbar); + env->addStaticText(L"Start", rect(130,6,160,25), + false, false, toolbar); spin = env->addSpinBox(L"", rect(170,5,230,25), true, toolbar, E_GUI_ID_ANIM_START); spin->setDecimalPlaces(0); spin->setRange(0, 10000); - text = env->addStaticText(L"End", - rect(255,6,280,25), false, false, toolbar); + env->addStaticText(L"End", rect(255,6,280,25), + false, false, toolbar); spin = env->addSpinBox(L"", rect(290,5,350,25), true, toolbar, E_GUI_ID_ANIM_END); spin->setDecimalPlaces(0); spin->setRange(0, 10000); - text = env->addStaticText(L"Speed", - rect(370,6,410,25), false, false, toolbar); + env->addStaticText(L"Speed", rect(370,6,410,25), + false, false, toolbar); spin = env->addSpinBox(L"", rect(420,5,480,25), true, toolbar, E_GUI_ID_ANIM_SPEED); spin->setDecimalPlaces(0); spin->setRange(0, 10000); - text = env->addStaticText(L"Frame", - rect(495,6,535,25), false, false, toolbar); + env->addStaticText(L"Frame", rect(495,6,535,25), + false, false, toolbar); spin = env->addSpinBox(L"", rect(550,5,610,25), true, toolbar, E_GUI_ID_ANIM_FRAME); spin->setDecimalPlaces(0);