diff --git a/project/jni/application/commandergenius/AndroidAppSettings.cfg b/project/jni/application/commandergenius/AndroidAppSettings.cfg index 13f30deea..68518cd8f 100644 --- a/project/jni/application/commandergenius/AndroidAppSettings.cfg +++ b/project/jni/application/commandergenius/AndroidAppSettings.cfg @@ -15,6 +15,7 @@ SdlVideoResize=y SdlVideoResizeKeepAspect=n CompatibilityHacks=n CompatibilityHacksStaticInit=n +CompatibilityHacksTextInputEmulatesHwKeyboard=n AppUsesMouse=n AppNeedsTwoButtonMouse=n ShowMouseCursor=n @@ -33,8 +34,8 @@ StartupMenuButtonTimeout=3000 HiddenMenuOptions='' FirstStartMenuOptions='' MultiABI=n -AppVersionCode=40010 -AppVersionName="0.4.0.10" +AppVersionCode=40011 +AppVersionName="0.4.0.11" ResetSdlConfigForThisVersion=y DeleteFilesOnUpgrade="%" CompiledLibraries="tremor ogg" diff --git a/project/jni/application/supertux/AndroidAppSettings.cfg b/project/jni/application/supertux/AndroidAppSettings.cfg new file mode 100644 index 000000000..e84f2eae2 --- /dev/null +++ b/project/jni/application/supertux/AndroidAppSettings.cfg @@ -0,0 +1,47 @@ +# The application settings for Android libSDL port +AppSettingVersion=17 +LibSdlVersion=1.2 +AppName="SuperTux" +AppFullName=org.lethargik.supertux2 +ScreenOrientation=h +InhibitSuspend=n +AppDataDownloadUrl="!Data files|http://sourceforge.net/projects/libsdl-android/files/SuperTux/data-1.zip" +VideoDepthBpp=24 +NeedDepthBuffer=n +NeedStencilBuffer=n +NeedGles2=n +SwVideoMode=y +SdlVideoResize=y +SdlVideoResizeKeepAspect=n +CompatibilityHacks=n +CompatibilityHacksStaticInit=n +CompatibilityHacksTextInputEmulatesHwKeyboard=n +AppUsesMouse=n +AppNeedsTwoButtonMouse=n +ShowMouseCursor=n +ForceRelativeMouseMode=n +AppNeedsArrowKeys=y +AppNeedsTextInput=y +AppUsesJoystick=n +AppHandlesJoystickSensitivity=n +AppUsesMultitouch=n +NonBlockingSwapBuffers=n +RedefinedKeys="LALT RETURN NO_REMAP NO_REMAP SPACE" +AppTouchscreenKeyboardKeysAmount=2 +AppTouchscreenKeyboardKeysAmountAutoFire=0 +RedefinedKeysScreenKb="SPACE LCTRL" +StartupMenuButtonTimeout=3000 +HiddenMenuOptions='OptionalDownloadConfig' +FirstStartMenuOptions='' +MultiABI=n +AppVersionCode=03301 +AppVersionName="0.3.3.01" +ResetSdlConfigForThisVersion=y +DeleteFilesOnUpgrade="%" +CompiledLibraries=" sdl_image physfs boost_system curl openal jpeg png tremor ogg" +CustomBuildScript=n +AppCflags='-include GLES/gl.h -Ijni/openal/include/AL -DHAVE_SDL=1' +AppLdflags='' +AppSubdirsBuild='. supertux/src/* supertux/external/tinygettext/tinygettext supertux/external/tinygettext supertux/external/findlocale supertux/external/obstack supertux/external/squirrel/include supertux/external/squirrel/squirrel supertux/external/squirrel/sqstdlib' +AppCmdline='' +ReadmeText='^You may press "Home" now - the data will be downloaded in background' diff --git a/project/jni/application/supertux/AndroidData/logo.png b/project/jni/application/supertux/AndroidData/logo.png new file mode 120000 index 000000000..fec0b9a99 --- /dev/null +++ b/project/jni/application/supertux/AndroidData/logo.png @@ -0,0 +1 @@ +../supertux/data/images/engine/menu/logo.png \ No newline at end of file diff --git a/project/jni/application/supertux/android.diff b/project/jni/application/supertux/android.diff new file mode 100644 index 000000000..d06dc5874 --- /dev/null +++ b/project/jni/application/supertux/android.diff @@ -0,0 +1,177 @@ +diff --git a/src/audio/ogg_sound_file.cpp b/src/audio/ogg_sound_file.cpp +index fd7c7fc..ebf978b 100644 +--- a/src/audio/ogg_sound_file.cpp ++++ b/src/audio/ogg_sound_file.cpp +@@ -83,8 +83,8 @@ OggSoundFile::read(void* _buffer, size_t buffer_size) + } + + long bytesRead +- = ov_read(&vorbis_file, buffer, bytes_to_read, bigendian, +- 2, 1, §ion); ++ = ov_read(&vorbis_file, buffer, bytes_to_read, ++ §ion); + if(bytesRead == 0) { + break; + } +diff --git a/src/audio/ogg_sound_file.hpp b/src/audio/ogg_sound_file.hpp +index 0a9b8b1..8344177 100644 +--- a/src/audio/ogg_sound_file.hpp ++++ b/src/audio/ogg_sound_file.hpp +@@ -18,7 +18,7 @@ + #define HEADER_SUPERTUX_AUDIO_OGG_SOUND_FILE_HPP + + #include +-#include ++#include + + #include "audio/sound_file.hpp" + +diff --git a/src/control/joystickkeyboardcontroller.cpp b/src/control/joystickkeyboardcontroller.cpp +index de414fa..92ba634 100644 +--- a/src/control/joystickkeyboardcontroller.cpp ++++ b/src/control/joystickkeyboardcontroller.cpp +@@ -70,7 +70,7 @@ JoystickKeyboardController::JoystickKeyboardController() : + keymap[SDLK_END] = Controller::PEEK_DOWN; + + jump_with_up_joy = false; +- jump_with_up_kbd = false; ++ jump_with_up_kbd = true; + + updateAvailableJoysticks(); + +diff --git a/src/supertux/main.cpp b/src/supertux/main.cpp +index 3dccd6e..f4b179d 100644 +--- a/src/supertux/main.cpp ++++ b/src/supertux/main.cpp +@@ -20,7 +20,7 @@ + #include + #include + #include +-#include ++//#include + #include + #include + extern "C" { +@@ -163,6 +163,7 @@ Main::init_physfs(const char* argv0) + sourcedir = true; + } + } ++ PHYSFS_addToSearchPath("data", 1); + + #ifdef MACOSX + { +diff --git a/src/util/log.cpp b/src/util/log.cpp +index 6ce6f73..e12edf7 100644 +--- a/src/util/log.cpp ++++ b/src/util/log.cpp +@@ -18,12 +18,81 @@ + #include "util/log.hpp" + + #include ++#include + + #include "math/rectf.hpp" + #include "supertux/console.hpp" + ++class _android_debugbuf: public std::streambuf ++{ ++ public: ++ _android_debugbuf() ++ { ++ pos = 0; ++ buf[0] = 0; ++ } ++ ++ protected: ++ ++ ++virtual int overflow(int c = EOF) ++{ ++ if (EOF == c) ++ { ++ return '\0'; // returning EOF indicates an error ++ } ++ else ++ { ++ outputchar(c); ++ return c; ++ } ++}; ++ ++ ++// we don’t do input so always return EOF ++virtual int uflow() {return EOF;} ++ ++// we don’t do input so always return 0 chars read ++virtual int xsgetn(char *, int) {return 0;} ++ ++// Calls outputchar() for each character. ++virtual int xsputn(const char *s, int n) ++{ ++ for (int i = 0; i < n; ++i) ++ { ++ outputchar(s[i]); ++ } ++ return n;// we always process all of the chars ++}; ++ ++private: ++ ++// the buffer ++char buf[256]; ++int pos; ++ ++void outputchar(char c) ++{ ++ // TODO: mutex ++ if( pos >= sizeof(buf)-1 || c == '\n' || c == '\r' || c == 0 ) ++ { ++ buf[pos] = 0; ++ __android_log_print(ANDROID_LOG_INFO, "SuperTux", "%s", buf); ++ pos = 0; ++ buf[pos] = 0; ++ return; ++ }; ++ buf[pos] = c; ++ pos++; ++}; ++ ++}; ++ ++static std::ostream android_logcat(new _android_debugbuf()); ++ + static std::ostream& get_logging_instance (void) + { ++ return android_logcat; + if (Console::instance != NULL) + return (Console::output); + else +diff --git a/src/video/gl/gl_texture.cpp b/src/video/gl/gl_texture.cpp +index 9e2b70d..885ae87 100644 +--- a/src/video/gl/gl_texture.cpp ++++ b/src/video/gl/gl_texture.cpp +@@ -146,9 +146,11 @@ GLTexture::GLTexture(SDL_Surface* image) : + } + else + { // build mipmaps ++#ifndef GL_VERSION_ES_CM_1_0 + gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, texture_width, + texture_height, sdl_format, + GL_UNSIGNED_BYTE, convert->pixels); ++#endif + } + + if(SDL_MUSTLOCK(convert)) +diff --git a/src/video/glutil.hpp b/src/video/glutil.hpp +index e51240d..2330b0a 100644 +--- a/src/video/glutil.hpp ++++ b/src/video/glutil.hpp +@@ -76,7 +76,7 @@ static inline void check_gl_error(const char* message) + msg << "Unknown error (code " << error << ")"; + } + +- throw std::runtime_error(msg.str()); ++ //throw std::runtime_error(msg.str()); + } + } + diff --git a/project/jni/application/supertux/config.h b/project/jni/application/supertux/config.h new file mode 100644 index 000000000..d537c3091 --- /dev/null +++ b/project/jni/application/supertux/config.h @@ -0,0 +1,30 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#define PACKAGE_NAME "supertux2" + +/* #undef ENABLE_SQDBG */ + +/* #undef ENABLE_BINRELOC */ +#define INSTALL_SUBDIR_BIN "games" +#define INSTALL_SUBDIR_SHARE "share/games/supertux2" + +#define SIZEOF_VOID_P 4 +#if SIZEOF_VOID_P == 8 +#define _SQ64 +#endif + +/* #undef HAVE_ICONV_CONST */ +#ifdef HAVE_ICONV_CONST +#define ICONV_CONST const +#else +#define ICONV_CONST +#endif + +/* #undef WORDS_BIGENDIAN */ + +#define HAVE_OPENGL + +#define HAVE_LIBCURL + +#endif /*CONFIG_H*/ diff --git a/project/jni/application/supertux/icon.png b/project/jni/application/supertux/icon.png new file mode 120000 index 000000000..a2e967f6f --- /dev/null +++ b/project/jni/application/supertux/icon.png @@ -0,0 +1 @@ +supertux/data/images/engine/icons/supertux-256x256.png \ No newline at end of file diff --git a/project/jni/application/supertux/supertux b/project/jni/application/supertux/supertux new file mode 120000 index 000000000..d0ae93725 --- /dev/null +++ b/project/jni/application/supertux/supertux @@ -0,0 +1 @@ +../../../../../supertux \ No newline at end of file diff --git a/project/jni/application/supertux/version.h b/project/jni/application/supertux/version.h new file mode 100644 index 000000000..ae3692547 --- /dev/null +++ b/project/jni/application/supertux/version.h @@ -0,0 +1,4 @@ +#ifndef VERSION_H +#define VERSION_H +#define PACKAGE_VERSION "0.3.3-GIT rexported" +#endif