CRLF fix
This commit is contained in:
parent
d5854e5cf7
commit
798495681c
@ -1,5 +1,7 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
OS := $(shell uname)
|
||||||
|
|
||||||
# compile with GPROF
|
# compile with GPROF
|
||||||
# GPROF = 1
|
# GPROF = 1
|
||||||
|
|
||||||
@ -139,17 +141,6 @@ LUAJIT_URL_GIT = https://github.com/LuaJIT/LuaJIT.git
|
|||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
OS := $(shell uname)
|
|
||||||
|
|
||||||
ANDR_ROOT = $(shell pwd)
|
|
||||||
|
|
||||||
VERSION_MAJOR := $(shell cat $(ANDR_ROOT)/../../CMakeLists.txt | \
|
|
||||||
grep ^set\(VERSION_MAJOR\ | sed 's/)/ /' | cut -f2 -d' ')
|
|
||||||
VERSION_MINOR := $(shell cat $(ANDR_ROOT)/../../CMakeLists.txt | \
|
|
||||||
grep ^set\(VERSION_MINOR\ | sed 's/)/ /' | cut -f2 -d' ')
|
|
||||||
VERSION_PATCH := $(shell cat $(ANDR_ROOT)/../../CMakeLists.txt | \
|
|
||||||
grep ^set\(VERSION_PATCH\ | sed 's/)/ /' | cut -f2 -d' ')
|
|
||||||
|
|
||||||
ANDROID_SDK = $(shell grep '^sdk\.dir' local.properties | sed 's/^.*=[[:space:]]*//')
|
ANDROID_SDK = $(shell grep '^sdk\.dir' local.properties | sed 's/^.*=[[:space:]]*//')
|
||||||
ANDROID_NDK = $(shell grep '^ndk\.dir' local.properties | sed 's/^.*=[[:space:]]*//')
|
ANDROID_NDK = $(shell grep '^ndk\.dir' local.properties | sed 's/^.*=[[:space:]]*//')
|
||||||
NDK_MODULE_PATH = $(ANDROID_NDK)/toolchains
|
NDK_MODULE_PATH = $(ANDROID_NDK)/toolchains
|
||||||
@ -166,8 +157,7 @@ NDK_MODULE_PATH = $(ANDROID_NDK)/toolchains
|
|||||||
$(ASSETS_TIMESTAMP) $(LUAJIT_TIMESTAMP) \
|
$(ASSETS_TIMESTAMP) $(LUAJIT_TIMESTAMP) \
|
||||||
$(OPENAL_TIMESTAMP) $(VORBIS_TIMESTAMP) \
|
$(OPENAL_TIMESTAMP) $(VORBIS_TIMESTAMP) \
|
||||||
$(IRRLICHT_TIMESTAMP) $(CURL_TIMESTAMP) \
|
$(IRRLICHT_TIMESTAMP) $(CURL_TIMESTAMP) \
|
||||||
#$(OPENSSL_TIMESTAMP) $(VORBIS_TIMESTAMP) \
|
#$(OPENSSL_TIMESTAMP) \
|
||||||
$(VORBIS_TIMESTAMP) \
|
|
||||||
$(ANDR_ROOT)/jni/src/android_version.h \
|
$(ANDR_ROOT)/jni/src/android_version.h \
|
||||||
$(ANDR_ROOT)/jni/src/android_version_githash.h
|
$(ANDR_ROOT)/jni/src/android_version_githash.h
|
||||||
|
|
||||||
@ -230,7 +220,7 @@ $(OPENAL_LIB): $(OPENAL_TIMESTAMP)
|
|||||||
REFRESH=1; \
|
REFRESH=1; \
|
||||||
fi; \
|
fi; \
|
||||||
if [ ${OPENAL_TIMESTAMP} -nt ${OPENAL_TIMESTAMP_INT} ] ; then \
|
if [ ${OPENAL_TIMESTAMP} -nt ${OPENAL_TIMESTAMP_INT} ] ; then \
|
||||||
REFRESH=1; \
|
REFRESH=1; \
|
||||||
fi; \
|
fi; \
|
||||||
if [ $$REFRESH -ne 0 ] ; then \
|
if [ $$REFRESH -ne 0 ] ; then \
|
||||||
echo "changed timestamp for openal detected building..."; \
|
echo "changed timestamp for openal detected building..."; \
|
||||||
@ -254,10 +244,10 @@ $(VORBIS_TIMESTAMP) : vorbis_download
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
vorbis_download :
|
vorbis_download :
|
||||||
@if [ ! -d ${VORBIS_DIR} ] ; then \
|
@if [ ! -d ${VORBIS_DIR} ] ; then \
|
||||||
echo "vorbis sources missing, downloading..."; \
|
echo "vorbis sources missing, downloading..."; \
|
||||||
mkdir -p ${ANDR_ROOT}/deps; \
|
mkdir -p ${ANDR_ROOT}/deps; \
|
||||||
cd ${ANDR_ROOT}/deps ; \
|
cd ${ANDR_ROOT}/deps ; \
|
||||||
git clone ${VORBIS_URL_GIT}|| exit 1; \
|
git clone ${VORBIS_URL_GIT}|| exit 1; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -299,7 +289,7 @@ $(OPENSSL_TIMESTAMP) : openssl_download
|
|||||||
openssl_download :
|
openssl_download :
|
||||||
@if [ ! -d ${OPENSSL_DIR} ] ; then \
|
@if [ ! -d ${OPENSSL_DIR} ] ; then \
|
||||||
echo "openssl sources missing, downloading..."; \
|
echo "openssl sources missing, downloading..."; \
|
||||||
mkdir -p ${ANDR_ROOT}/deps; \
|
mkdir -p ${ANDR_ROOT}/deps; \
|
||||||
cd ${ANDR_ROOT}/deps; \
|
cd ${ANDR_ROOT}/deps; \
|
||||||
wget ${OPENSSL_URL} || exit 1; \
|
wget ${OPENSSL_URL} || exit 1; \
|
||||||
tar -xzf openssl-$(OPENSSL_VERSION).tar.gz; \
|
tar -xzf openssl-$(OPENSSL_VERSION).tar.gz; \
|
||||||
@ -343,25 +333,25 @@ clean_openssl :
|
|||||||
|
|
||||||
$(FREETYPE_TIMESTAMP) : freetype_download
|
$(FREETYPE_TIMESTAMP) : freetype_download
|
||||||
@LAST_MODIF=$$(find ${FREETYPE_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
|
@LAST_MODIF=$$(find ${FREETYPE_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
|
||||||
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
|
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
|
||||||
touch ${FREETYPE_TIMESTAMP}; \
|
touch ${FREETYPE_TIMESTAMP}; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
freetype_download :
|
freetype_download :
|
||||||
@if [ ! -d "${FREETYPE_DIR}" ] ; then \
|
@if [ ! -d ${FREETYPE_DIR} ] ; then \
|
||||||
echo "freetype sources missing, downloading..."; \
|
echo "freetype sources missing, downloading..."; \
|
||||||
mkdir -p ${ANDR_ROOT}/deps; \
|
mkdir -p ${ANDR_ROOT}/deps; \
|
||||||
cd deps; \
|
cd deps; \
|
||||||
wget ${FREETYPE_URL_HTTP} || exit 1; \
|
wget ${FREETYPE_URL_HTTP} || exit 1; \
|
||||||
tar -xjf freetype-${FREETYPE_VERSION}.tar.bz2 || exit 1; \
|
tar -xjf freetype-${FREETYPE_VERSION}.tar.bz2 || exit 1; \
|
||||||
rm freetype-${FREETYPE_VERSION}.tar.bz2; \
|
rm freetype-${FREETYPE_VERSION}.tar.bz2; \
|
||||||
mv freetype-${FREETYPE_VERSION} freetype; \
|
mv freetype-${FREETYPE_VERSION} freetype; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
freetype : $(FREETYPE_LIB)
|
freetype : $(FREETYPE_LIB)
|
||||||
|
|
||||||
$(FREETYPE_LIB) : $(FREETYPE_TIMESTAMP)
|
$(FREETYPE_LIB) : $(FREETYPE_TIMESTAMP)
|
||||||
+ @REFRESH=0; \
|
+ @REFRESH=0; \
|
||||||
if [ ! -e ${FREETYPE_TIMESTAMP_INT} ] ; then \
|
if [ ! -e ${FREETYPE_TIMESTAMP_INT} ] ; then \
|
||||||
REFRESH=1; \
|
REFRESH=1; \
|
||||||
fi; \
|
fi; \
|
||||||
@ -372,6 +362,7 @@ $(FREETYPE_LIB) : $(FREETYPE_TIMESTAMP)
|
|||||||
REFRESH=1; \
|
REFRESH=1; \
|
||||||
fi; \
|
fi; \
|
||||||
if [ $$REFRESH -ne 0 ] ; then \
|
if [ $$REFRESH -ne 0 ] ; then \
|
||||||
|
mkdir -p ${FREETYPE_DIR}; \
|
||||||
export PATH=$$PATH:${ANDROID_NDK}; \
|
export PATH=$$PATH:${ANDROID_NDK}; \
|
||||||
echo "changed timestamp for freetype detected building..."; \
|
echo "changed timestamp for freetype detected building..."; \
|
||||||
cd deps/freetype; \
|
cd deps/freetype; \
|
||||||
@ -414,9 +405,9 @@ iconv_download :
|
|||||||
tar -xzf libiconv-${ICONV_VERSION}.tar.gz || exit 1; \
|
tar -xzf libiconv-${ICONV_VERSION}.tar.gz || exit 1; \
|
||||||
rm libiconv-${ICONV_VERSION}.tar.gz; \
|
rm libiconv-${ICONV_VERSION}.tar.gz; \
|
||||||
mv libiconv-${ICONV_VERSION} libiconv; \
|
mv libiconv-${ICONV_VERSION} libiconv; \
|
||||||
cd libiconv; \
|
cd libiconv; \
|
||||||
patch -p1 < ${ANDR_ROOT}/libiconv_android.patch; \
|
patch -p1 < ${ANDR_ROOT}/libiconv_android.patch; \
|
||||||
patch -p1 < ${ANDR_ROOT}/libiconv_stdio.patch; \
|
patch -p1 < ${ANDR_ROOT}/libiconv_stdio.patch; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
iconv : $(ICONV_LIB)
|
iconv : $(ICONV_LIB)
|
||||||
@ -436,10 +427,11 @@ $(ICONV_LIB) : $(ICONV_TIMESTAMP)
|
|||||||
mkdir -p ${ICONV_DIR}; \
|
mkdir -p ${ICONV_DIR}; \
|
||||||
echo "changed timestamp for iconv detected building..."; \
|
echo "changed timestamp for iconv detected building..."; \
|
||||||
cd ${ICONV_DIR}; \
|
cd ${ICONV_DIR}; \
|
||||||
|
\
|
||||||
export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-iconv; \
|
export TOOLCHAIN=/tmp/ndk-${TARGET_HOST}-iconv; \
|
||||||
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
|
${ANDROID_NDK}/build/tools/make-standalone-toolchain.sh \
|
||||||
--toolchain=${TARGET_TOOLCHAIN}-${COMPILER_VERSION} \
|
--toolchain=${TARGET_TOOLCHAIN}-${COMPILER_VERSION} \
|
||||||
--platform=${APP_PLATFORM} --install-dir=$${TOOLCHAIN}; \
|
--platform=${APP_PLATFORM} --install-dir=$${TOOLCHAIN}; \
|
||||||
export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
|
export PATH="$${TOOLCHAIN}/bin:$${PATH}"; \
|
||||||
export CC=${CROSS_PREFIX}gcc; \
|
export CC=${CROSS_PREFIX}gcc; \
|
||||||
export CXX=${CROSS_PREFIX}g++; \
|
export CXX=${CROSS_PREFIX}g++; \
|
||||||
@ -492,7 +484,7 @@ $(IRRLICHT_TIMESTAMP) : irrlicht_download
|
|||||||
irrlicht : $(IRRLICHT_LIB)
|
irrlicht : $(IRRLICHT_LIB)
|
||||||
|
|
||||||
$(IRRLICHT_LIB): $(IRRLICHT_TIMESTAMP) $(FREETYPE_LIB)
|
$(IRRLICHT_LIB): $(IRRLICHT_TIMESTAMP) $(FREETYPE_LIB)
|
||||||
+ @REFRESH=0; \
|
+ @REFRESH=0; \
|
||||||
if [ ! -e ${IRRLICHT_TIMESTAMP_INT} ] ; then \
|
if [ ! -e ${IRRLICHT_TIMESTAMP_INT} ] ; then \
|
||||||
REFRESH=1; \
|
REFRESH=1; \
|
||||||
fi; \
|
fi; \
|
||||||
@ -521,12 +513,11 @@ clean_irrlicht :
|
|||||||
$(CURL_TIMESTAMP) : curl_download
|
$(CURL_TIMESTAMP) : curl_download
|
||||||
@LAST_MODIF=$$(find ${CURL_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
|
@LAST_MODIF=$$(find ${CURL_DIR} -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "); \
|
||||||
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
|
if [ $$(basename $$LAST_MODIF) != "timestamp" ] ; then \
|
||||||
touch ${CURL_TIMESTAMP}; \
|
touch ${CURL_TIMESTAMP}; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
curl_download :
|
curl_download :
|
||||||
@if [ ! -d "deps/curl" ] ; then \
|
@if [ ! -d "deps/curl" ] ; then \
|
||||||
echo "curl sources missing, downloading..."; \
|
echo "curl sources missing, downloading..."; \
|
||||||
mkdir -p ${ANDR_ROOT}/deps; \
|
mkdir -p ${ANDR_ROOT}/deps; \
|
||||||
cd deps; \
|
cd deps; \
|
||||||
@ -540,7 +531,7 @@ curl : $(CURL_LIB)
|
|||||||
|
|
||||||
#$(CURL_LIB): $(CURL_TIMESTAMP) $(OPENSSL_LIB)
|
#$(CURL_LIB): $(CURL_TIMESTAMP) $(OPENSSL_LIB)
|
||||||
$(CURL_LIB): $(CURL_TIMESTAMP)
|
$(CURL_LIB): $(CURL_TIMESTAMP)
|
||||||
+ @REFRESH=0; \
|
@REFRESH=0; \
|
||||||
if [ ! -e ${CURL_TIMESTAMP_INT} ] ; then \
|
if [ ! -e ${CURL_TIMESTAMP_INT} ] ; then \
|
||||||
REFRESH=1; \
|
REFRESH=1; \
|
||||||
fi; \
|
fi; \
|
||||||
@ -588,14 +579,14 @@ $(GMP_TIMESTAMP) : gmp_download
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
gmp_download :
|
gmp_download :
|
||||||
@if [ ! -d "${GMP_DIR}" ] ; then \
|
@if [ ! -d "${GMP_DIR}" ] ; then \
|
||||||
echo "gmp sources missing, downloading..."; \
|
echo "gmp sources missing, downloading..."; \
|
||||||
mkdir -p ${ANDR_ROOT}/deps; \
|
mkdir -p ${ANDR_ROOT}/deps; \
|
||||||
cd deps; \
|
cd deps; \
|
||||||
wget ${GMP_URL_HTTP} || exit 1; \
|
wget ${GMP_URL_HTTP} || exit 1; \
|
||||||
tar -xjf gmp-${GMP_VERSION}.tar.bz2 || exit 1; \
|
tar -xjf gmp-${GMP_VERSION}.tar.bz2 || exit 1; \
|
||||||
rm gmp-${GMP_VERSION}.tar.bz2; \
|
rm gmp-${GMP_VERSION}.tar.bz2; \
|
||||||
mv gmp-${GMP_VERSION} gmp; \
|
mv gmp-${GMP_VERSION} gmp; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
gmp : $(GMP_LIB)
|
gmp : $(GMP_LIB)
|
||||||
@ -758,9 +749,8 @@ assets : $(ASSETS_TIMESTAMP)
|
|||||||
clean_assets :
|
clean_assets :
|
||||||
@$(RM) -r assets
|
@$(RM) -r assets
|
||||||
|
|
||||||
apk: $(PATHCFGFILE) assets $(ICONV_LIB) $(IRRLICHT_LIB) $(CURL_LIB) $(GMP_LIB) \
|
apk: local.properties assets $(ICONV_LIB) $(IRRLICHT_LIB) $(CURL_LIB) $(GMP_LIB) $(LUAJIT_LIB) \ \
|
||||||
$(LUAJIT_LIB) \
|
$(OPENAL_LIB) $(VORBIS_LIB) prep_srcdir $(ANDR_ROOT)/jni/src/android_version.h \
|
||||||
$(OPENAL_LIB) $(VORBIS_LIB) prep_srcdir $(ANDR_ROOT)/jni/src/android_version.h \
|
|
||||||
$(ANDR_ROOT)/jni/src/android_version_githash.h sqlite3_download
|
$(ANDR_ROOT)/jni/src/android_version_githash.h sqlite3_download
|
||||||
@${ANDROID_NDK}/ndk-build NDK_MODULE_PATH=${NDK_MODULE_PATH} \
|
@${ANDROID_NDK}/ndk-build NDK_MODULE_PATH=${NDK_MODULE_PATH} \
|
||||||
GPROF=${GPROF} APP_ABI=${TARGET_ABI} \
|
GPROF=${GPROF} APP_ABI=${TARGET_ABI} \
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
--- irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.cpp 2014-06-03 20:56:21.289559503 +0200
|
--- irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.cpp 2014-06-03 20:56:21.289559503 +0200
|
||||||
+++ irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.cpp.orig 2014-06-03 20:57:39.281556749 +0200
|
+++ irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.cpp.orig 2014-06-03 20:57:39.281556749 +0200
|
||||||
@@ -423,6 +423,7 @@
|
@@ -423,6 +423,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
device->postEventFromUser(event);
|
device->postEventFromUser(event);
|
||||||
+ status = 1;
|
+ status = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -479,7 +480,7 @@
|
@@ -479,7 +480,7 @@
|
||||||
KeyMap[1] = KEY_LBUTTON; // AKEYCODE_SOFT_LEFT
|
KeyMap[1] = KEY_LBUTTON; // AKEYCODE_SOFT_LEFT
|
||||||
KeyMap[2] = KEY_RBUTTON; // AKEYCODE_SOFT_RIGHT
|
KeyMap[2] = KEY_RBUTTON; // AKEYCODE_SOFT_RIGHT
|
||||||
KeyMap[3] = KEY_HOME; // AKEYCODE_HOME
|
KeyMap[3] = KEY_HOME; // AKEYCODE_HOME
|
||||||
- KeyMap[4] = KEY_BACK; // AKEYCODE_BACK
|
- KeyMap[4] = KEY_BACK; // AKEYCODE_BACK
|
||||||
+ KeyMap[4] = KEY_CANCEL; // AKEYCODE_BACK
|
+ KeyMap[4] = KEY_CANCEL; // AKEYCODE_BACK
|
||||||
KeyMap[5] = KEY_UNKNOWN; // AKEYCODE_CALL
|
KeyMap[5] = KEY_UNKNOWN; // AKEYCODE_CALL
|
||||||
KeyMap[6] = KEY_UNKNOWN; // AKEYCODE_ENDCALL
|
KeyMap[6] = KEY_UNKNOWN; // AKEYCODE_ENDCALL
|
||||||
KeyMap[7] = KEY_KEY_0; // AKEYCODE_0
|
KeyMap[7] = KEY_KEY_0; // AKEYCODE_0
|
||||||
|
@ -1,240 +1,240 @@
|
|||||||
--- irrlicht/source/Irrlicht/COGLESTexture.cpp.orig 2014-06-22 17:01:13.266568869 +0200
|
--- irrlicht/source/Irrlicht/COGLESTexture.cpp.orig 2014-06-22 17:01:13.266568869 +0200
|
||||||
+++ irrlicht/source/Irrlicht/COGLESTexture.cpp 2014-06-22 17:03:59.298572810 +0200
|
+++ irrlicht/source/Irrlicht/COGLESTexture.cpp 2014-06-22 17:03:59.298572810 +0200
|
||||||
@@ -366,112 +366,140 @@
|
@@ -366,112 +366,140 @@
|
||||||
void(*convert)(const void*, s32, void*) = 0;
|
void(*convert)(const void*, s32, void*) = 0;
|
||||||
getFormatParameters(ColorFormat, InternalFormat, filtering, PixelFormat, PixelType, convert);
|
getFormatParameters(ColorFormat, InternalFormat, filtering, PixelFormat, PixelType, convert);
|
||||||
|
|
||||||
- // make sure we don't change the internal format of existing images
|
- // make sure we don't change the internal format of existing images
|
||||||
- if (!newTexture)
|
- if (!newTexture)
|
||||||
- InternalFormat = oldInternalFormat;
|
- InternalFormat = oldInternalFormat;
|
||||||
-
|
-
|
||||||
- Driver->setActiveTexture(0, this);
|
- Driver->setActiveTexture(0, this);
|
||||||
-
|
-
|
||||||
- if (Driver->testGLError())
|
- if (Driver->testGLError())
|
||||||
- os::Printer::log("Could not bind Texture", ELL_ERROR);
|
- os::Printer::log("Could not bind Texture", ELL_ERROR);
|
||||||
-
|
-
|
||||||
- // mipmap handling for main texture
|
- // mipmap handling for main texture
|
||||||
- if (!level && newTexture)
|
- if (!level && newTexture)
|
||||||
- {
|
- {
|
||||||
- // auto generate if possible and no mipmap data is given
|
- // auto generate if possible and no mipmap data is given
|
||||||
- if (!IsCompressed && HasMipMaps && !mipmapData && Driver->queryFeature(EVDF_MIP_MAP_AUTO_UPDATE))
|
- if (!IsCompressed && HasMipMaps && !mipmapData && Driver->queryFeature(EVDF_MIP_MAP_AUTO_UPDATE))
|
||||||
- {
|
- {
|
||||||
- if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED))
|
- if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED))
|
||||||
- glHint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST);
|
- glHint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST);
|
||||||
- else if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_QUALITY))
|
- else if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_QUALITY))
|
||||||
- glHint(GL_GENERATE_MIPMAP_HINT, GL_NICEST);
|
- glHint(GL_GENERATE_MIPMAP_HINT, GL_NICEST);
|
||||||
- else
|
- else
|
||||||
- glHint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE);
|
- glHint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE);
|
||||||
+ bool retry = false;
|
+ bool retry = false;
|
||||||
+
|
+
|
||||||
+ do {
|
+ do {
|
||||||
+ if (retry) {
|
+ if (retry) {
|
||||||
+ InternalFormat = GL_RGBA;
|
+ InternalFormat = GL_RGBA;
|
||||||
+ PixelFormat = GL_RGBA;
|
+ PixelFormat = GL_RGBA;
|
||||||
+ convert = CColorConverter::convert_A8R8G8B8toA8B8G8R8;
|
+ convert = CColorConverter::convert_A8R8G8B8toA8B8G8R8;
|
||||||
+ }
|
+ }
|
||||||
+ // make sure we don't change the internal format of existing images
|
+ // make sure we don't change the internal format of existing images
|
||||||
+ if (!newTexture)
|
+ if (!newTexture)
|
||||||
+ InternalFormat = oldInternalFormat;
|
+ InternalFormat = oldInternalFormat;
|
||||||
|
|
||||||
- glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
|
- glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
|
||||||
- AutomaticMipmapUpdate=true;
|
- AutomaticMipmapUpdate=true;
|
||||||
- }
|
- }
|
||||||
+ Driver->setActiveTexture(0, this);
|
+ Driver->setActiveTexture(0, this);
|
||||||
|
|
||||||
- // enable bilinear filter without mipmaps
|
- // enable bilinear filter without mipmaps
|
||||||
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering);
|
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering);
|
||||||
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
||||||
- }
|
- }
|
||||||
+ if (Driver->testGLError())
|
+ if (Driver->testGLError())
|
||||||
+ os::Printer::log("Could not bind Texture", ELL_ERROR);
|
+ os::Printer::log("Could not bind Texture", ELL_ERROR);
|
||||||
|
|
||||||
- // now get image data and upload to GPU
|
- // now get image data and upload to GPU
|
||||||
+ // mipmap handling for main texture
|
+ // mipmap handling for main texture
|
||||||
+ if (!level && newTexture)
|
+ if (!level && newTexture)
|
||||||
+ {
|
+ {
|
||||||
+ // auto generate if possible and no mipmap data is given
|
+ // auto generate if possible and no mipmap data is given
|
||||||
+ if (!IsCompressed && HasMipMaps && !mipmapData && Driver->queryFeature(EVDF_MIP_MAP_AUTO_UPDATE))
|
+ if (!IsCompressed && HasMipMaps && !mipmapData && Driver->queryFeature(EVDF_MIP_MAP_AUTO_UPDATE))
|
||||||
+ {
|
+ {
|
||||||
+ if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED))
|
+ if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_SPEED))
|
||||||
+ glHint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST);
|
+ glHint(GL_GENERATE_MIPMAP_HINT, GL_FASTEST);
|
||||||
+ else if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_QUALITY))
|
+ else if (Driver->getTextureCreationFlag(ETCF_OPTIMIZED_FOR_QUALITY))
|
||||||
+ glHint(GL_GENERATE_MIPMAP_HINT, GL_NICEST);
|
+ glHint(GL_GENERATE_MIPMAP_HINT, GL_NICEST);
|
||||||
+ else
|
+ else
|
||||||
+ glHint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE);
|
+ glHint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE);
|
||||||
+
|
+
|
||||||
+ glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
|
+ glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
|
||||||
+ AutomaticMipmapUpdate=true;
|
+ AutomaticMipmapUpdate=true;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ // enable bilinear filter without mipmaps
|
+ // enable bilinear filter without mipmaps
|
||||||
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering);
|
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering);
|
||||||
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
||||||
+ }
|
+ }
|
||||||
|
|
||||||
- u32 compressedImageSize = IImage::getCompressedImageSize(ColorFormat, image->getDimension().Width, image->getDimension().Height);
|
- u32 compressedImageSize = IImage::getCompressedImageSize(ColorFormat, image->getDimension().Width, image->getDimension().Height);
|
||||||
+ // now get image data and upload to GPU
|
+ // now get image data and upload to GPU
|
||||||
|
|
||||||
- void* source = image->lock();
|
- void* source = image->lock();
|
||||||
+ u32 compressedImageSize = IImage::getCompressedImageSize(ColorFormat, image->getDimension().Width, image->getDimension().Height);
|
+ u32 compressedImageSize = IImage::getCompressedImageSize(ColorFormat, image->getDimension().Width, image->getDimension().Height);
|
||||||
|
|
||||||
- IImage* tmpImage = 0;
|
- IImage* tmpImage = 0;
|
||||||
+ void* source = image->lock();
|
+ void* source = image->lock();
|
||||||
|
|
||||||
- if (convert)
|
- if (convert)
|
||||||
- {
|
- {
|
||||||
- tmpImage = new CImage(image->getColorFormat(), image->getDimension());
|
- tmpImage = new CImage(image->getColorFormat(), image->getDimension());
|
||||||
- void* dest = tmpImage->lock();
|
- void* dest = tmpImage->lock();
|
||||||
- convert(source, image->getDimension().getArea(), dest);
|
- convert(source, image->getDimension().getArea(), dest);
|
||||||
- image->unlock();
|
- image->unlock();
|
||||||
- source = dest;
|
- source = dest;
|
||||||
- }
|
- }
|
||||||
+ IImage* tmpImage = 0;
|
+ IImage* tmpImage = 0;
|
||||||
|
|
||||||
- if (newTexture)
|
- if (newTexture)
|
||||||
- {
|
- {
|
||||||
- if (IsCompressed)
|
- if (IsCompressed)
|
||||||
+ if (convert)
|
+ if (convert)
|
||||||
{
|
{
|
||||||
- glCompressedTexImage2D(GL_TEXTURE_2D, 0, InternalFormat, image->getDimension().Width,
|
- glCompressedTexImage2D(GL_TEXTURE_2D, 0, InternalFormat, image->getDimension().Width,
|
||||||
- image->getDimension().Height, 0, compressedImageSize, source);
|
- image->getDimension().Height, 0, compressedImageSize, source);
|
||||||
+ tmpImage = new CImage(image->getColorFormat(), image->getDimension());
|
+ tmpImage = new CImage(image->getColorFormat(), image->getDimension());
|
||||||
+ void* dest = tmpImage->lock();
|
+ void* dest = tmpImage->lock();
|
||||||
+ convert(source, image->getDimension().getArea(), dest);
|
+ convert(source, image->getDimension().getArea(), dest);
|
||||||
+ image->unlock();
|
+ image->unlock();
|
||||||
+ source = dest;
|
+ source = dest;
|
||||||
}
|
}
|
||||||
- else
|
- else
|
||||||
- glTexImage2D(GL_TEXTURE_2D, level, InternalFormat, image->getDimension().Width,
|
- glTexImage2D(GL_TEXTURE_2D, level, InternalFormat, image->getDimension().Width,
|
||||||
- image->getDimension().Height, 0, PixelFormat, PixelType, source);
|
- image->getDimension().Height, 0, PixelFormat, PixelType, source);
|
||||||
- }
|
- }
|
||||||
- else
|
- else
|
||||||
- {
|
- {
|
||||||
- if (IsCompressed)
|
- if (IsCompressed)
|
||||||
+
|
+
|
||||||
+ if (newTexture)
|
+ if (newTexture)
|
||||||
{
|
{
|
||||||
- glCompressedTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, image->getDimension().Width,
|
- glCompressedTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, image->getDimension().Width,
|
||||||
- image->getDimension().Height, PixelFormat, compressedImageSize, source);
|
- image->getDimension().Height, PixelFormat, compressedImageSize, source);
|
||||||
+ if (IsCompressed)
|
+ if (IsCompressed)
|
||||||
+ {
|
+ {
|
||||||
+ glCompressedTexImage2D(GL_TEXTURE_2D, 0, InternalFormat, image->getDimension().Width,
|
+ glCompressedTexImage2D(GL_TEXTURE_2D, 0, InternalFormat, image->getDimension().Width,
|
||||||
+ image->getDimension().Height, 0, compressedImageSize, source);
|
+ image->getDimension().Height, 0, compressedImageSize, source);
|
||||||
+ }
|
+ }
|
||||||
+ else
|
+ else
|
||||||
+ glTexImage2D(GL_TEXTURE_2D, level, InternalFormat, image->getDimension().Width,
|
+ glTexImage2D(GL_TEXTURE_2D, level, InternalFormat, image->getDimension().Width,
|
||||||
+ image->getDimension().Height, 0, PixelFormat, PixelType, source);
|
+ image->getDimension().Height, 0, PixelFormat, PixelType, source);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
- glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, image->getDimension().Width,
|
- glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, image->getDimension().Width,
|
||||||
- image->getDimension().Height, PixelFormat, PixelType, source);
|
- image->getDimension().Height, PixelFormat, PixelType, source);
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
- if (convert)
|
- if (convert)
|
||||||
- {
|
- {
|
||||||
- tmpImage->unlock();
|
- tmpImage->unlock();
|
||||||
- tmpImage->drop();
|
- tmpImage->drop();
|
||||||
- }
|
- }
|
||||||
- else
|
- else
|
||||||
- image->unlock();
|
- image->unlock();
|
||||||
-
|
-
|
||||||
- if (!level && newTexture)
|
- if (!level && newTexture)
|
||||||
- {
|
- {
|
||||||
- if (IsCompressed && !mipmapData)
|
- if (IsCompressed && !mipmapData)
|
||||||
{
|
{
|
||||||
- if (image->hasMipMaps())
|
- if (image->hasMipMaps())
|
||||||
- mipmapData = static_cast<u8*>(image->lock())+compressedImageSize;
|
- mipmapData = static_cast<u8*>(image->lock())+compressedImageSize;
|
||||||
+ if (IsCompressed)
|
+ if (IsCompressed)
|
||||||
+ {
|
+ {
|
||||||
+ glCompressedTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, image->getDimension().Width,
|
+ glCompressedTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, image->getDimension().Width,
|
||||||
+ image->getDimension().Height, PixelFormat, compressedImageSize, source);
|
+ image->getDimension().Height, PixelFormat, compressedImageSize, source);
|
||||||
+ }
|
+ }
|
||||||
else
|
else
|
||||||
- HasMipMaps = false;
|
- HasMipMaps = false;
|
||||||
+ glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, image->getDimension().Width,
|
+ glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, image->getDimension().Width,
|
||||||
+ image->getDimension().Height, PixelFormat, PixelType, source);
|
+ image->getDimension().Height, PixelFormat, PixelType, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
- regenerateMipMapLevels(mipmapData);
|
- regenerateMipMapLevels(mipmapData);
|
||||||
-
|
-
|
||||||
- if (HasMipMaps) // might have changed in regenerateMipMapLevels
|
- if (HasMipMaps) // might have changed in regenerateMipMapLevels
|
||||||
+ if (convert)
|
+ if (convert)
|
||||||
{
|
{
|
||||||
- // enable bilinear mipmap filter
|
- // enable bilinear mipmap filter
|
||||||
- GLint filteringMipMaps = GL_LINEAR_MIPMAP_NEAREST;
|
- GLint filteringMipMaps = GL_LINEAR_MIPMAP_NEAREST;
|
||||||
-
|
-
|
||||||
- if (filtering != GL_LINEAR)
|
- if (filtering != GL_LINEAR)
|
||||||
- filteringMipMaps = GL_NEAREST_MIPMAP_NEAREST;
|
- filteringMipMaps = GL_NEAREST_MIPMAP_NEAREST;
|
||||||
+ tmpImage->unlock();
|
+ tmpImage->unlock();
|
||||||
+ tmpImage->drop();
|
+ tmpImage->drop();
|
||||||
+ }
|
+ }
|
||||||
+ else
|
+ else
|
||||||
+ image->unlock();
|
+ image->unlock();
|
||||||
+
|
+
|
||||||
+ if (glGetError() != GL_NO_ERROR) {
|
+ if (glGetError() != GL_NO_ERROR) {
|
||||||
+ static bool warned = false;
|
+ static bool warned = false;
|
||||||
+ if ((!retry) && (ColorFormat == ECF_A8R8G8B8)) {
|
+ if ((!retry) && (ColorFormat == ECF_A8R8G8B8)) {
|
||||||
+
|
+
|
||||||
+ if (!warned) {
|
+ if (!warned) {
|
||||||
+ os::Printer::log("Your driver claims to support GL_BGRA but fails on trying to upload a texture, converting to GL_RGBA and trying again", ELL_ERROR);
|
+ os::Printer::log("Your driver claims to support GL_BGRA but fails on trying to upload a texture, converting to GL_RGBA and trying again", ELL_ERROR);
|
||||||
+ warned = true;
|
+ warned = true;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ else if (retry) {
|
+ else if (retry) {
|
||||||
+ os::Printer::log("Neither uploading texture as GL_BGRA nor, converted one using GL_RGBA succeeded", ELL_ERROR);
|
+ os::Printer::log("Neither uploading texture as GL_BGRA nor, converted one using GL_RGBA succeeded", ELL_ERROR);
|
||||||
+ }
|
+ }
|
||||||
+ retry = !retry;
|
+ retry = !retry;
|
||||||
+ continue;
|
+ continue;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ retry = false;
|
+ retry = false;
|
||||||
+ }
|
+ }
|
||||||
|
|
||||||
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filteringMipMaps);
|
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filteringMipMaps);
|
||||||
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
||||||
+ if (!level && newTexture)
|
+ if (!level && newTexture)
|
||||||
+ {
|
+ {
|
||||||
+ if (IsCompressed && !mipmapData)
|
+ if (IsCompressed && !mipmapData)
|
||||||
+ {
|
+ {
|
||||||
+ if (image->hasMipMaps())
|
+ if (image->hasMipMaps())
|
||||||
+ mipmapData = static_cast<u8*>(image->lock())+compressedImageSize;
|
+ mipmapData = static_cast<u8*>(image->lock())+compressedImageSize;
|
||||||
+ else
|
+ else
|
||||||
+ HasMipMaps = false;
|
+ HasMipMaps = false;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ regenerateMipMapLevels(mipmapData);
|
+ regenerateMipMapLevels(mipmapData);
|
||||||
+
|
+
|
||||||
+ if (HasMipMaps) // might have changed in regenerateMipMapLevels
|
+ if (HasMipMaps) // might have changed in regenerateMipMapLevels
|
||||||
+ {
|
+ {
|
||||||
+ // enable bilinear mipmap filter
|
+ // enable bilinear mipmap filter
|
||||||
+ GLint filteringMipMaps = GL_LINEAR_MIPMAP_NEAREST;
|
+ GLint filteringMipMaps = GL_LINEAR_MIPMAP_NEAREST;
|
||||||
+
|
+
|
||||||
+ if (filtering != GL_LINEAR)
|
+ if (filtering != GL_LINEAR)
|
||||||
+ filteringMipMaps = GL_NEAREST_MIPMAP_NEAREST;
|
+ filteringMipMaps = GL_NEAREST_MIPMAP_NEAREST;
|
||||||
+
|
+
|
||||||
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filteringMipMaps);
|
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filteringMipMaps);
|
||||||
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
- }
|
- }
|
||||||
|
|
||||||
- if (Driver->testGLError())
|
- if (Driver->testGLError())
|
||||||
- os::Printer::log("Could not glTexImage2D", ELL_ERROR);
|
- os::Printer::log("Could not glTexImage2D", ELL_ERROR);
|
||||||
+ if (Driver->testGLError())
|
+ if (Driver->testGLError())
|
||||||
+ os::Printer::log("Could not glTexImage2D", ELL_ERROR);
|
+ os::Printer::log("Could not glTexImage2D", ELL_ERROR);
|
||||||
+ }
|
+ }
|
||||||
+ while(retry);
|
+ while(retry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
--- irrlicht/source/Irrlicht/COGLESTexture.cpp.orig 2014-06-25 00:28:50.820501856 +0200
|
--- irrlicht/source/Irrlicht/COGLESTexture.cpp.orig 2014-06-25 00:28:50.820501856 +0200
|
||||||
+++ irrlicht/source/Irrlicht/COGLESTexture.cpp 2014-06-25 00:08:37.712544692 +0200
|
+++ irrlicht/source/Irrlicht/COGLESTexture.cpp 2014-06-25 00:08:37.712544692 +0200
|
||||||
@@ -422,6 +422,9 @@
|
@@ -422,6 +422,9 @@
|
||||||
source = dest;
|
source = dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ //clear old error
|
+ //clear old error
|
||||||
+ glGetError();
|
+ glGetError();
|
||||||
+
|
+
|
||||||
if (newTexture)
|
if (newTexture)
|
||||||
{
|
{
|
||||||
if (IsCompressed)
|
if (IsCompressed)
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
--- irrlicht.orig/include/IEventReceiver.h 2014-06-03 19:43:50.433713133 +0200
|
--- 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
|
+++ irrlicht/include/IEventReceiver.h 2014-06-03 19:44:36.993711489 +0200
|
||||||
@@ -375,6 +375,9 @@
|
@@ -375,6 +375,9 @@
|
||||||
// Y position of simple touch.
|
// Y position of simple touch.
|
||||||
s32 Y;
|
s32 Y;
|
||||||
|
|
||||||
+ // number of current touches
|
+ // number of current touches
|
||||||
+ s32 touchedCount;
|
+ s32 touchedCount;
|
||||||
+
|
+
|
||||||
//! Type of touch event.
|
//! Type of touch event.
|
||||||
ETOUCH_INPUT_EVENT Event;
|
ETOUCH_INPUT_EVENT Event;
|
||||||
};
|
};
|
||||||
--- irrlicht.orig/source/Irrlicht/Android/CIrrDeviceAndroid.cpp 2014-06-03 19:43:50.505713130 +0200
|
--- 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
|
+++ irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.cpp 2014-06-03 19:45:37.265709359 +0200
|
||||||
@@ -315,6 +315,7 @@
|
@@ -315,6 +315,7 @@
|
||||||
event.TouchInput.ID = AMotionEvent_getPointerId(androidEvent, i);
|
event.TouchInput.ID = AMotionEvent_getPointerId(androidEvent, i);
|
||||||
event.TouchInput.X = AMotionEvent_getX(androidEvent, i);
|
event.TouchInput.X = AMotionEvent_getX(androidEvent, i);
|
||||||
event.TouchInput.Y = AMotionEvent_getY(androidEvent, i);
|
event.TouchInput.Y = AMotionEvent_getY(androidEvent, i);
|
||||||
+ event.TouchInput.touchedCount = AMotionEvent_getPointerCount(androidEvent);
|
+ event.TouchInput.touchedCount = AMotionEvent_getPointerCount(androidEvent);
|
||||||
|
|
||||||
device->postEventFromUser(event);
|
device->postEventFromUser(event);
|
||||||
}
|
}
|
||||||
@@ -326,6 +327,7 @@
|
@@ -326,6 +327,7 @@
|
||||||
event.TouchInput.ID = AMotionEvent_getPointerId(androidEvent, pointerIndex);
|
event.TouchInput.ID = AMotionEvent_getPointerId(androidEvent, pointerIndex);
|
||||||
event.TouchInput.X = AMotionEvent_getX(androidEvent, pointerIndex);
|
event.TouchInput.X = AMotionEvent_getX(androidEvent, pointerIndex);
|
||||||
event.TouchInput.Y = AMotionEvent_getY(androidEvent, pointerIndex);
|
event.TouchInput.Y = AMotionEvent_getY(androidEvent, pointerIndex);
|
||||||
+ event.TouchInput.touchedCount = AMotionEvent_getPointerCount(androidEvent);
|
+ event.TouchInput.touchedCount = AMotionEvent_getPointerCount(androidEvent);
|
||||||
|
|
||||||
device->postEventFromUser(event);
|
device->postEventFromUser(event);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user