From f91426d748abc674045fc2728aa7713b544ad025 Mon Sep 17 00:00:00 2001 From: Lucas Baudin Date: Thu, 25 Feb 2016 20:38:50 +0100 Subject: [PATCH] =?UTF-8?q?[android]=20Use=20CIrrDeviceAndroid=20before=20?= =?UTF-8?q?the=20console=20device=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/irrlicht/source/Irrlicht/Irrlicht.cpp | 14 ++++++++------ src/graphics/irr_driver.cpp | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/irrlicht/source/Irrlicht/Irrlicht.cpp b/lib/irrlicht/source/Irrlicht/Irrlicht.cpp index 0107425f8..484111e24 100644 --- a/lib/irrlicht/source/Irrlicht/Irrlicht.cpp +++ b/lib/irrlicht/source/Irrlicht/Irrlicht.cpp @@ -104,17 +104,19 @@ namespace irr dev = new CIrrDeviceFB(params); #endif +#ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_ +__android_log_print(ANDROID_LOG_VERBOSE, "native-activity", "%s %d", __FILE__, __LINE__); + if (params.DeviceType == EIDT_ANDROID || (!dev && params.DeviceType == EIDT_BEST)) { +__android_log_print(ANDROID_LOG_VERBOSE, "native-activity", "%s %d", __FILE__, __LINE__); + dev = new CIrrDeviceAndroid(params); + } +#endif + #ifdef _IRR_COMPILE_WITH_CONSOLE_DEVICE_ if (params.DeviceType == EIDT_CONSOLE || (!dev && params.DeviceType == EIDT_BEST)) dev = new CIrrDeviceConsole(params); #endif -#ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_ - if (params.DeviceType == EIDT_ANDROID || (!dev && params.DeviceType == EIDT_BEST)) { - dev = new CIrrDeviceAndroid(params); - } -#endif - if (dev && !dev->getVideoDriver() && params.DriverType != video::EDT_NULL) { dev->closeDevice(); // destroy window diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index 303110a48..80fb1f250 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -440,7 +440,7 @@ void IrrDriver::initDevice() Log::verbose("irr_driver", "Trying to create device with " "%i bits\n", bits); -#ifdef ANDROID_DEVICE +#ifndef ANDROID_DEVICE params.DriverType = video::EDT_OPENGL; #else params.DriverType = video::EDT_OGLES2; @@ -491,7 +491,7 @@ void IrrDriver::initDevice() UserConfigParams::m_width = MIN_SUPPORTED_WIDTH; UserConfigParams::m_height = MIN_SUPPORTED_HEIGHT; -#ifdef ANDROID_DEVICE +#ifndef ANDROID_DEVICE m_device = createDevice(video::EDT_OPENGL, #else m_device = createDevice(video::EDT_OGLES2,