diff --git a/project/Build.xml b/project/Build.xml index 4984da429..0d207980a 100644 --- a/project/Build.xml +++ b/project/Build.xml @@ -14,7 +14,7 @@ - + diff --git a/project/include/audio/AudioBuffer.h b/project/include/audio/AudioBuffer.h index 9cb27524a..f4b276769 100644 --- a/project/include/audio/AudioBuffer.h +++ b/project/include/audio/AudioBuffer.h @@ -11,7 +11,7 @@ #ifdef ANDROID -#define LOG_SOUND(args,...) ELOG(args, ##__VA_ARGS__) +#define LOG_SOUND(args,...) __android_log_print(ANDROID_LOG_INFO, "Lime", args, ##__VA_ARGS__) #else #ifdef IPHONE //#define LOG_SOUND(args,...) printf(args, ##__VA_ARGS__) diff --git a/project/include/utils/ByteArray.h b/project/include/utils/ByteArray.h index 922a640f4..06bfa7c10 100644 --- a/project/include/utils/ByteArray.h +++ b/project/include/utils/ByteArray.h @@ -51,6 +51,20 @@ namespace lime { }; + #ifdef ANDROID + ByteArray AndroidGetAssetBytes(const char *); + + struct FileInfo + { + int fd; + off_t offset; + off_t length; + }; + + FileInfo AndroidGetAssetFD(const char *); + #endif + + /*#ifdef HX_WINDOWS typedef wchar_t OSChar; #define val_os_string val_wstring diff --git a/project/include/utils/FileIO.h b/project/include/utils/FileIO.h index 8f238bac6..12c8f6f19 100644 --- a/project/include/utils/FileIO.h +++ b/project/include/utils/FileIO.h @@ -13,6 +13,7 @@ namespace lime { extern int fclose (FILE *stream); + extern FILE *fdopen (int fd, const char *mode); extern FILE* fopen (const char *filename, const char *mode); //extern FILE* freopen (const char *filename, const char *mode, FILE *stream); extern size_t fread (void *ptr, size_t size, size_t count, FILE *stream); diff --git a/project/lib/sdl b/project/lib/sdl index c3405178a..2c58bd673 160000 --- a/project/lib/sdl +++ b/project/lib/sdl @@ -1 +1 @@ -Subproject commit c3405178a2f00aa6cfff6a2edd4bffadfc667895 +Subproject commit 2c58bd673bb5e0286b2a25cc6245a4cc55d87fa4 diff --git a/project/src/system/System.cpp b/project/src/system/System.cpp index 0164f0adc..422414be5 100644 --- a/project/src/system/System.cpp +++ b/project/src/system/System.cpp @@ -33,6 +33,7 @@ typedef uint64_t __int64; #ifdef ANDROID #include +#include #endif #ifdef TIZEN diff --git a/project/src/utils/ByteArray.cpp b/project/src/utils/ByteArray.cpp index 5356ae400..334ea2599 100644 --- a/project/src/utils/ByteArray.cpp +++ b/project/src/utils/ByteArray.cpp @@ -89,6 +89,33 @@ namespace lime { } + // Put in asset stubs for now, until we have a final system in place + + #ifdef ANDROID + FileInfo AndroidGetAssetFD(const char *inResource) + { + FileInfo info; + info.fd = 0; + info.offset = 0; + info.length = 0; + + // TODO + + return info; + + } + + + ByteArray AndroidGetAssetBytes(const char *inResource) { + + ByteArray result; + + // TODO + + return result; + + } + #endif diff --git a/project/src/utils/FileIO.cpp b/project/src/utils/FileIO.cpp index b613d03aa..87a56fbd7 100644 --- a/project/src/utils/FileIO.cpp +++ b/project/src/utils/FileIO.cpp @@ -15,6 +15,13 @@ namespace lime { } + FILE *fdopen (int fd, const char *mode) { + + return ::fdopen (fd, mode); + + } + + FILE* fopen (const char *filename, const char *mode) { #ifdef HX_MACOS