summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client.cpp2
-rw-r--r--src/gui/windowmanager_unittest.cc14
-rw-r--r--src/input/touch/touchmanager.cpp4
3 files changed, 12 insertions, 8 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 1fec49b29..04a58ad55 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -301,6 +301,8 @@ void Client::gameInit()
logger->setDebugLog(config.getBoolValue("debugLog"));
logger->setReportUnimplimented(config.getBoolValue("unimplimentedLog"));
+ touchManager.init();
+
config.incValue("runcount");
#ifndef ANDROID
diff --git a/src/gui/windowmanager_unittest.cc b/src/gui/windowmanager_unittest.cc
index 3793a76c6..ccd027f98 100644
--- a/src/gui/windowmanager_unittest.cc
+++ b/src/gui/windowmanager_unittest.cc
@@ -47,6 +47,8 @@
#include "gui/windows/setupwindow.h"
#include "gui/windows/serverdialog.h"
+#include "input/touch/touchmanager.h"
+
#include "render/sdlgraphics.h"
#include "resources/sdlimagehelper.h"
@@ -81,14 +83,9 @@ TEST_CASE("Windows tests", "windowmanager")
ActorSprite::load();
gui = new Gui();
gui->postInit(mainGraphics);
+ touchManager.init();
-#ifdef USE_SDL2
- SDLImageHelper::setRenderer(graphicsManager.createRenderer(
- graphicsManager.createWindow(640, 480, 0,
- SDL_WINDOW_SHOWN | SDL_SWSURFACE), SDL_RENDERER_SOFTWARE));
-#else
- graphicsManager.createWindow(640, 480, 0, SDL_ANYFORMAT | SDL_SWSURFACE);
-#endif
+ mainGraphics->setVideoMode(640, 480, 1, 8, false, false, false, false);
SECTION("setupWindow")
{
@@ -175,6 +172,9 @@ TEST_CASE("Windows tests", "windowmanager")
delete2(connectionDialog);
}
+ gui->draw();
+ mainGraphics->updateScreen();
+
delete2(userPalette);
delete2(client);
windowContainer = nullptr;
diff --git a/src/input/touch/touchmanager.cpp b/src/input/touch/touchmanager.cpp
index 29e2b3cf5..be6dd072d 100644
--- a/src/input/touch/touchmanager.cpp
+++ b/src/input/touch/touchmanager.cpp
@@ -53,7 +53,7 @@ TouchManager::TouchManager() :
mKeyboard(nullptr),
mPad(nullptr),
mObjects(),
- mVertexes(new ImageCollection),
+ mVertexes(nullptr),
mRedraw(true),
mShowJoystick(false),
mShowButtons(false),
@@ -86,6 +86,8 @@ void TouchManager::shutdown() restrict2
void TouchManager::init() restrict2
{
+ mVertexes = new ImageCollection;
+
config.addListener("showScreenJoystick", this);
config.addListener("showScreenButtons", this);
config.addListener("showScreenKeyboard", this);