summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorstujones11 <stujones111@gmail.com>2017-12-06 20:36:29 +0000
committerLoic Blot <loic.blot@unix-experience.fr>2018-03-11 16:56:27 +0100
commit22a891a925d68a096420d3383a2e31b58e3eb244 (patch)
tree21de815d25b2f9727aa019f063566426d265fa74 /src
parent69247ca2233d1b2e77485b8d32aca41c7e525e74 (diff)
downloadminetest-22a891a925d68a096420d3383a2e31b58e3eb244.tar.gz
minetest-22a891a925d68a096420d3383a2e31b58e3eb244.tar.bz2
minetest-22a891a925d68a096420d3383a2e31b58e3eb244.zip
Android build fixes for c++11
Diffstat (limited to 'src')
-rw-r--r--src/client/clientlauncher.cpp2
-rw-r--r--src/client/renderingengine.cpp15
-rw-r--r--src/client/tile.cpp2
-rw-r--r--src/client/tile.h6
-rw-r--r--src/game.cpp3
-rw-r--r--src/gui/guiEditBoxWithScrollbar.cpp7
-rw-r--r--src/gui/guiEditBoxWithScrollbar.h7
-rw-r--r--src/gui/touchscreengui.h1
-rw-r--r--src/porting_android.h5
9 files changed, 44 insertions, 4 deletions
diff --git a/src/client/clientlauncher.cpp b/src/client/clientlauncher.cpp
index 741a90d9f..b02f1b438 100644
--- a/src/client/clientlauncher.cpp
+++ b/src/client/clientlauncher.cpp
@@ -215,7 +215,7 @@ bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args)
video::ETCF_CREATE_MIP_MAPS, g_settings->getBool("mip_map"));
#ifdef HAVE_TOUCHSCREENGUI
- receiver->m_touchscreengui = new TouchScreenGUI(device, receiver);
+ receiver->m_touchscreengui = new TouchScreenGUI(RenderingEngine::get_raw_device(), receiver);
g_touchscreengui = receiver->m_touchscreengui;
#endif
diff --git a/src/client/renderingengine.cpp b/src/client/renderingengine.cpp
index 94c9c5ef2..72c1ccfbd 100644
--- a/src/client/renderingengine.cpp
+++ b/src/client/renderingengine.cpp
@@ -45,6 +45,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <X11/Xutil.h>
#endif
+#ifdef __ANDROID__
+#include "filesys.h"
+#endif
+
RenderingEngine *RenderingEngine::s_singleton = nullptr;
RenderingEngine::RenderingEngine(IEventReceiver *receiver)
@@ -567,4 +571,15 @@ v2u32 RenderingEngine::getDisplaySize()
return deskres;
}
+
+#else // __ANDROID__
+float RenderingEngine::getDisplayDensity()
+{
+ return porting::getDisplayDensity();
+}
+
+v2u32 RenderingEngine::getDisplaySize()
+{
+ return porting::getDisplaySize();
+}
#endif // __ANDROID__
diff --git a/src/client/tile.cpp b/src/client/tile.cpp
index a88163a50..ddc0de907 100644
--- a/src/client/tile.cpp
+++ b/src/client/tile.cpp
@@ -794,7 +794,7 @@ video::ITexture* TextureSource::generateTextureFromMesh(
g_settings->getBool("inventory_image_hack")
) {
// Get a scene manager
- scene::ISceneManager *smgr_main = m_device->getSceneManager();
+ scene::ISceneManager *smgr_main = RenderingEngine::get_raw_device()->getSceneManager();
sanity_check(smgr_main);
scene::ISceneManager *smgr = smgr_main->createNewSceneManager();
sanity_check(smgr);
diff --git a/src/client/tile.h b/src/client/tile.h
index c21594206..b1f6d6ac9 100644
--- a/src/client/tile.h
+++ b/src/client/tile.h
@@ -28,6 +28,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <memory>
#include "util/numeric.h"
+#if __ANDROID__
+#include <IVideoDriver.h>
+#endif
+
class IGameDef;
struct TileSpec;
struct TileDef;
@@ -153,7 +157,7 @@ public:
IWritableTextureSource *createTextureSource();
#ifdef __ANDROID__
-video::IImage * Align2Npot2(video::IImage * image, video::IVideoDriver* driver);
+video::IImage * Align2Npot2(video::IImage * image, irr::video::IVideoDriver* driver);
#endif
enum MaterialType{
diff --git a/src/game.cpp b/src/game.cpp
index 2145d565d..f1c27d3bb 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -2092,10 +2092,11 @@ void Game::toggleFreeMoveAlt()
void Game::toggleFast()
{
bool fast_move = !g_settings->getBool("fast_move");
+ bool has_fast_privs = client->checkPrivilege("fast");
g_settings->set("fast_move", bool_to_cstr(fast_move));
if (fast_move) {
- if (client->checkPrivilege("fast")) {
+ if (has_fast_privs) {
m_game_ui->showTranslatedStatusText("Fast mode enabled");
} else {
m_game_ui->showTranslatedStatusText("Fast mode enabled (note: no 'fast' privilege)");
diff --git a/src/gui/guiEditBoxWithScrollbar.cpp b/src/gui/guiEditBoxWithScrollbar.cpp
index d4d2a0c1c..cf278a58e 100644
--- a/src/gui/guiEditBoxWithScrollbar.cpp
+++ b/src/gui/guiEditBoxWithScrollbar.cpp
@@ -1522,3 +1522,10 @@ void GUIEditBoxWithScrollBar::deserializeAttributes(io::IAttributes* in, io::SAt
// setOverrideFont(in->getAttributeAsFont("OverrideFont"));
setWritable(in->getAttributeAsBool("Writable"));
}
+
+bool GUIEditBoxWithScrollBar::isDrawBackgroundEnabled() const { return false; }
+bool GUIEditBoxWithScrollBar::isDrawBorderEnabled() const { return false; }
+void GUIEditBoxWithScrollBar::setCursorChar(const wchar_t cursorChar) { }
+wchar_t GUIEditBoxWithScrollBar::getCursorChar() const { return '|'; }
+void GUIEditBoxWithScrollBar::setCursorBlinkTime(irr::u32 timeMs) { }
+irr::u32 GUIEditBoxWithScrollBar::getCursorBlinkTime() const { return 500; }
diff --git a/src/gui/guiEditBoxWithScrollbar.h b/src/gui/guiEditBoxWithScrollbar.h
index cca2f6536..cedffd82f 100644
--- a/src/gui/guiEditBoxWithScrollbar.h
+++ b/src/gui/guiEditBoxWithScrollbar.h
@@ -128,6 +128,13 @@ public:
//! Reads attributes of the element
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
+ virtual bool isDrawBackgroundEnabled() const;
+ virtual bool isDrawBorderEnabled() const;
+ virtual void setCursorChar(const wchar_t cursorChar);
+ virtual wchar_t getCursorChar() const;
+ virtual void setCursorBlinkTime(irr::u32 timeMs);
+ virtual irr::u32 getCursorBlinkTime() const;
+
protected:
//! Breaks the single text line.
void breakText();
diff --git a/src/gui/touchscreengui.h b/src/gui/touchscreengui.h
index da97381cd..9d4150ea6 100644
--- a/src/gui/touchscreengui.h
+++ b/src/gui/touchscreengui.h
@@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <IEventReceiver.h>
#include <IGUIButton.h>
#include <IGUIEnvironment.h>
+#include <IrrlichtDevice.h>
#include <map>
#include <vector>
diff --git a/src/porting_android.h b/src/porting_android.h
index 7bdb226aa..0b3f2575e 100644
--- a/src/porting_android.h
+++ b/src/porting_android.h
@@ -76,4 +76,9 @@ int getInputDialogState();
*/
std::string getInputDialogValue();
+#ifndef SERVER
+float getDisplayDensity();
+v2u32 getDisplaySize();
+#endif
+
}