Skip to content

Commit

Permalink
Android: Update irrlicht to latest dev version
Browse files Browse the repository at this point in the history
Update android ogles irrlicht branch to latest version
  • Loading branch information
Sapier authored and sapier committed Dec 30, 2015
1 parent a6c4b37 commit f2bca11
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 265 deletions.
9 changes: 2 additions & 7 deletions build/android/Makefile
Expand Up @@ -104,7 +104,7 @@ OGG_TIMESTAMP = $(OGG_DIR)timestamp
OGG_TIMESTAMP_INT = $(ROOT)/deps/ogg_timestamp
OGG_URL_GIT = https://github.com/vincentjames501/libvorbis-libogg-android

IRRLICHT_REVISION = 5122
IRRLICHT_REVISION = 5224
IRRLICHT_DIR = $(ROOT)/deps/irrlicht/
IRRLICHT_LIB = $(IRRLICHT_DIR)lib/Android/libIrrlicht.a
IRRLICHT_TIMESTAMP = $(IRRLICHT_DIR)timestamp
Expand Down Expand Up @@ -510,21 +510,16 @@ $(ICONV_LIB) : $(ICONV_TIMESTAMP)
clean_iconv :
$(RM) -rf ${ICONV_DIR}

#Note: Texturehack patch is required for gpu's not supporting color format
# correctly. Known bad GPU:
# -geforce on emulator
# -Vivante Corporation GC1000 core (e.g. Galaxy Tab 3)

irrlicht_download :
@if [ ! -d "deps/irrlicht" ] ; then \
echo "irrlicht sources missing, downloading..."; \
mkdir -p ${ROOT}/deps; \
cd deps; \
svn co ${IRRLICHT_URL_SVN} irrlicht || exit 1; \
cd irrlicht; \
patch -p1 < ../../irrlicht-friend_class_fix.patch || exit 1; \
patch -p1 < ../../irrlicht-touchcount.patch || exit 1; \
patch -p1 < ../../irrlicht-back_button.patch || exit 1; \
patch -p1 < ../../irrlicht-texturehack.patch || exit 1; \
fi

$(IRRLICHT_TIMESTAMP) : irrlicht_download
Expand Down
26 changes: 26 additions & 0 deletions build/android/irrlicht-friend_class_fix.patch
@@ -0,0 +1,26 @@
--- irrlicht.orig/source/Irrlicht/COGLESDriver.h 2015-12-13 17:46:54.541872125 +0100
+++ irrlicht/source/Irrlicht/COGLESDriver.h 2015-12-13 17:49:40.477866266 +0100
@@ -39,8 +39,8 @@

class COGLES1Driver : public CNullDriver, public IMaterialRendererServices, public COGLES1ExtensionHandler
{
- friend COGLES1CacheHandler;
- friend COGLES1Texture;
+ friend class COGLCoreCacheHandler<COGLES1Driver, COGLES1Texture>;
+ friend class COGLCoreTexture<COGLES1Driver>;

public:
//! constructor
--- irrlicht.orig/source/Irrlicht/COGLES2Driver.h 2015-12-13 17:46:54.537872126 +0100
+++ irrlicht/source/Irrlicht/COGLES2Driver.h 2015-12-13 17:48:38.993868437 +0100
@@ -45,8 +45,8 @@

class COGLES2Driver : public CNullDriver, public IMaterialRendererServices, public COGLES2ExtensionHandler
{
- friend COGLES2CacheHandler;
- friend COGLES2Texture;
+ friend class COGLCoreCacheHandler<COGLES2Driver, COGLES2Texture>;
+ friend class COGLCoreTexture<COGLES2Driver>;

public:
//! constructor
240 changes: 0 additions & 240 deletions build/android/irrlicht-texturehack.patch

This file was deleted.

32 changes: 16 additions & 16 deletions build/android/irrlicht-touchcount.patch
@@ -1,30 +1,30 @@
--- irrlicht.orig/include/IEventReceiver.h 2014-06-03 19:43:50.433713133 +0200
+++ irrlicht/include/IEventReceiver.h 2014-06-03 19:44:36.993711489 +0200
@@ -375,6 +375,9 @@
// Y position of simple touch.
s32 Y;

+ // number of current touches
+ s32 touchedCount;
+
//! Type of touch event.
ETOUCH_INPUT_EVENT Event;
};
--- irrlicht.orig/source/Irrlicht/Android/CIrrDeviceAndroid.cpp 2014-06-03 19:43:50.505713130 +0200
+++ irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.cpp 2014-06-03 19:45:37.265709359 +0200
@@ -315,6 +315,7 @@
--- irrlicht.orig/source/Irrlicht/Android/CIrrDeviceAndroid.cpp 2015-12-13 17:46:54.573872124 +0100
+++ irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.cpp 2015-12-13 17:58:05.981848417 +0100
@@ -372,6 +372,7 @@
event.TouchInput.ID = AMotionEvent_getPointerId(androidEvent, i);
event.TouchInput.X = AMotionEvent_getX(androidEvent, i);
event.TouchInput.Y = AMotionEvent_getY(androidEvent, i);
+ event.TouchInput.touchedCount = AMotionEvent_getPointerCount(androidEvent);

device->postEventFromUser(event);
}
@@ -326,6 +327,7 @@
@@ -383,6 +384,7 @@
event.TouchInput.ID = AMotionEvent_getPointerId(androidEvent, pointerIndex);
event.TouchInput.X = AMotionEvent_getX(androidEvent, pointerIndex);
event.TouchInput.Y = AMotionEvent_getY(androidEvent, pointerIndex);
+ event.TouchInput.touchedCount = AMotionEvent_getPointerCount(androidEvent);

device->postEventFromUser(event);
}
--- irrlicht.orig/include/IEventReceiver.h 2015-12-13 18:09:51.701823498 +0100
+++ irrlicht/include/IEventReceiver.h 2015-12-13 18:09:58.061823273 +0100
@@ -389,6 +389,9 @@
// Y position of simple touch.
s32 Y;

+ //! number of current touches
+ s32 touchedCount;
+
//! Type of touch event.
ETOUCH_INPUT_EVENT Event;
};
3 changes: 1 addition & 2 deletions build/android/jni/Android.mk
Expand Up @@ -68,8 +68,7 @@ ifdef GPROF
GPROF_DEF=-DGPROF
endif

LOCAL_CFLAGS := -D_IRR_ANDROID_PLATFORM_ \
-DHAVE_TOUCHSCREENGUI \
LOCAL_CFLAGS := -DHAVE_TOUCHSCREENGUI \
-DUSE_CURL=1 \
-DUSE_SOUND=1 \
-DUSE_FREETYPE=1 \
Expand Down
4 changes: 4 additions & 0 deletions src/client/tile.cpp
Expand Up @@ -936,7 +936,11 @@ video::ITexture* TextureSource::generateTextureFromMesh(
smgr->drop();

// Unset render target
#if ((IRRLICHT_VERSION_MAJOR == 1) && (IRRLICHT_VERSION_MINOR < 9))
driver->setRenderTarget(0, false, true, 0);
#else
driver->setRenderTarget(0, video::ECBF_COLOR, 0);
#endif

if (params.delete_texture_on_shutdown)
m_texture_trash.push_back(rtt);
Expand Down

0 comments on commit f2bca11

Please sign in to comment.