1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-16 18:01:40 +00:00

Android build fixes for c++11

This commit is contained in:
stujones11 2017-12-06 20:36:29 +00:00 committed by Loic Blot
parent 69247ca223
commit 22a891a925
No known key found for this signature in database
GPG key ID: EFAA458E8C153987
15 changed files with 139 additions and 53 deletions

View file

@ -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

View file

@ -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__

View file

@ -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);

View file

@ -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{

View file

@ -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)");

View file

@ -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; }

View file

@ -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();

View file

@ -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>

View file

@ -76,4 +76,9 @@ int getInputDialogState();
*/
std::string getInputDialogValue();
#ifndef SERVER
float getDisplayDensity();
v2u32 getDisplaySize();
#endif
}