I’m currently trying to compile the branch “branches/ogl-es” of Irrlicht and it seems that the code cannot compile as is. Just follow the guidelines “BUILDING Irrlicht & your App” in the “examples/27.HelloWorld_Android/readme.txt” files, and you should get the following error on step 3:
Code: Select all
[armeabi] Compile++ thumb: Irrlicht <= CIrrDeviceAndroid.cpp
In file included from jni/../../Android/CIrrDeviceAndroid.cpp:12:0:
jni/../../Android/CAndroidAssetReader.h:36:18: error: conflicting return type specified for 'virtual size_t irr::io::CAndroidAssetReader::read(void*, size_t)'
virtual size_t read(void* buffer, size_t sizeToRead);
^
In file included from ../../../include/IFileArchive.h:8:0,
from ../../../include/IFileSystem.h:10,
from jni/../../CFileSystem.h:8,
from jni/../../Android/CIrrDeviceAndroid.cpp:11:
../../../include/IReadFile.h:24:15: error: overriding 'virtual irr::s32 irr::io::IReadFile::read(void*, irr::u32)'
virtual s32 read(void* buffer, u32 sizeToRead) = 0;
^
make: *** [obj/local/armeabi/objs/Irrlicht/Android/CIrrDeviceAndroid.o] Error 1
Actually I admitted this is a problem in Irrlicht but don’t hesitate to tell me if I did something wrong, maybe I missed something.
Anyway, I could easily fix this compile crash, the only problem being that types “size_t” should not appear and been replaced by s32/u32. I have a simple patch for this problem and here it is:
Code: Select all
Index: source/Irrlicht/Android/CAndroidAssetReader.h
===================================================================
--- source/Irrlicht/Android/CAndroidAssetReader.h (revision 5365)
+++ source/Irrlicht/Android/CAndroidAssetReader.h (working copy)
@@ -33,7 +33,7 @@
/** \param buffer Pointer to buffer where read bytes are written to.
\param sizeToRead Amount of bytes to read from the file.
\return How many bytes were read. */
- virtual size_t read(void* buffer, size_t sizeToRead);
+ virtual s32 read(void* buffer, u32 sizeToRead);
//! Changes position in file
/** \param finalPos Destination position in the file.
Index: source/Irrlicht/Android/CAndroidAssetReader.cpp
===================================================================
--- source/Irrlicht/Android/CAndroidAssetReader.cpp (revision 5365)
+++ source/Irrlicht/Android/CAndroidAssetReader.cpp (working copy)
@@ -36,14 +36,14 @@
AAsset_close(Asset);
}
-size_t CAndroidAssetReader::read(void* buffer, size_t sizeToRead)
+s32 CAndroidAssetReader::read(void* buffer, u32 sizeToRead)
{
int readBytes = AAsset_read(Asset, buffer, sizeToRead);
if ( readBytes >= 0 )
return size_t(readBytes);
Regards,
Guillaume
PS: I’d also like to add a way to compile the branch for all android architectures but maybe some of the core developers think this is a bad idea.