diff --git a/Makefile b/Makefile index 6e22cd77d..fb3aeb9ef 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,6 @@ ifeq ($(OS), ios) PLATNAME = Simulator else ARCH = armv7 - PARCHFLAGS = -marm PLATNAME = OS endif @@ -79,22 +78,17 @@ ifeq ($(OS), ios) export CPLUS_INCLUDE_PATH = $(SYSROOTPATH)/usr/include export LIBRARY_PATH = $(FRAMEWORKPATH)/usr/lib - PLATFORMFLAGS = $(PARCHFLAGS) -miphoneos-version-min=$(IOSVERSION) -isysroot $(SYSROOTPATH) - FRAMEWORKFLAGS += -F$(FRAMEWORKPATH) -L$(SYSROOTPATH)/usr/lib -isysroot $(SYSROOTPATH) + PLATFORMFLAGS = $(PARCHFLAGS) -miphoneos-version-min=$(IOSVERSION) -isysroot $(SYSROOTPATH) -arch ${ARCH} -I${C_INCLUDE_PATH} + FRAMEWORKFLAGS += -F$(FRAMEWORKPATH) -L$(SYSROOTPATH)/usr/lib -isysroot $(SYSROOTPATH) -arch ${$ARCH} endif endif export AR = $(TOOLCHAINPATH)ar ifeq ($(LLVM_BUILD), yes) + export CC = $(TOOLCHAINPATH)clang export CPP = $(TOOLCHAINPATH)clang++ -else - -ifneq (,$(findstring arm,$(ARCH))) - -export CC = $(TOOLCHAINPATH)arm-apple-darwin10-llvm-gcc-4.2 -export CPP = $(TOOLCHAINPATH)arm-apple-darwin10-llvm-g++-4.2 else @@ -103,8 +97,6 @@ export CPP = $(TOOLCHAINPATH)g++ endif -endif - OSLIBEXTENSION = so SDLCONFIGPATH = @@ -388,6 +380,11 @@ ifeq ($(OS), ios) LIBS = -static-libgcc -static-libstdc++ -framework OpenGLES -framework OpenAL -framework AudioToolbox -framework CoreAudio -framework Foundation -framework CoreFoundation -framework UIKit -framework QuartzCore -framework CoreGraphics $(SDL_BACKEND_LINK) $(ALLEGRO_BACKEND_LINK) OTHERINC = $(INCFREETYPE2) + +ifeq ($(ARCH),armv7) +OTHERINC += -DU_HAVE_GCC_ATOMICS=0 +endif + PLATFORMSRC = $(wildcard ./src/system/platform/posix/*.cpp) endif diff --git a/src/audio/cmusic.hpp b/src/audio/cmusic.hpp index 364214379..e4b46ef38 100755 --- a/src/audio/cmusic.hpp +++ b/src/audio/cmusic.hpp @@ -9,7 +9,7 @@ namespace EE { namespace Audio { class EE_API cMusic : public cSoundStream { public : /** Construct the music with a buffer size */ - cMusic( std::size_t BufferSize = 44100 ); + cMusic( std::size_t BufferSize = 48000 ); ~cMusic(); diff --git a/src/declares.hpp b/src/declares.hpp index 57de3f59c..856c7a7a8 100644 --- a/src/declares.hpp +++ b/src/declares.hpp @@ -75,10 +75,32 @@ #define EE_ARM #endif -#if EE_PLATFORM == EE_PLATFORM_ANDROID - #define EE_NO_WIDECHAR +/// Activate at least one backend for the compilation +#if !defined( EE_BACKEND_SDL_ACTIVE ) && !defined( EE_BACKEND_ALLEGRO_ACTIVE ) + #define EE_BACKEND_SDL_ACTIVE +#endif - #define main SDL_main +#if EE_PLATFORM == EE_PLATFORM_ANDROID || EE_PLATFORM == EE_PLATFORM_IOS + #if EE_PLATFORM == EE_PLATFORM_ANDROID + #define EE_NO_WIDECHAR + #endif + + #ifdef EE_BACKEND_SDL_ACTIVE + #define main SDL_main + #endif + + #ifdef EE_BACKEND_ALLEGRO_ACTIVE + #if EE_PLATFORM == EE_PLATFORM_IOS + #define ALLEGRO_MAGIC_MAIN + #define main _al_mangled_main + #elif EE_PLATFORM == EE_PLATFORM_ANDROID + #ifdef __cplusplus + extern "C" int main(int argc, char ** argv); + #else + extern int main(int argc, char ** argv); + #endif + #endif + #endif #ifndef EE_MAIN_FUNC #ifdef __cplusplus @@ -169,11 +191,6 @@ #define EE_GLES #endif -/// Activate at least one backend for the compilation -#if !defined( EE_BACKEND_SDL_ACTIVE ) && !defined( EE_BACKEND_ALLEGRO_ACTIVE ) - #define EE_BACKEND_SDL_ACTIVE -#endif - #define eeCOMMA , #define eeARRAY_SIZE(__array) ( sizeof(__array) / sizeof(__array[0]) ) #define eeSAFE_DELETE(p) { if(p) { eeDelete (p); (p)=NULL; } } diff --git a/src/graphics/base.hpp b/src/graphics/base.hpp index e67438765..0bd2e8642 100644 --- a/src/graphics/base.hpp +++ b/src/graphics/base.hpp @@ -183,7 +183,12 @@ #define GL_DYNAMIC_READ 0x88E9 #define GL_DYNAMIC_COPY 0x88EA +#ifdef GL_DEPTH_COMPONENT32_OES #define GL_DEPTH_COMPONENT GL_DEPTH_COMPONENT32_OES +#else +#define GL_DEPTH_COMPONENT GL_DEPTH_COMPONENT16_OES +#endif + #define GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_OES #define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_OES diff --git a/src/graphics/cshader.cpp b/src/graphics/cshader.cpp index 1d460835d..7334c26f1 100644 --- a/src/graphics/cshader.cpp +++ b/src/graphics/cshader.cpp @@ -175,22 +175,18 @@ bool cShader::Compile() { mValid = 0 != Compiled; if ( !mValid ) { - GLsizei logsize, logarraysize; + GLsizei logsize = 0, logarraysize = 0; glGetShaderiv( GetId(), GL_INFO_LOG_LENGTH, &logarraysize ); - mCompileLog.resize( logarraysize - 1 ); + if ( logarraysize > 0 ) { + mCompileLog.resize( logarraysize - 1 ); - glGetShaderInfoLog( GetId(), logarraysize, &logsize, reinterpret_cast( &mCompileLog[0] ) ); + glGetShaderInfoLog( GetId(), logarraysize, &logsize, reinterpret_cast( &mCompileLog[0] ) ); + } cLog::instance()->Write( "Couldn't compile shader. Log follows:" ); cLog::instance()->Write( mCompileLog ); cLog::instance()->Write( mSource ); - - #ifdef EE_DEBUG - std::cout << "Couldn't compile shader. Log follows:" << std::endl; - std::cout << mCompileLog << std::endl; - std::cout << mSource << std::endl; - #endif } else { cLog::instance()->Write( "Shader Loaded Succesfully" ); } diff --git a/src/graphics/cshaderprogram.cpp b/src/graphics/cshaderprogram.cpp index fa1d8d8d7..c3c14939a 100644 --- a/src/graphics/cshaderprogram.cpp +++ b/src/graphics/cshaderprogram.cpp @@ -200,12 +200,14 @@ bool cShaderProgram::Link() { glGetProgramiv( Handler(), GL_LINK_STATUS, &linked ); mValid = 0 != linked; - GLsizei logsize, logarraysize; + GLsizei logsize = 0, logarraysize = 0; glGetProgramiv( Handler(), GL_INFO_LOG_LENGTH, &logarraysize ); - mLinkLog.resize(logarraysize); - glGetProgramInfoLog( Handler(), logarraysize, &logsize, reinterpret_cast( &mLinkLog[0] ) ); + if ( logarraysize > 0 ) { + mLinkLog.resize( logarraysize ); + glGetProgramInfoLog( Handler(), logarraysize, &logsize, reinterpret_cast( &mLinkLog[0] ) ); + } #endif if ( !mValid ) { diff --git a/src/window/cwindow.hpp b/src/window/cwindow.hpp index ac0711ed0..34cfa143b 100644 --- a/src/window/cwindow.hpp +++ b/src/window/cwindow.hpp @@ -14,11 +14,11 @@ class cCursorManager; namespace WindowStyle { enum { - NoBorder = ( 0 << 0 ), - Titlebar = ( 1 << 0 ), - Resize = ( 1 << 1 ), - Fullscreen = ( 1 << 2 ), - UseDesktopResolution = ( 1 << 3 ), + NoBorder = ( 1 << 0 ), + Titlebar = ( 1 << 1 ), + Resize = ( 1 << 2 ), + Fullscreen = ( 1 << 3 ), + UseDesktopResolution = ( 1 << 4 ), Default = Titlebar | Resize }; }