aboutsummaryrefslogtreecommitdiff
path: root/src/gui/guiFormSpecMenu.cpp
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2018-01-13 10:54:18 +0100
committerLoïc Blot <nerzhul@users.noreply.github.com>2018-01-20 16:38:38 +0100
commit99c9e7a9864a8da5aaf97e615d2bdefa1295497a (patch)
treece9fbbc2acb2a69f8811ce475d469673fc2953e4 /src/gui/guiFormSpecMenu.cpp
parentf5a006dce7896d9241b7d21df77825c1c5decc88 (diff)
downloadminetest-99c9e7a9864a8da5aaf97e615d2bdefa1295497a.tar.gz
minetest-99c9e7a9864a8da5aaf97e615d2bdefa1295497a.tar.bz2
minetest-99c9e7a9864a8da5aaf97e615d2bdefa1295497a.zip
Game refactor [4/X]: keycache is now owned by InputHandler
* Make InputHandler own the key cache * Add a helper function InputHandler::cancelPressed to avoid multiple similar calls in game.cpp * Move RandomInputHandler::step definition into cpp file
Diffstat (limited to 'src/gui/guiFormSpecMenu.cpp')
-rw-r--r--src/gui/guiFormSpecMenu.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp
index 4acc4b94a..89cf19973 100644
--- a/src/gui/guiFormSpecMenu.cpp
+++ b/src/gui/guiFormSpecMenu.cpp
@@ -44,6 +44,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "gettime.h"
#include "gettext.h"
#include "scripting_server.h"
+#include "mainmenumanager.h"
#include "porting.h"
#include "settings.h"
#include "client.h"
@@ -131,13 +132,13 @@ GUIFormSpecMenu::~GUIFormSpecMenu()
delete m_text_dst;
}
-void GUIFormSpecMenu::create(GUIFormSpecMenu **cur_formspec, Client *client,
+void GUIFormSpecMenu::create(GUIFormSpecMenu *&cur_formspec, Client *client,
JoystickController *joystick, IFormSource *fs_src, TextDest *txt_dest)
{
- if (*cur_formspec == 0) {
- *cur_formspec = new GUIFormSpecMenu(joystick, guiroot, -1, &g_menumgr,
+ if (cur_formspec == nullptr) {
+ cur_formspec = new GUIFormSpecMenu(joystick, guiroot, -1, &g_menumgr,
client, client->getTextureSource(), fs_src, txt_dest);
- (*cur_formspec)->doPause = false;
+ cur_formspec->doPause = false;
/*
Caution: do not call (*cur_formspec)->drop() here --
@@ -148,8 +149,8 @@ void GUIFormSpecMenu::create(GUIFormSpecMenu **cur_formspec, Client *client,
*/
} else {
- (*cur_formspec)->setFormSource(fs_src);
- (*cur_formspec)->setTextDest(txt_dest);
+ cur_formspec->setFormSource(fs_src);
+ cur_formspec->setTextDest(txt_dest);
}
}