diff --git a/build.sh b/build.sh index 494a313c2..f78520b76 100755 --- a/build.sh +++ b/build.sh @@ -24,7 +24,7 @@ if uname -s | grep -i "windows" > /dev/null ; then MYARCH=windows-x86 fi -cd project && env PATH=$NDKBUILDPATH nice -n19 ndk-build -j4 V=1 && \ +cd project && env PATH=$NDKBUILDPATH nice -n19 ndk-build V=1 -j4 && \ { grep "CustomBuildScript=y" ../AndroidAppSettings.cfg > /dev/null && \ [ -`which ndk-build | grep '/android-ndk-r[56789]'` != - ] && \ echo Stripping libapplication.so by hand \ diff --git a/project/jni/application/ballfield/AndroidAppSettings.cfg b/project/jni/application/ballfield/AndroidAppSettings.cfg index 050ad141d..67fc19e55 100644 --- a/project/jni/application/ballfield/AndroidAppSettings.cfg +++ b/project/jni/application/ballfield/AndroidAppSettings.cfg @@ -1,6 +1,6 @@ # The application settings for Android libSDL port AppSettingVersion=17 -LibSdlVersion=1.3 +LibSdlVersion=1.2 AppName="Ballfield" AppFullName=net.olofson.ballfield ScreenOrientation=h diff --git a/project/jni/application/setEnvironment-r5b.sh b/project/jni/application/setEnvironment-r5b.sh index 8ae34931f..e514e849b 100755 --- a/project/jni/application/setEnvironment-r5b.sh +++ b/project/jni/application/setEnvironment-r5b.sh @@ -38,7 +38,7 @@ done ) if [ -n "$CRYSTAX_WCHAR" ]; then - CRYSTAX_WCHAR_INCLUDE=-I$NDK/sources/crystax/include + CRYSTAX_WCHAR_INCLUDE=-isystem$NDK/sources/crystax/include CRYSTAX_WCHAR_LIB="$NDK/sources/crystax/libs/armeabi/libcrystax_static.a" fi @@ -46,13 +46,13 @@ CFLAGS="\ -fexceptions -frtti \ -fpic -ffunction-sections -funwind-tables -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi \ -march=armv5te -mtune=xscale -msoft-float -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 \ --I$NDK/platforms/$PLATFORMVER/arch-arm/usr/include -Wa,--noexecstack \ +-isystem$NDK/platforms/$PLATFORMVER/arch-arm/usr/include -Wa,--noexecstack \ -DANDROID \ -DNDEBUG -O2 -g \ --I$NDK/sources/cxx-stl/gnu-libstdc++/include \ --I$NDK/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include \ --I$LOCAL_PATH/../sdl-1.2/include \ -`echo $APP_MODULES | sed \"s@\([-a-zA-Z0-9_.]\+\)@-I$LOCAL_PATH/../\1/include@g\"` \ +-isystem$NDK/sources/cxx-stl/gnu-libstdc++/include \ +-isystem$NDK/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include \ +-isystem$LOCAL_PATH/../sdl-1.2/include \ +`echo $APP_MODULES | sed \"s@\([-a-zA-Z0-9_.]\+\)@-isystem$LOCAL_PATH/../\1/include@g\"` \ $CRYSTAX_WCHAR_INCLUDE" SHARED="-shared -Wl,-soname,libapplication.so" @@ -81,6 +81,8 @@ $NDK/platforms/$PLATFORMVER/arch-arm/usr/lib/libstdc++.a \ -Wl,-rpath-link=$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib -lsupc++ \ $CRYSTAX_WCHAR_LIB" +#echo env CFLAGS=\""$CFLAGS"\" LDFLAGS=\""$LDFLAGS"\" "$@" + env PATH=$NDK/toolchains/$GCCPREFIX-$GCCVER/prebuilt/$MYARCH/bin:$LOCAL_PATH:$PATH \ CFLAGS="$CFLAGS" \ CXXFLAGS="$CFLAGS" \ diff --git a/project/jni/application/src b/project/jni/application/src index 104f796a6..8193e5e18 120000 --- a/project/jni/application/src +++ b/project/jni/application/src @@ -1 +1 @@ -ballfield \ No newline at end of file +vcmi \ No newline at end of file diff --git a/project/jni/application/teeworlds/AndroidAppSettings.cfg b/project/jni/application/teeworlds/AndroidAppSettings.cfg index ec843b3df..839318293 100644 --- a/project/jni/application/teeworlds/AndroidAppSettings.cfg +++ b/project/jni/application/teeworlds/AndroidAppSettings.cfg @@ -6,12 +6,17 @@ AppFullName=com.teeworlds ScreenOrientation=h InhibitSuspend=n AppDataDownloadUrl="Game data is 8 Mb|http://sourceforge.net/projects/libsdl-android/files/TeeWorlds/teeworlds.zip/download" +VideoDepthBpp=16 +NeedDepthBuffer=n +NeedStencilBuffer=n +NeedGles2=n +SwVideoMode=n SdlVideoResize=n SdlVideoResizeKeepAspect=n -NeedDepthBuffer=n -SwVideoMode=n +CompatibilityHacks=n AppUsesMouse=y AppNeedsTwoButtonMouse=y +ForceRelativeMouseMode=y AppNeedsArrowKeys=y AppNeedsTextInput=y AppUsesJoystick=y @@ -22,6 +27,9 @@ RedefinedKeys="SPACE RETURN LEFT RIGHT LSHIFT ESCAPE RSHIFT LSHIFT" AppTouchscreenKeyboardKeysAmount=6 AppTouchscreenKeyboardKeysAmountAutoFire=0 RedefinedKeysScreenKb="SPACE RETURN LEFT RIGHT RSHIFT LSHIFT" +StartupMenuButtonTimeout=3000 +HiddenMenuOptions='' +FirstStartMenuOptions='' MultiABI=y AppVersionCode=5207 AppVersionName="0.5.2.07" diff --git a/project/jni/application/vcmi/.gitignore b/project/jni/application/vcmi/.gitignore new file mode 100644 index 000000000..1fe313b9c --- /dev/null +++ b/project/jni/application/vcmi/.gitignore @@ -0,0 +1,8 @@ +libvcmi.so +AI +Scripting +debug +out +vcmiserver +vcmiserver.zip +build.log diff --git a/project/jni/application/vcmi/AndroidAppSettings.cfg b/project/jni/application/vcmi/AndroidAppSettings.cfg index e16cdb1da..cd20d7af1 100644 --- a/project/jni/application/vcmi/AndroidAppSettings.cfg +++ b/project/jni/application/vcmi/AndroidAppSettings.cfg @@ -31,12 +31,12 @@ StartupMenuButtonTimeout=3000 HiddenMenuOptions='KeyboardConfigMainMenu AudioConfig OptionalDownloadConfig' FirstStartMenuOptions='' MultiABI=n -AppVersionCode=08503 -AppVersionName="0.85.03" -CompiledLibraries="sdl_mixer sdl_image sdl_ttf avutil avcore avcodec avformat swscale boost_program_options boost_filesystem boost_iostreams boost_system boost_thread vcmi android" +AppVersionCode=08604 +AppVersionName="0.86.04" +CompiledLibraries="mad sdl_mixer sdl_image sdl_ttf avutil avcore avcodec avformat swscale boost_program_options boost_filesystem boost_iostreams boost_system boost_thread vcmi android" CustomBuildScript=n AppCflags='-DDATA_DIR=\\"/sdcard/app-data/eu.vcmi\\" -DBIN_DIR=\\"/data/data/eu.vcmi/files\\" -DLIB_DIR=\\"/data/data/eu.vcmi/files\\" -DWITH_AVCODEC_DECODE_VIDEO2=1 -Wstrict-aliasing -Wcast-align -Wpointer-arith -Waddress' AppLdflags='-lz -Ljni/application/vcmi -lvcmi' -AppSubdirsBuild='vcmi/client vcmi/CGameInterface.cpp vcmi/CCallback.cpp' +AppSubdirsBuild='vcmi/client vcmi/CCallback.cpp' AppCmdline='' ReadmeText='^You may press "Home" now - the data will be downloaded in background' diff --git a/project/jni/application/vcmi/AndroidData/data1.zip b/project/jni/application/vcmi/AndroidData/data1.zip index bfd6667d1..be8147f11 100644 Binary files a/project/jni/application/vcmi/AndroidData/data1.zip and b/project/jni/application/vcmi/AndroidData/data1.zip differ diff --git a/project/jni/application/vcmi/AndroidData/data2.zip b/project/jni/application/vcmi/AndroidData/data2.zip index d0fc617c4..54bfa22a4 100644 Binary files a/project/jni/application/vcmi/AndroidData/data2.zip and b/project/jni/application/vcmi/AndroidData/data2.zip differ diff --git a/project/jni/application/vcmi/AndroidData/data3.zip b/project/jni/application/vcmi/AndroidData/data3.zip index 73368fca6..2f275aeb7 100644 Binary files a/project/jni/application/vcmi/AndroidData/data3.zip and b/project/jni/application/vcmi/AndroidData/data3.zip differ diff --git a/project/jni/application/vcmi/AndroidData/vcmiserver0 b/project/jni/application/vcmi/AndroidData/vcmiserver0 index 4af2afe2a..2b754e668 100644 Binary files a/project/jni/application/vcmi/AndroidData/vcmiserver0 and b/project/jni/application/vcmi/AndroidData/vcmiserver0 differ diff --git a/project/jni/application/vcmi/AndroidData/vcmiserver1 b/project/jni/application/vcmi/AndroidData/vcmiserver1 index 33ccc7850..04f6f22ab 100644 Binary files a/project/jni/application/vcmi/AndroidData/vcmiserver1 and b/project/jni/application/vcmi/AndroidData/vcmiserver1 differ diff --git a/project/jni/application/vcmi/Makefile b/project/jni/application/vcmi/Makefile index cb959a440..92a8dae2d 100644 --- a/project/jni/application/vcmi/Makefile +++ b/project/jni/application/vcmi/Makefile @@ -2,6 +2,7 @@ $(shell mkdir -p AI debug/AI Scripting debug/Scripting \ out/vcmi/lib out/vcmi/server out/vcmi/AI/StupidAI \ out/vcmi/AI/GeniusAI out/vcmi/client out/vcmi/Scripting/ERM) +$(shell rm -f ../../../obj/local/armeabi/libvcmi.so) LOCAL_PATH=$(shell dirname $0) LOCAL_PATH=`cd $LOCAL_PATH && pwd` diff --git a/project/jni/application/vcmi/readme.txt b/project/jni/application/vcmi/readme.txt index 782de3337..c61995c50 100644 --- a/project/jni/application/vcmi/readme.txt +++ b/project/jni/application/vcmi/readme.txt @@ -2,9 +2,9 @@ Quick compilation guide: Download my GIT repo from https://github.com/pelya/commandergenius, then install Android SDK 3.1 from http://developer.android.com, NDK r5 from http://crystax.net/ and "ant" tool, then launch commands + android update project -p project rm project/jni/application/src ln -s vcmi project/jni/application/src - android update project -p project echo > project/jni/application/vcmi/libvcmi.so then download VCMI into the dir project/jni/application/vcmi/vcmi (or create a symlink to it if you already have downloaded it), then apply patch vcmi-android.diff, diff --git a/project/jni/application/vcmi/vcmi-android.diff b/project/jni/application/vcmi/vcmi-android.diff index 9f107fc19..aea113997 100644 --- a/project/jni/application/vcmi/vcmi-android.diff +++ b/project/jni/application/vcmi/vcmi-android.diff @@ -1,23 +1,8 @@ -Index: lib/Connection.h -=================================================================== ---- lib/Connection.h (revision 2220) -+++ lib/Connection.h (working copy) -@@ -82,7 +82,9 @@ - { - bool operator()(const std::type_info *a, const std::type_info *b) const - { -- return a->before(*b); -+ // Comparing pointers is bad bad practice, because type_info pointers to the same types -+ // are different inside shared library and the executable that links to that library -+ return strcmp(a->name(), b->name()) > 0; - } - }; - Index: lib/CLodHandler.cpp =================================================================== ---- lib/CLodHandler.cpp (revision 2220) +--- lib/CLodHandler.cpp (revision 2387) +++ lib/CLodHandler.cpp (working copy) -@@ -78,13 +78,15 @@ +@@ -87,13 +87,15 @@ Entry ourEntry = *en_it; if(length) *length = ourEntry.realSize; @@ -34,7 +19,7 @@ Index: lib/CLodHandler.cpp FILE * f = fopen((myDir + "/" + ourEntry.realName).c_str(), "rb"); if (f) { -@@ -100,16 +102,21 @@ +@@ -109,16 +111,21 @@ delete[] outp; return NULL; } @@ -58,7 +43,7 @@ Index: lib/CLodHandler.cpp return outp; } else //we will decompress file -@@ -122,7 +129,12 @@ +@@ -131,7 +138,12 @@ infs2(outp, ourEntry.size, ourEntry.realSize, decomp); mutex->unlock(); delete[] outp; @@ -74,7 +59,7 @@ Index: lib/CLodHandler.cpp } Index: lib/Interprocess.h =================================================================== ---- lib/Interprocess.h (revision 2220) +--- lib/Interprocess.h (revision 2387) +++ lib/Interprocess.h (working copy) @@ -1,3 +1,4 @@ +/* @@ -144,9 +129,24 @@ Index: lib/Interprocess.h + fwrite("1", 1, 1, ff); + fclose(ff); +} +Index: lib/Connection.h +=================================================================== +--- lib/Connection.h (revision 2387) ++++ lib/Connection.h (working copy) +@@ -82,7 +82,9 @@ + { + bool operator()(const std::type_info *a, const std::type_info *b) const + { +- return a->before(*b); ++ // Comparing pointers is bad bad practice, because type_info pointers to the same types ++ // are different inside shared library and the executable that links to that library ++ return strcmp(a->name(), b->name()) > 0; + } + }; + Index: server/stdafx.h =================================================================== ---- server/stdafx.h (revision 2220) +--- server/stdafx.h (revision 2387) +++ server/stdafx.h (working copy) @@ -15,8 +15,8 @@ #include "../global.h" @@ -161,7 +161,7 @@ Index: server/stdafx.h #include Index: server/CVCMIServer.cpp =================================================================== ---- server/CVCMIServer.cpp (revision 2220) +--- server/CVCMIServer.cpp (revision 2387) +++ server/CVCMIServer.cpp (working copy) @@ -29,7 +29,7 @@ using namespace boost; @@ -189,7 +189,7 @@ Index: server/CVCMIServer.cpp boost::system::error_code error; tlog0<<"Listening for connections at port " << acceptor->local_endpoint().port() << std::endl; - tcp::socket * s = new tcp::socket(acceptor->io_service()); + tcp::socket * s = new tcp::socket(acceptor->get_io_service()); boost::thread acc(boost::bind(vaccept,acceptor,s,&error)); + /* sr->setToTrueAndNotify(); @@ -200,19 +200,25 @@ Index: server/CVCMIServer.cpp if (error) Index: server/CGameHandler.cpp =================================================================== ---- server/CGameHandler.cpp (revision 2220) +--- server/CGameHandler.cpp (revision 2387) +++ server/CGameHandler.cpp (working copy) -@@ -602,7 +602,9 @@ - - if(apply) +@@ -638,6 +638,7 @@ + (packType != typeList.getTypeID() || !isAllowedArrangePack((ArrangeStacks*)pack)) && // for dialogs like garrison + states[getCurrentPlayer()].queries.size()) { + tlog0<<__FUNCTION__ << " at " << __FILE__ << ":" << __LINE__ << std::endl; + complain("Answer the query before attempting any further actions!"); + PackageApplied applied; + applied.result = false; +@@ -650,6 +651,7 @@ + else if(apply) + { bool result = apply->applyOnGH(this,&c,pack); + tlog0<<__FUNCTION__ << " at " << __FILE__ << ":" << __LINE__ << std::endl; tlog5 << "Message successfully applied (result=" << result << ")!\n"; //send confirmation that we've applied the package -@@ -1795,7 +1797,7 @@ +@@ -1833,7 +1835,7 @@ iw.player = h1->tempOwner; iw.components.push_back(Component(Component::SEC_SKILL, 18, ScholarLevel, 0)); @@ -223,7 +229,7 @@ Index: server/CGameHandler.cpp if (cs2.spells.size())//if found new spell - apply Index: CConsoleHandler.cpp =================================================================== ---- CConsoleHandler.cpp (revision 2220) +--- CConsoleHandler.cpp (revision 2387) +++ CConsoleHandler.cpp (working copy) @@ -143,6 +143,7 @@ @@ -243,7 +249,7 @@ Index: CConsoleHandler.cpp int CConsoleHandler::run() Index: global.h =================================================================== ---- global.h (revision 2220) +--- global.h (revision 2387) +++ global.h (working copy) @@ -4,6 +4,7 @@ #include @@ -253,7 +259,7 @@ Index: global.h #include //std::find #include #include -@@ -729,29 +730,21 @@ +@@ -725,29 +726,21 @@ } @@ -289,9 +295,25 @@ Index: global.h //for explicit overrides #ifdef _MSC_VER #define OVERRIDE override +Index: AI/GeniusAI/neuralNetwork.cpp +=================================================================== +--- AI/GeniusAI/neuralNetwork.cpp (revision 2387) ++++ AI/GeniusAI/neuralNetwork.cpp (working copy) +@@ -14,9 +14,9 @@ + static bool in = 0; + if(!in) + { +- float x = (rand()+1)/float(RAND_MAX+1); ++ float x = (rand())/float(RAND_MAX); + float f = sqrtf( - 2.0f * log(x) ); +- x = (rand()+1)/float(RAND_MAX+1); ++ x = (rand())/float(RAND_MAX); + kept = f * cosf( 2.0f * M_PI * x ); + in = true; + return f * sinf( 2.0f * M_PI * x ); Index: Scripting/ERM/ERMParser.cpp =================================================================== ---- Scripting/ERM/ERMParser.cpp (revision 2220) +--- Scripting/ERM/ERMParser.cpp (revision 2387) +++ Scripting/ERM/ERMParser.cpp (working copy) @@ -2,7 +2,7 @@ #include @@ -304,10 +326,10 @@ Index: Scripting/ERM/ERMParser.cpp #include Index: client/Graphics.cpp =================================================================== ---- client/Graphics.cpp (revision 2220) +--- client/Graphics.cpp (revision 2387) +++ client/Graphics.cpp (working copy) -@@ -333,8 +333,15 @@ - tasks += GET_SURFACE(backgroundsm[id],name); +@@ -315,8 +315,15 @@ + tasks += GET_SURFACE(backgroundsm[id], b["bg120"].String()); } +#ifdef ANDROID @@ -322,7 +344,7 @@ Index: client/Graphics.cpp for(size_t y=0; y < heroMoveArrows->ourImages.size(); ++y) { -@@ -541,13 +548,20 @@ +@@ -508,13 +515,20 @@ pr[3].first = &Graphics::flags4; pr[3].second+=("AF00.DEF"),("AF01.DEF"),("AF02.DEF"),("AF03.DEF"),("AF04.DEF"), ("AF05.DEF"),("AF06.DEF"),("AF07.DEF"); @@ -344,11 +366,66 @@ Index: client/Graphics.cpp } SDL_Surface * Graphics::getPic(int ID, bool fort, bool builded) { +@@ -677,7 +691,7 @@ + return NULL; + } + +- int magic = *(const int*)hlp; ++ int magic = read_unaligned_u32(hlp); + if(len < 10000 || (magic != 589598 && magic != 589599)) + { + tlog1 << "Suspicious font file (length " << len <<", fname " << name << "), logging to suspicious_" << name << ".fnt\n"; +Index: client/SDL_Extensions.cpp +=================================================================== +--- client/SDL_Extensions.cpp (revision 2387) ++++ client/SDL_Extensions.cpp (working copy) +@@ -119,8 +119,8 @@ + if(incrementPtr == -1) + ptr -= 2; + +- Uint16 * const px = (Uint16*)ptr; +- *px = (B>>3) + ((G>>2) << 5) + ((R>>3) << 11); //drop least significant bits of 24 bpp encoded color ++ Uint16 px = (B>>3) + ((G>>2) << 5) + ((R>>3) << 11); //drop least significant bits of 24 bpp encoded color ++ memcpy(ptr, &px, sizeof(px)); + + if(incrementPtr == 1) + ptr += 2; //bpp +@@ -150,9 +150,9 @@ + const int rmask = 0xF800, gmask = 0x7E0, bmask = 0x1F; + const int rshift = 11, gshift = 5, bshift = 0; + +- const Uint8 r5 = (*((Uint16 *)ptr) & rmask) >> rshift, +- b5 = (*((Uint16 *)ptr) & bmask) >> bshift, +- g5 = (*((Uint16 *)ptr) & gmask) >> gshift; ++ const Uint8 r5 = (read_unaligned_u16(ptr) & rmask) >> rshift, ++ b5 = (read_unaligned_u16(ptr) & bmask) >> bshift, ++ g5 = (read_unaligned_u16(ptr) & gmask) >> gshift; + + const Uint32 r8 = (r5 << (8 - rbit)) | (r5 >> (2*rbit - 8)), + g8 = (g5 << (8 - gbit)) | (g5 >> (2*gbit - 8)), +@@ -649,7 +649,7 @@ + return *p; + + case 2: +- return *(Uint16 *)p; ++ return read_unaligned_u16(p); + + case 3: + /* +@@ -661,7 +661,7 @@ + //#endif + + case 4: +- return *(Uint32 *)p; ++ return read_unaligned_u32(p); + + default: + return 0; // shouldn't happen, but avoids warnings Index: client/Client.cpp =================================================================== ---- client/Client.cpp (revision 2220) +--- client/Client.cpp (revision 2387) +++ client/Client.cpp (working copy) -@@ -40,7 +40,7 @@ +@@ -41,7 +41,7 @@ #include "../lib/RegisterTypes.cpp" extern std::string NAME; @@ -357,22 +434,7 @@ Index: client/Client.cpp /* * Client.cpp, part of VCMI engine -@@ -432,7 +432,13 @@ - hotSeat = (humanPlayers > 1); - - std::vector scriptModules; -- CFileUtility::getFilesWithExt(scriptModules, "./Scripting", ".dll"); -+ CFileUtility::getFilesWithExt(scriptModules, -+#ifdef ANDROID -+ LIB_DIR "/" -+#else -+ "./" -+#endif -+ "Scripting", ".dll"); - BOOST_FOREACH(FileInfo &m, scriptModules) - { - CScriptingModule * nm = CDynLibHandler::getNewScriptingModule(m.name); -@@ -505,9 +511,9 @@ +@@ -476,9 +476,9 @@ void CClient::handlePack( CPack * pack ) { @@ -384,7 +446,7 @@ Index: client/Client.cpp apply->applyOnClBefore(this,pack); tlog5 << "\tMade first apply on cl\n"; gs->apply(pack); -@@ -642,18 +648,22 @@ +@@ -639,18 +639,22 @@ startServer(); th.update(); @@ -408,7 +470,7 @@ Index: client/Client.cpp waitForServer(); th.update(); -@@ -668,27 +678,31 @@ +@@ -665,27 +669,31 @@ CServerHandler::CServerHandler(bool runServer /*= false*/) { serverThread = NULL; @@ -444,7 +506,7 @@ Index: client/Client.cpp } Index: client/GUIBase.cpp =================================================================== ---- client/GUIBase.cpp (revision 2220) +--- client/GUIBase.cpp (revision 2387) +++ client/GUIBase.cpp (working copy) @@ -11,6 +11,7 @@ #include "../CThreadHelper.h" @@ -483,9 +545,9 @@ Index: client/GUIBase.cpp :lastClick(-500, -500) Index: client/CAnimation.h =================================================================== ---- client/CAnimation.h (revision 2220) +--- client/CAnimation.h (revision 2387) +++ client/CAnimation.h (working copy) -@@ -46,6 +46,8 @@ +@@ -47,6 +47,8 @@ std::map > offset; unsigned char * data; @@ -494,7 +556,7 @@ Index: client/CAnimation.h SDL_Color * palette; public: -@@ -124,6 +126,8 @@ +@@ -125,6 +127,8 @@ * 2nd byte = size of segment * raw data (if any) */ @@ -503,7 +565,7 @@ Index: client/CAnimation.h class CompImage : public IImage { //x,y - margins, w,h - sprite size -@@ -157,8 +161,8 @@ +@@ -158,8 +162,8 @@ friend class CompImageLoader; }; @@ -515,7 +577,7 @@ Index: client/CAnimation.h { Index: client/CDefHandler.h =================================================================== ---- client/CDefHandler.h (revision 2220) +--- client/CDefHandler.h (revision 2387) +++ client/CDefHandler.h (working copy) @@ -30,7 +30,6 @@ ui32 totalInBlock; @@ -539,7 +601,7 @@ Index: client/CDefHandler.h static CDefHandler * giveDef(const std::string & defName); Index: client/CCreatureAnimation.h =================================================================== ---- client/CCreatureAnimation.h (revision 2220) +--- client/CCreatureAnimation.h (revision 2387) +++ client/CCreatureAnimation.h (working copy) @@ -66,6 +66,8 @@ int curFrame, internalFrame; //number of currently displayed frame @@ -552,7 +614,7 @@ Index: client/CCreatureAnimation.h int nextFrameT(SDL_Surface * dest, int x, int y, bool attacker, unsigned char animCount, bool incrementFrame = true, bool yellowBorder = false, bool blueBorder = false, SDL_Rect * destRect = NULL); //0 - success, any other - error //print next Index: client/CMT.cpp =================================================================== ---- client/CMT.cpp (revision 2220) +--- client/CMT.cpp (revision 2387) +++ client/CMT.cpp (working copy) @@ -92,8 +92,10 @@ void dispose(); @@ -573,20 +635,15 @@ Index: client/CMT.cpp THC tlog0<<"\tLoading default system settings: "<soundh->init(); - CCS->soundh->setVolume(GDefaultOptions.soundVolume); - CCS->musich = new CMusicHandler; -+ - //CGI->musich->init(); - //CGI->musich->setVolume(GDefaultOptions.musicVolume); +@@ -141,6 +144,7 @@ + CCS->musich->setVolume(GDefaultOptions.musicVolume); tlog0<<"\tInitializing sound: "<(CGI)->setFromLib(); -@@ -154,7 +159,9 @@ +@@ -154,7 +158,9 @@ CCS->curh->show(); tlog0<<"Screen handler: "<loadHeroAnims(); tlog0<<"\tMain graphics: "<start(); atexit(dispose); tlog0 <<"Creating console and logfile: "<playerInfos[1].color = 1; startGame(si); } @@ -658,7 +715,7 @@ Index: client/CMT.cpp return 0; } -@@ -558,10 +583,12 @@ +@@ -561,10 +585,12 @@ tlog2 << "Warning: SDL says that " << bpp << "bpp is wrong and suggests " << suggestedBpp << std::endl; } @@ -671,7 +728,7 @@ Index: client/CMT.cpp if((screen = SDL_SetVideoMode(w, h, suggestedBpp, SDL_SWSURFACE|(fullscreen?SDL_FULLSCREEN:0))) == NULL) { -@@ -606,14 +633,27 @@ +@@ -609,14 +635,27 @@ setResolution = true; } @@ -702,7 +759,7 @@ Index: client/CMT.cpp //tlog0 << "got " << (int)ev->type; if (ret == 0 || (ev->type==SDL_QUIT) || (ev->type == SDL_KEYDOWN && ev->key.keysym.sym==SDLK_F4 && (ev->key.keysym.mod & KMOD_ALT))) -@@ -632,7 +672,7 @@ +@@ -635,7 +674,7 @@ SDL_Delay(750); SDL_Quit(); tlog0 << "Ending...\n"; @@ -711,7 +768,7 @@ Index: client/CMT.cpp } else if(LOCPLINT && ev->type == SDL_KEYDOWN && ev->key.keysym.sym==SDLK_F4) { -@@ -641,7 +681,7 @@ +@@ -644,7 +683,7 @@ setScreenRes(conf.cc.screenx, conf.cc.screeny, conf.cc.bpp, full); GH.totalRedraw(); delete ev; @@ -720,7 +777,7 @@ Index: client/CMT.cpp } else if(ev->type == SDL_USEREVENT) { -@@ -671,7 +711,7 @@ +@@ -674,7 +713,7 @@ } delete ev; @@ -729,7 +786,7 @@ Index: client/CMT.cpp } //tlog0 << " pushing "; -@@ -679,7 +719,7 @@ +@@ -682,7 +721,7 @@ events.push(ev); eventsM.unlock(); //tlog0 << " done\n"; @@ -738,14 +795,14 @@ Index: client/CMT.cpp } void startGame(StartInfo * options, CConnection *serv/* = NULL*/) -@@ -740,3 +780,4 @@ +@@ -742,3 +781,4 @@ ev.user.code = 1; SDL_PushEvent(&ev); } + Index: client/Client.h =================================================================== ---- client/Client.h (revision 2220) +--- client/Client.h (revision 2387) +++ client/Client.h (working copy) @@ -43,7 +43,7 @@ public: @@ -758,7 +815,7 @@ Index: client/Client.h Index: client/CDefHandler.cpp =================================================================== ---- client/CDefHandler.cpp (revision 2220) +--- client/CDefHandler.cpp (revision 2387) +++ client/CDefHandler.cpp (working copy) @@ -50,10 +50,19 @@ SDL_FreeSurface(ourImages[i].bitmap); @@ -1087,7 +1144,7 @@ Index: client/CDefHandler.cpp } Index: client/CCreatureAnimation.cpp =================================================================== ---- client/CCreatureAnimation.cpp (revision 2220) +--- client/CCreatureAnimation.cpp (revision 2387) +++ client/CCreatureAnimation.cpp (working copy) @@ -37,15 +37,23 @@ } @@ -1172,9 +1229,9 @@ Index: client/CCreatureAnimation.cpp } Index: client/CAnimation.cpp =================================================================== ---- client/CAnimation.cpp (revision 2220) +--- client/CAnimation.cpp (revision 2387) +++ client/CAnimation.cpp (working copy) -@@ -44,6 +44,8 @@ +@@ -46,6 +46,8 @@ ~SDLImageLoader(); }; @@ -1183,18 +1240,15 @@ Index: client/CAnimation.cpp class CompImageLoader { CompImage * image; -@@ -67,7 +69,7 @@ +@@ -69,11 +71,18 @@ CompImageLoader(CompImage * Img); ~CompImageLoader(); }; - +*/ - //Small internal class for parsing texts - class TextParser - { -@@ -95,6 +97,13 @@ - } - } + /************************************************************************* + * DefFile, class used for def loading * + *************************************************************************/ + +#define CHECK_LOD_MEM_BLOCK_SIZE1(S, FF, F, L) { \ @@ -1206,7 +1260,7 @@ Index: client/CAnimation.cpp CDefFile::CDefFile(std::string Name): data(NULL), palette(NULL) -@@ -112,15 +121,18 @@ +@@ -91,15 +100,18 @@ { 0, 0, 0, 192} // 75% - shadow border below selection }; @@ -1226,7 +1280,7 @@ Index: client/CAnimation.cpp unsigned int totalBlocks = readNormalNr(data, it); it+=4; -@@ -135,6 +147,7 @@ +@@ -117,6 +129,7 @@ for (unsigned int i=0; isecond[frame]; @@ -1253,7 +1307,7 @@ Index: client/CAnimation.cpp SSpriteDef sprite; //sprite.size = SDL_SwapLE32(sd.size);//unused -@@ -188,6 +204,7 @@ +@@ -170,6 +186,7 @@ //pixel data is not compressed, copy data to surface for (unsigned int i=0; isurf = newPtr; } @@ -1375,7 +1429,7 @@ Index: client/CAnimation.cpp /************************************************************************* * Classes for images, support loading from file and drawing on surface * *************************************************************************/ -@@ -641,6 +677,8 @@ +@@ -625,6 +661,8 @@ SDL_FreeSurface(surf); } @@ -1384,7 +1438,7 @@ Index: client/CAnimation.cpp CompImage::CompImage(const CDefFile *data, size_t frame, size_t group): surf(NULL), line(NULL), -@@ -861,6 +899,7 @@ +@@ -845,6 +883,7 @@ delete [] line; delete [] palette; } @@ -1392,9 +1446,9 @@ Index: client/CAnimation.cpp /************************************************************************* * CAnimation for animations handling, can load part of file if needed * -@@ -953,9 +992,11 @@ +@@ -889,9 +928,11 @@ //try to get image from def - if (source[group][frame].empty()) + if (source[group][frame].getType() == JsonNode::DATA_NULL) { + /* if (compressed) @@ -1406,9 +1460,9 @@ Index: client/CAnimation.cpp else //load from separate file Index: client/GUIBase.h =================================================================== ---- client/GUIBase.h (revision 2220) +--- client/GUIBase.h (revision 2387) +++ client/GUIBase.h (working copy) -@@ -546,6 +546,8 @@ +@@ -558,6 +558,8 @@ CGuiHandler(); ~CGuiHandler(); void run(); // holds the main loop for the whole program after initialization and manages the update/rendering system @@ -1417,3 +1471,65 @@ Index: client/GUIBase.h void totalRedraw(); //forces total redraw (using showAll), sets a flag, method gets called at the end of the rendering void simpleRedraw(); //update only top interface and draw background from buffer, sets a flag, method gets called at the end of the rendering +Index: client/CSndHandler.cpp +=================================================================== +--- client/CSndHandler.cpp (revision 2387) ++++ client/CSndHandler.cpp (working copy) +@@ -151,16 +151,17 @@ + } + + const char *data = mfile->data(); +- unsigned int numFiles = SDL_SwapLE32(*(Uint32 *)&data[0]); +- struct soundEntry *se = (struct soundEntry *)&data[4]; ++ unsigned int numFiles = SDL_SwapLE32(read_unaligned_u32(&data[0])); ++ struct soundEntry se; + +- for (unsigned int i=0; ifilename; +- entry.offset = SDL_SwapLE32(se->offset); +- entry.size = SDL_SwapLE32(se->size); ++ entry.name = se.filename; ++ entry.offset = SDL_SwapLE32(se.offset); ++ entry.size = SDL_SwapLE32(se.size); + entry.data = mfile->data() + entry.offset; + + entries.push_back(entry); +@@ -186,24 +187,26 @@ + return; + } + const unsigned char *data = (const unsigned char *)mfile->data(); +- unsigned int numFiles = SDL_SwapLE32(*(Uint32 *)&data[0]); +- struct videoEntry *ve = (struct videoEntry *)&data[4]; ++ unsigned int numFiles = SDL_SwapLE32(read_unaligned_u32(&data[0])); ++ struct videoEntry ve; + +- for (unsigned int i=0; ifilename; +- entry.offset = SDL_SwapLE32(ve->offset); ++ entry.name = ve.filename; ++ entry.offset = SDL_SwapLE32(ve.offset); + entry.name.erase(entry.name.find_last_of('.')); + + // There is no size, so check where the next file is + if (i == numFiles - 1) { + entry.size = mfile->size() - entry.offset; + } else { +- struct videoEntry *ve_next = ve+1; ++ struct videoEntry ve_next; ++ memcpy(&ve_next, &data[4+(i+1)*sizeof(ve)], sizeof(ve)); + +- entry.size = SDL_SwapLE32(ve_next->offset) - entry.offset; ++ entry.size = SDL_SwapLE32(ve_next.offset) - entry.offset; + } + entry.data = mfile->data() + entry.offset; + diff --git a/project/jni/sdl_image/Android.mk b/project/jni/sdl_image/Android.mk index 2d31364e9..8d0409501 100644 --- a/project/jni/sdl_image/Android.mk +++ b/project/jni/sdl_image/Android.mk @@ -5,8 +5,10 @@ include $(CLEAR_VARS) LOCAL_MODULE := sdl_image LOCAL_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/../jpeg/include $(LOCAL_PATH)/../png/include $(LOCAL_PATH)/../sdl-$(SDL_VERSION)/include $(LOCAL_PATH)/include -LOCAL_CFLAGS := -O3 -DLOAD_PNG -DLOAD_JPG -DLOAD_GIF -DLOAD_BMP -DLOAD_PCX -DLOAD_LBM -DLOAD_PNM -DLOAD_TGA -# Add -DANDROID_RGB to LOCAL_CFLAGS to make SDL_image output JPEG in native RGB565 format +LOCAL_CFLAGS := -O3 \ + -DLOAD_JPG -DLOAD_PNG -DLOAD_BMP -DLOAD_GIF -DLOAD_LBM \ + -DLOAD_PCX -DLOAD_PNM -DLOAD_TGA -DLOAD_XCF -DLOAD_XPM \ + -DLOAD_XV LOCAL_CPP_EXTENSION := .cpp diff --git a/project/jni/sdl_image/IMG.c b/project/jni/sdl_image/IMG.c index b57a578dd..bde1eb8c1 100644 --- a/project/jni/sdl_image/IMG.c +++ b/project/jni/sdl_image/IMG.c @@ -90,7 +90,7 @@ int IMG_Init(int flags) } initialized |= result; - return (result); + return (initialized); } void IMG_Quit() diff --git a/project/jni/sdl_image/IMG_ImageIO.c b/project/jni/sdl_image/IMG_ImageIO.c index 00e7b66b9..2dffd7bc9 100644 --- a/project/jni/sdl_image/IMG_ImageIO.c +++ b/project/jni/sdl_image/IMG_ImageIO.c @@ -11,10 +11,17 @@ #include "SDL_image.h" -// For ImageIO framework and also LaunchServices framework (for UTIs) -#include // Used because CGDataProviderCreate became deprecated in 10.5 #include +#include + +#if (TARGET_OS_IPHONE == 1) || (TARGET_IPHONE_SIMULATOR == 1) +#import // for UTCoreTypes.h +#import +#else +// For ImageIO framework and also LaunchServices framework (for UTIs) +#include +#endif /************************************************************** ***** Begin Callback functions for block reading ************* @@ -149,7 +156,7 @@ static CGImageRef CreateCGImageFromCGImageSource(CGImageSourceRef image_source) { CGImageRef image_ref = NULL; - if(NULL == image_source) + if(NULL == image_source) { return NULL; } @@ -157,6 +164,10 @@ static CGImageRef CreateCGImageFromCGImageSource(CGImageSourceRef image_source) // Get the first item in the image source (some image formats may // contain multiple items). image_ref = CGImageSourceCreateImageAtIndex(image_source, 0, NULL); + if(NULL == image_ref) + { + IMG_SetError("CGImageSourceCreateImageAtIndex() failed"); + } return image_ref; } diff --git a/project/jni/sdl_image/IMG_bmp.c b/project/jni/sdl_image/IMG_bmp.c index 553cd4e0b..9e5b0c89e 100644 --- a/project/jni/sdl_image/IMG_bmp.c +++ b/project/jni/sdl_image/IMG_bmp.c @@ -239,7 +239,7 @@ static SDL_Surface *LoadBMP_RW (SDL_RWops *src, int freesrc) goto done; } if ( strncmp(magic, "BM", 2) != 0 ) { - SDL_SetError("File is not a Windows BMP file"); + IMG_SetError("File is not a Windows BMP file"); was_error = SDL_TRUE; goto done; } @@ -340,6 +340,10 @@ static SDL_Surface *LoadBMP_RW (SDL_RWops *src, int freesrc) switch (biBitCount) { case 15: case 16: + Rmask = SDL_ReadLE32(src); + Gmask = SDL_ReadLE32(src); + Bmask = SDL_ReadLE32(src); + break; case 32: Rmask = SDL_ReadLE32(src); Gmask = SDL_ReadLE32(src); @@ -402,7 +406,7 @@ static SDL_Surface *LoadBMP_RW (SDL_RWops *src, int freesrc) } if ((biCompression == BI_RLE4) || (biCompression == BI_RLE8)) { was_error = readRlePixels(surface, src, biCompression == BI_RLE8); - if (was_error) SDL_SetError("Error reading from BMP"); + if (was_error) IMG_SetError("Error reading from BMP"); goto done; } top = (Uint8 *)surface->pixels; @@ -435,7 +439,7 @@ static SDL_Surface *LoadBMP_RW (SDL_RWops *src, int freesrc) for ( i=0; iw; ++i ) { if ( i%(8/ExpandBMP) == 0 ) { if ( !SDL_RWread(src, &pixel, 1, 1) ) { - SDL_SetError( + IMG_SetError( "Error reading from BMP"); was_error = SDL_TRUE; goto done; @@ -564,7 +568,7 @@ LoadICOCUR_RW(SDL_RWops * src, int type, int freesrc) bfType = SDL_ReadLE16(src); bfCount = SDL_ReadLE16(src); if ((bfReserved != 0) || (bfType != type) || (bfCount == 0)) { - SDL_SetError("File is not a Windows %s file", type == 1 ? "ICO" : "CUR"); + IMG_SetError("File is not a Windows %s file", type == 1 ? "ICO" : "CUR"); was_error = SDL_TRUE; goto done; } @@ -617,7 +621,7 @@ LoadICOCUR_RW(SDL_RWops * src, int type, int freesrc) biClrUsed = SDL_ReadLE32(src); biClrImportant = SDL_ReadLE32(src); } else { - SDL_SetError("Unsupported ICO bitmap format"); + IMG_SetError("Unsupported ICO bitmap format"); was_error = SDL_TRUE; goto done; } @@ -648,13 +652,13 @@ LoadICOCUR_RW(SDL_RWops * src, int type, int freesrc) ExpandBMP = 0; break; default: - SDL_SetError("ICO file with unsupported bit count"); + IMG_SetError("ICO file with unsupported bit count"); was_error = SDL_TRUE; goto done; } break; default: - SDL_SetError("Compressed ICO files not supported"); + IMG_SetError("Compressed ICO files not supported"); was_error = SDL_TRUE; goto done; } @@ -713,7 +717,7 @@ LoadICOCUR_RW(SDL_RWops * src, int type, int freesrc) for (i = 0; i < surface->w; ++i) { if (i % (8 / ExpandBMP) == 0) { if (!SDL_RWread(src, &pixel, 1, 1)) { - SDL_SetError("Error reading from ICO"); + IMG_SetError("Error reading from ICO"); was_error = SDL_TRUE; goto done; } @@ -754,7 +758,7 @@ LoadICOCUR_RW(SDL_RWops * src, int type, int freesrc) for (i = 0; i < surface->w; ++i) { if (i % (8 / ExpandBMP) == 0) { if (!SDL_RWread(src, &pixel, 1, 1)) { - SDL_SetError("Error reading from ICO"); + IMG_SetError("Error reading from ICO"); was_error = SDL_TRUE; goto done; } diff --git a/project/jni/sdl_image/IMG_jpg.c b/project/jni/sdl_image/IMG_jpg.c index 8410ec4dd..9e0fc892a 100644 --- a/project/jni/sdl_image/IMG_jpg.c +++ b/project/jni/sdl_image/IMG_jpg.c @@ -34,6 +34,12 @@ #include +#if JPEG_LIB_VERSION >= 80 + typedef JPEG_boolean boolean; + #define TRUE JPEG_TRUE + #define FALSE JPEG_FALSE +#endif + /* Define this for fast loading and not as good image quality */ /*#define FAST_JPEG*/ @@ -420,13 +426,7 @@ SDL_Surface *IMG_LoadJPG_RW(SDL_RWops *src) #endif } else { /* Set 24-bit RGB output */ -#ifdef ANDROID_RGB - const SDL_PixelFormat *fmt = SDL_GetVideoInfo()->vfmt; - cinfo.out_color_space = (fmt->BitsPerPixel==16) ? JCS_RGB_565 : JCS_RGB; -#else cinfo.out_color_space = JCS_RGB; -#endif - cinfo.quantize_colors = FALSE; #ifdef FAST_JPEG cinfo.scale_num = 1; @@ -437,11 +437,6 @@ SDL_Surface *IMG_LoadJPG_RW(SDL_RWops *src) lib.jpeg_calc_output_dimensions(&cinfo); /* Allocate an output surface to hold the image */ -#ifdef ANDROID_RGB - surface = SDL_AllocSurface(SDL_SWSURFACE, cinfo.output_width, cinfo.output_height, - (fmt->BitsPerPixel==16) ? 16 : 24, - fmt->Rmask, fmt->Gmask, fmt->Bmask, 0); -#else surface = SDL_AllocSurface(SDL_SWSURFACE, cinfo.output_width, cinfo.output_height, 24, #if SDL_BYTEORDER == SDL_LIL_ENDIAN @@ -450,7 +445,6 @@ SDL_Surface *IMG_LoadJPG_RW(SDL_RWops *src) 0xFF0000, 0x00FF00, 0x0000FF, #endif 0); -#endif } if ( surface == NULL ) { diff --git a/project/jni/sdl_image/IMG_lbm.c b/project/jni/sdl_image/IMG_lbm.c index cdfc85ff6..f3d66ab76 100644 --- a/project/jni/sdl_image/IMG_lbm.c +++ b/project/jni/sdl_image/IMG_lbm.c @@ -55,7 +55,7 @@ typedef struct Uint8 pad1; /* dummy value, for padding */ Uint16 tcolor; /* transparent color */ Uint8 xAspect, /* pixel aspect ratio */ - yAspect; + yAspect; Sint16 Lpage; /* width of the screen in pixels */ Sint16 Hpage; /* height of the screen in pixels */ } BMHD; @@ -89,7 +89,7 @@ SDL_Surface *IMG_LoadLBM_RW( SDL_RWops *src ) SDL_Surface *Image; Uint8 id[4], pbm, colormap[MAXCOLORS*3], *MiniBuf, *ptr, count, color, msk; Uint32 size, bytesloaded, nbcolors; - Uint32 i, j, bytesperline, nbplanes, plane, h; + Uint32 i, j, bytesperline, nbplanes, stencil, plane, h; Uint32 remainingbytes; Uint32 width; BMHD bmhd; @@ -238,12 +238,13 @@ SDL_Surface *IMG_LoadLBM_RW( SDL_RWops *src ) nbplanes = 1; } - if ( bmhd.mask & 1 ) ++nbplanes; /* There is a mask ( 'stencil' ) */ + stencil = (bmhd.mask & 1); /* There is a mask ( 'stencil' ) */ /* Allocate memory for a temporary buffer ( used for decompression/deinterleaving ) */ - if ( ( MiniBuf = (void *)malloc( bytesperline * nbplanes ) ) == NULL ) + MiniBuf = (void *)malloc( bytesperline * (nbplanes + stencil) ); + if ( MiniBuf == NULL ) { error="no enough memory for temporary buffer"; goto done; @@ -260,7 +261,8 @@ SDL_Surface *IMG_LoadLBM_RW( SDL_RWops *src ) /* There is no palette in 24 bits ILBM file */ if ( nbcolors>0 && flagHAM==0 ) { - int nbrcolorsfinal = 1 << nbplanes; + /* FIXME: Should this include the stencil? See comment below */ + int nbrcolorsfinal = 1 << (nbplanes + stencil); ptr = &colormap[0]; for ( i=0; i remainingbytes ) || !SDL_RWread( src, &color, 1, 1 ) ) { - error="error reading BODY chunk"; + error="error reading BODY chunk"; goto done; } memset( ptr, color, count ); @@ -384,7 +386,7 @@ SDL_Surface *IMG_LoadLBM_RW( SDL_RWops *src ) { memset( ptr, 0, 8 ); - for ( plane=0; plane < nbplanes; plane++ ) + for ( plane=0; plane < (nbplanes + stencil); plane++ ) { color = *( MiniBuf + i + ( plane * bytesperline ) ); msk = 0x80; diff --git a/project/jni/sdl_image/IMG_png.c b/project/jni/sdl_image/IMG_png.c index a79fb9c9b..99d5b5718 100644 --- a/project/jni/sdl_image/IMG_png.c +++ b/project/jni/sdl_image/IMG_png.c @@ -71,6 +71,10 @@ #endif #include +/* Check for the older version of libpng */ +#if (PNG_LIBPNG_VER_MAJOR == 1) && (PNG_LIBPNG_VER_MINOR < 4) +#define LIBPNG_VERSION_12 +#endif static struct { int loaded; @@ -80,6 +84,8 @@ static struct { void (*png_destroy_read_struct) (png_structpp png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr); png_uint_32 (*png_get_IHDR) (png_structp png_ptr, png_infop info_ptr, png_uint_32 *width, png_uint_32 *height, int *bit_depth, int *color_type, int *interlace_method, int *compression_method, int *filter_method); png_voidp (*png_get_io_ptr) (png_structp png_ptr); + png_byte (*png_get_channels) (png_structp png_ptr, png_infop info_ptr); + png_uint_32 (*png_get_PLTE) (png_structp png_ptr, png_infop info_ptr, png_colorp *palette, int *num_palette); png_uint_32 (*png_get_tRNS) (png_structp png_ptr, png_infop info_ptr, png_bytep *trans, int *num_trans, png_color_16p *trans_values); png_uint_32 (*png_get_valid) (png_structp png_ptr, png_infop info_ptr, png_uint_32 flag); void (*png_read_image) (png_structp png_ptr, png_bytepp image); @@ -91,6 +97,9 @@ static struct { void (*png_set_read_fn) (png_structp png_ptr, png_voidp io_ptr, png_rw_ptr read_data_fn); void (*png_set_strip_16) (png_structp png_ptr); int (*png_sig_cmp) (png_bytep sig, png_size_t start, png_size_t num_to_check); +#ifndef LIBPNG_VERSION_12 + jmp_buf* (*png_set_longjmp_fn) (png_structp, png_longjmp_ptr, size_t); +#endif } lib; #ifdef LOAD_PNG_DYNAMIC @@ -129,6 +138,13 @@ int IMG_InitPNG() SDL_UnloadObject(lib.handle); return -1; } + lib.png_get_channels = + (png_byte (*) (png_structp, png_infop)) + SDL_LoadFunction(lib.handle, "png_get_channels"); + if ( lib.png_get_channels == NULL ) { + SDL_UnloadObject(lib.handle); + return -1; + } lib.png_get_io_ptr = (png_voidp (*) (png_structp)) SDL_LoadFunction(lib.handle, "png_get_io_ptr"); @@ -136,6 +152,13 @@ int IMG_InitPNG() SDL_UnloadObject(lib.handle); return -1; } + lib.png_get_PLTE = + (png_uint_32 (*) (png_structp, png_infop, png_colorp *, int *)) + SDL_LoadFunction(lib.handle, "png_get_PLTE"); + if ( lib.png_get_PLTE == NULL ) { + SDL_UnloadObject(lib.handle); + return -1; + } lib.png_get_tRNS = (png_uint_32 (*) (png_structp, png_infop, png_bytep *, int *, png_color_16p *)) SDL_LoadFunction(lib.handle, "png_get_tRNS"); @@ -213,6 +236,15 @@ int IMG_InitPNG() SDL_UnloadObject(lib.handle); return -1; } +#ifndef LIBPNG_VERSION_12 + lib.png_set_longjmp_fn = + (jmp_buf * (*) (png_structp, png_longjmp_ptr, size_t)) + SDL_LoadFunction(lib.handle, "png_set_longjmp_fn"); + if ( lib.png_set_longjmp_fn == NULL ) { + SDL_UnloadObject(lib.handle); + return -1; + } +#endif } ++lib.loaded; @@ -236,7 +268,9 @@ int IMG_InitPNG() lib.png_create_read_struct = png_create_read_struct; lib.png_destroy_read_struct = png_destroy_read_struct; lib.png_get_IHDR = png_get_IHDR; + lib.png_get_channels = png_get_channels; lib.png_get_io_ptr = png_get_io_ptr; + lib.png_get_PLTE = png_get_PLTE; lib.png_get_tRNS = png_get_tRNS; lib.png_get_valid = png_get_valid; lib.png_read_image = png_read_image; @@ -248,6 +282,9 @@ int IMG_InitPNG() lib.png_set_read_fn = png_set_read_fn; lib.png_set_strip_16 = png_set_strip_16; lib.png_sig_cmp = png_sig_cmp; +#ifndef LIBPNG_VERSION_12 + lib.png_set_longjmp_fn = png_set_longjmp_fn; +#endif } ++lib.loaded; @@ -347,7 +384,12 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src) * the normal method of doing things with libpng). REQUIRED unless you * set up your own error handlers in png_create_read_struct() earlier. */ - if ( setjmp(png_ptr->jmpbuf) ) { +#ifndef LIBPNG_VERSION_12 + if ( setjmp(*lib.png_set_longjmp_fn(png_ptr, longjmp, sizeof (jmp_buf))) ) +#else + if ( setjmp(png_ptr->jmpbuf) ) +#endif + { error = "Error reading the PNG file."; goto done; } @@ -416,9 +458,9 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src) Rmask = 0x000000FF; Gmask = 0x0000FF00; Bmask = 0x00FF0000; - Amask = (info_ptr->channels == 4) ? 0xFF000000 : 0; + Amask = (lib.png_get_channels(png_ptr, info_ptr) == 4) ? 0xFF000000 : 0; } else { - int s = (info_ptr->channels == 4) ? 0 : 8; + int s = (lib.png_get_channels(png_ptr, info_ptr) == 4) ? 0 : 8; Rmask = 0xFF000000 >> s; Gmask = 0x00FF0000 >> s; Bmask = 0x0000FF00 >> s; @@ -426,7 +468,7 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src) } } surface = SDL_AllocSurface(SDL_SWSURFACE, width, height, - bit_depth*info_ptr->channels, Rmask,Gmask,Bmask,Amask); + bit_depth*lib.png_get_channels(png_ptr, info_ptr), Rmask,Gmask,Bmask,Amask); if ( surface == NULL ) { error = "Out of memory"; goto done; @@ -467,6 +509,9 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src) /* Load the palette, if any */ palette = surface->format->palette; if ( palette ) { + int png_num_palette; + png_colorp png_palette; + lib.png_get_PLTE(png_ptr, info_ptr, &png_palette, &png_num_palette); if(color_type == PNG_COLOR_TYPE_GRAY) { palette->ncolors = 256; for(i = 0; i < 256; i++) { @@ -474,12 +519,12 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src) palette->colors[i].g = i; palette->colors[i].b = i; } - } else if (info_ptr->num_palette > 0 ) { - palette->ncolors = info_ptr->num_palette; - for( i=0; inum_palette; ++i ) { - palette->colors[i].b = info_ptr->palette[i].blue; - palette->colors[i].g = info_ptr->palette[i].green; - palette->colors[i].r = info_ptr->palette[i].red; + } else if (png_num_palette > 0 ) { + palette->ncolors = png_num_palette; + for( i=0; icolors[i].b = png_palette[i].blue; + palette->colors[i].g = png_palette[i].green; + palette->colors[i].r = png_palette[i].red; } } } diff --git a/project/jni/sdl_image/IMG_xpm.c b/project/jni/sdl_image/IMG_xpm.c index 458cadf44..0a58c5be7 100644 --- a/project/jni/sdl_image/IMG_xpm.c +++ b/project/jni/sdl_image/IMG_xpm.c @@ -123,8 +123,10 @@ static struct color_hash *create_colorhash(int maxnum) return NULL; memset(hash->table, 0, bytes); hash->entries = malloc(maxnum * sizeof(struct hash_entry)); - if(!hash->entries) + if(!hash->entries) { + free(hash->table); return NULL; + } hash->next_free = hash->entries; return hash; } @@ -259,11 +261,13 @@ static char *get_next_line(char ***lines, SDL_RWops *src, int len) len += 4; /* "\",\n\0" */ if(len > buflen){ buflen = len; - linebuf = realloc(linebuf, buflen); - if(!linebuf) { + char *linebufnew = realloc(linebuf, buflen); + if(!linebufnew) { + free(linebuf); error = "Out of memory"; return NULL; } + linebuf = linebufnew; } if(SDL_RWread(src, linebuf, len - 1, 1) <= 0) { error = "Premature end of data"; @@ -277,11 +281,13 @@ static char *get_next_line(char ***lines, SDL_RWops *src, int len) if(buflen == 0) buflen = 16; buflen *= 2; - linebuf = realloc(linebuf, buflen); - if(!linebuf) { + char *linebufnew = realloc(linebuf, buflen); + if(!linebufnew) { + free(linebuf); error = "Out of memory"; return NULL; } + linebuf = linebufnew; } if(SDL_RWread(src, linebuf + n, 1, 1) <= 0) { error = "Premature end of data"; diff --git a/project/jni/sdl_image/include/SDL_image.h b/project/jni/sdl_image/include/SDL_image.h index de2ae18e3..e6078d7b2 100644 --- a/project/jni/sdl_image/include/SDL_image.h +++ b/project/jni/sdl_image/include/SDL_image.h @@ -38,7 +38,7 @@ extern "C" { */ #define SDL_IMAGE_MAJOR_VERSION 1 #define SDL_IMAGE_MINOR_VERSION 2 -#define SDL_IMAGE_PATCHLEVEL 10 +#define SDL_IMAGE_PATCHLEVEL 11 /* This macro can be used to fill a version structure with the compile-time * version of the SDL_image library. diff --git a/project/jni/sdl_mixer/Makefile b/project/jni/sdl_mixer/Makefile deleted file mode 100644 index 829c7aeb5..000000000 --- a/project/jni/sdl_mixer/Makefile +++ /dev/null @@ -1,164 +0,0 @@ -# Makefile to build and install the SDL_mixer library - -top_builddir = . -srcdir = . -objects = build -prefix = /usr/local -exec_prefix = ${prefix} -bindir = $(DESTDIR)${exec_prefix}/bin -libdir = $(DESTDIR)${exec_prefix}/lib -includedir = $(DESTDIR)${prefix}/include -datarootdir = $(DESTDIR)${prefix}/share -datadir = ${datarootdir} -mandir = ${datarootdir}/man -auxdir = ./build-scripts -distpath = $(srcdir)/.. -distdir = SDL_mixer-1.2.11 -distfile = $(distdir).tar.gz - - -EXE = -SHELL = /bin/bash -CC = gcc -CFLAGS = -g -O2 -EXTRA_CFLAGS = -D_GNU_SOURCE=1 -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -DWAV_MUSIC -DMP3_MUSIC -I/usr/include/smpeg -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DMP3_DYNAMIC=\"libsmpeg-0.4.so.0\" -LDFLAGS = -EXTRA_LDFLAGS = -lSDL -LIBTOOL = $(SHELL) $(top_builddir)/libtool -INSTALL = /usr/bin/install -c -AR = ar -RANLIB = ranlib -WINDRES = -SDL_CFLAGS = -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -SDL_LIBS = -lSDL - -TARGET = libSDL_mixer.la -OBJECTS = $(objects)/effect_position.lo $(objects)/effect_stereoreverse.lo $(objects)/effects_internal.lo $(objects)/load_aiff.lo $(objects)/load_voc.lo $(objects)/mixer.lo $(objects)/music.lo $(objects)/wavestream.lo $(objects)/dynamic_mp3.lo -VERSION_OBJECTS = -PLAYWAVE_OBJECTS = $(objects)/playwave.lo -PLAYMUS_OBJECTS = $(objects)/playmus.lo - -DIST = CHANGES COPYING CWProjects.sea.bin MPWmake.sea.bin Makefile.in SDL_mixer.pc.in README SDL_mixer.h SDL_mixer.qpg.in SDL_mixer.spec SDL_mixer.spec.in VisualC.zip Watcom-OS2.zip Xcode.tar.gz acinclude autogen.sh build-scripts configure configure.in dynamic_flac.c dynamic_flac.h dynamic_mod.c dynamic_mod.h dynamic_mp3.c dynamic_mp3.h dynamic_ogg.c dynamic_ogg.h effect_position.c effect_stereoreverse.c effects_internal.c effects_internal.h gcc-fat.sh libmikmod-3.1.12.zip load_aiff.c load_aiff.h load_flac.c load_flac.h load_ogg.c load_ogg.h load_voc.c load_voc.h mixer.c music.c music_cmd.c music_cmd.h music_flac.c music_flac.h music_mad.c music_mad.h music_mod.c music_mod.h music_ogg.c music_ogg.h native_midi native_midi_gpl playmus.c playwave.c timidity wavestream.c wavestream.h version.rc - -LT_AGE = 10 -LT_CURRENT = 10 -LT_RELEASE = 1.2 -LT_REVISION = 1 -LT_LDFLAGS = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) - -all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/playwave$(EXE) $(objects)/playmus$(EXE) - -$(srcdir)/configure: $(srcdir)/configure.in - @echo "Warning, configure.in is out of date" - #(cd $(srcdir) && sh autogen.sh && sh configure) - @sleep 3 - -Makefile: $(srcdir)/Makefile.in - $(SHELL) config.status $@ - -$(objects): - $(SHELL) $(auxdir)/mkinstalldirs $@ - -.PHONY: all install install-hdrs install-lib install-bin uninstall uninstall-hdrs uninstall-lib uninstall-bin clean distclean dist - --include $(OBJECTS:.lo=.d) - -$(objects)/effect_position.lo: ./effect_position.c - $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ -$(objects)/effect_stereoreverse.lo: ./effect_stereoreverse.c - $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ -$(objects)/effects_internal.lo: ./effects_internal.c - $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ -$(objects)/load_aiff.lo: ./load_aiff.c - $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ -$(objects)/load_voc.lo: ./load_voc.c - $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ -$(objects)/mixer.lo: ./mixer.c - $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ -$(objects)/music.lo: ./music.c - $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ -$(objects)/wavestream.lo: ./wavestream.c - $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ -$(objects)/dynamic_mp3.lo: ./dynamic_mp3.c - $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ - - --include $(PLAYWAVE_OBJECTS:.lo=.d) - -$(objects)/playwave.lo: ./playwave.c - $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ - --include $(PLAYMUS_OBJECTS:.lo=.d) - -$(objects)/playmus.lo: ./playmus.c - $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MMD -MT $@ -c $< -o $@ - -$(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS) - $(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) - -$(objects)/playwave$(EXE): $(objects)/playwave.lo $(objects)/$(TARGET) - $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playwave.lo $(SDL_CFLAGS) $(SDL_LIBS) $(objects)/$(TARGET) - -$(objects)/playmus$(EXE): $(objects)/playmus.lo $(objects)/$(TARGET) - $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playmus.lo $(SDL_CFLAGS) $(SDL_LIBS) $(objects)/$(TARGET) - -install: all install-hdrs install-lib #install-bin -install-hdrs: - $(SHELL) $(auxdir)/mkinstalldirs $(includedir)/SDL - for src in $(srcdir)/SDL_mixer.h; do \ - file=`echo $$src | sed -e 's|^.*/||'`; \ - $(INSTALL) -m 644 $$src $(includedir)/SDL/$$file; \ - done - $(SHELL) $(auxdir)/mkinstalldirs $(libdir)/pkgconfig - $(INSTALL) -m 644 SDL_mixer.pc $(libdir)/pkgconfig/ -install-lib: $(objects) $(objects)/$(TARGET) - $(SHELL) $(auxdir)/mkinstalldirs $(libdir) - $(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(libdir)/$(TARGET) -install-bin: - $(SHELL) $(auxdir)/mkinstalldirs $(bindir) - $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(objects)/playwave$(EXE) $(bindir)/playwave$(EXE) - $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(objects)/playmus$(EXE) $(bindir)/playmus$(EXE) - -uninstall: uninstall-hdrs uninstall-lib uninstall-bin -uninstall-hdrs: - for src in $(srcdir)/SDL_mixer.h; do \ - file=`echo $$src | sed -e 's|^.*/||'`; \ - rm -f $(includedir)/SDL/$$file; \ - done - -rmdir $(includedir)/SDL - rm -f $(libdir)/pkgconfig/SDL_mixer.pc - -rmdir $(libdir)/pkgconfig -uninstall-lib: - $(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(TARGET) -uninstall-bin: - rm -f $(bindir)/playwave$(EXE) - rm -f $(bindir)/playmus$(EXE) - -clean: - rm -rf $(objects) - -distclean: clean - rm -f Makefile - rm -f SDL_mixer.qpg - rm -f config.status config.cache config.log libtool - rm -f SDL_mixer.pc - rm -rf $(srcdir)/autom4te* - find $(srcdir) \( \ - -name '*~' -o \ - -name '*.bak' -o \ - -name '*.old' -o \ - -name '*.rej' -o \ - -name '*.orig' -o \ - -name '.#*' \) \ - -exec rm -f {} \; - -dist $(distfile): - $(SHELL) $(auxdir)/mkinstalldirs $(distdir) - tar cf - $(DIST) | (cd $(distdir); tar xf -) - rm -rf `find $(distdir) -name .svn` - rm -f `find $(distdir) -name '.#*'` - tar cvf - $(distdir) | gzip --best >$(distfile) - rm -rf $(distdir) - -rpm: $(distfile) - rpmbuild -ta $? diff --git a/project/jni/sdl_mixer/Makefile.in b/project/jni/sdl_mixer/Makefile.in deleted file mode 100644 index 76fdd3c84..000000000 --- a/project/jni/sdl_mixer/Makefile.in +++ /dev/null @@ -1,142 +0,0 @@ -# Makefile to build and install the SDL_mixer library - -top_builddir = . -srcdir = @srcdir@ -objects = build -prefix = @prefix@ -exec_prefix = @exec_prefix@ -bindir = $(DESTDIR)@bindir@ -libdir = $(DESTDIR)@libdir@ -includedir = $(DESTDIR)@includedir@ -datarootdir = $(DESTDIR)@datarootdir@ -datadir = @datadir@ -mandir = @mandir@ -auxdir = @ac_aux_dir@ -distpath = $(srcdir)/.. -distdir = SDL_mixer-@VERSION@ -distfile = $(distdir).tar.gz - -@SET_MAKE@ -EXE = @EXE@ -SHELL = @SHELL@ -CC = @CC@ -CFLAGS = @BUILD_CFLAGS@ -EXTRA_CFLAGS = @EXTRA_CFLAGS@ -LDFLAGS = @BUILD_LDFLAGS@ -EXTRA_LDFLAGS = @EXTRA_LDFLAGS@ -LIBTOOL = @LIBTOOL@ -INSTALL = @INSTALL@ -AR = @AR@ -RANLIB = @RANLIB@ -WINDRES = @WINDRES@ -SDL_CFLAGS = @SDL_CFLAGS@ -SDL_LIBS = @SDL_LIBS@ - -TARGET = libSDL_mixer.la -OBJECTS = @OBJECTS@ -VERSION_OBJECTS = @VERSION_OBJECTS@ -PLAYWAVE_OBJECTS = @PLAYWAVE_OBJECTS@ -PLAYMUS_OBJECTS = @PLAYMUS_OBJECTS@ - -DIST = CHANGES COPYING CWProjects.sea.bin MPWmake.sea.bin Makefile.in SDL_mixer.pc.in README SDL_mixer.h SDL_mixer.qpg.in SDL_mixer.spec SDL_mixer.spec.in VisualC.zip Watcom-OS2.zip Xcode.tar.gz acinclude autogen.sh build-scripts configure configure.in dynamic_flac.c dynamic_flac.h dynamic_mod.c dynamic_mod.h dynamic_mp3.c dynamic_mp3.h dynamic_ogg.c dynamic_ogg.h effect_position.c effect_stereoreverse.c effects_internal.c effects_internal.h gcc-fat.sh libmikmod-3.1.12.zip load_aiff.c load_aiff.h load_flac.c load_flac.h load_ogg.c load_ogg.h load_voc.c load_voc.h mixer.c music.c music_cmd.c music_cmd.h music_flac.c music_flac.h music_mad.c music_mad.h music_mod.c music_mod.h music_ogg.c music_ogg.h native_midi native_midi_gpl playmus.c playwave.c timidity wavestream.c wavestream.h version.rc - -LT_AGE = @LT_AGE@ -LT_CURRENT = @LT_CURRENT@ -LT_RELEASE = @LT_RELEASE@ -LT_REVISION = @LT_REVISION@ -LT_LDFLAGS = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) - -all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/playwave$(EXE) $(objects)/playmus$(EXE) - -$(srcdir)/configure: $(srcdir)/configure.in - @echo "Warning, configure.in is out of date" - #(cd $(srcdir) && sh autogen.sh && sh configure) - @sleep 3 - -Makefile: $(srcdir)/Makefile.in - $(SHELL) config.status $@ - -$(objects): - $(SHELL) $(auxdir)/mkinstalldirs $@ - -.PHONY: all install install-hdrs install-lib install-bin uninstall uninstall-hdrs uninstall-lib uninstall-bin clean distclean dist - --include $(OBJECTS:.lo=.d) -@DEPENDS@ -@VERSION_DEPENDS@ - --include $(PLAYWAVE_OBJECTS:.lo=.d) -@PLAYWAVE_DEPENDS@ - --include $(PLAYMUS_OBJECTS:.lo=.d) -@PLAYMUS_DEPENDS@ - -$(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS) - $(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) - -$(objects)/playwave$(EXE): $(objects)/playwave.lo $(objects)/$(TARGET) - $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playwave.lo $(SDL_CFLAGS) $(SDL_LIBS) $(objects)/$(TARGET) - -$(objects)/playmus$(EXE): $(objects)/playmus.lo $(objects)/$(TARGET) - $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playmus.lo $(SDL_CFLAGS) $(SDL_LIBS) $(objects)/$(TARGET) - -install: all install-hdrs install-lib #install-bin -install-hdrs: - $(SHELL) $(auxdir)/mkinstalldirs $(includedir)/SDL - for src in $(srcdir)/SDL_mixer.h; do \ - file=`echo $$src | sed -e 's|^.*/||'`; \ - $(INSTALL) -m 644 $$src $(includedir)/SDL/$$file; \ - done - $(SHELL) $(auxdir)/mkinstalldirs $(libdir)/pkgconfig - $(INSTALL) -m 644 SDL_mixer.pc $(libdir)/pkgconfig/ -install-lib: $(objects) $(objects)/$(TARGET) - $(SHELL) $(auxdir)/mkinstalldirs $(libdir) - $(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(libdir)/$(TARGET) -install-bin: - $(SHELL) $(auxdir)/mkinstalldirs $(bindir) - $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(objects)/playwave$(EXE) $(bindir)/playwave$(EXE) - $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(objects)/playmus$(EXE) $(bindir)/playmus$(EXE) - -uninstall: uninstall-hdrs uninstall-lib uninstall-bin -uninstall-hdrs: - for src in $(srcdir)/SDL_mixer.h; do \ - file=`echo $$src | sed -e 's|^.*/||'`; \ - rm -f $(includedir)/SDL/$$file; \ - done - -rmdir $(includedir)/SDL - rm -f $(libdir)/pkgconfig/SDL_mixer.pc - -rmdir $(libdir)/pkgconfig -uninstall-lib: - $(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(TARGET) -uninstall-bin: - rm -f $(bindir)/playwave$(EXE) - rm -f $(bindir)/playmus$(EXE) - -clean: - rm -rf $(objects) - -distclean: clean - rm -f Makefile - rm -f SDL_mixer.qpg - rm -f config.status config.cache config.log libtool - rm -f SDL_mixer.pc - rm -rf $(srcdir)/autom4te* - find $(srcdir) \( \ - -name '*~' -o \ - -name '*.bak' -o \ - -name '*.old' -o \ - -name '*.rej' -o \ - -name '*.orig' -o \ - -name '.#*' \) \ - -exec rm -f {} \; - -dist $(distfile): - $(SHELL) $(auxdir)/mkinstalldirs $(distdir) - tar cf - $(DIST) | (cd $(distdir); tar xf -) - rm -rf `find $(distdir) -name .svn` - rm -f `find $(distdir) -name '.#*'` - tar cvf - $(distdir) | gzip --best >$(distfile) - rm -rf $(distdir) - -rpm: $(distfile) - rpmbuild -ta $? diff --git a/project/jni/sdl_mixer/SDL_mixer.pc b/project/jni/sdl_mixer/SDL_mixer.pc deleted file mode 100644 index 35ea938f4..000000000 --- a/project/jni/sdl_mixer/SDL_mixer.pc +++ /dev/null @@ -1,12 +0,0 @@ -prefix=/usr/local -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include - -Name: SDL_mixer -Description: mixer library for Simple DirectMedia Layer -Version: 1.2.11 -Requires: sdl >= 1.2.10 -Libs: -L${libdir} -lSDL_mixer -Cflags: -I${includedir}/SDL - diff --git a/project/jni/sdl_mixer/SDL_mixer.pc.in b/project/jni/sdl_mixer/SDL_mixer.pc.in deleted file mode 100644 index 1c4965d8e..000000000 --- a/project/jni/sdl_mixer/SDL_mixer.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: SDL_mixer -Description: mixer library for Simple DirectMedia Layer -Version: @VERSION@ -Requires: sdl >= @SDL_VERSION@ -Libs: -L${libdir} -lSDL_mixer -Cflags: -I${includedir}/SDL - diff --git a/project/jni/sdl_mixer/SDL_mixer.qpg b/project/jni/sdl_mixer/SDL_mixer.qpg deleted file mode 100644 index 54ce5a1de..000000000 --- a/project/jni/sdl_mixer/SDL_mixer.qpg +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - - QNX.ORG.RU Community - - - QNX.ORG.RU Team - Mike Gorchak - mike@malva.ua - - - - - - - - - - - - - - - - - - - - - Library - SDL_mixer - 1 - http://qnx.org.ru/repository - 2.0 - - - - SDL_mixer - SDL_mixer - slouken@libsdl.org - public - public - http://www.libsdl.org - - slouken@libsdl.org - Sam Lantinga, Stephane Peter and Ryan Gordon - http://www.libsdl.org - - slouken@libsdl.org - - - SDL_mixer - is simple multi-channel audio mixer. The mixer can currently load Microsoft WAVE files and Creative Labs VOC files as audio samples, and can load MIDI files via Timidity and the various music formats via MikMod. - SDL_mixer - is simple multi-channel audio mixer. The mixer can currently load Microsoft WAVE files and Creative Labs VOC files as audio samples, and can load MIDI files via Timidity and the following music formats via MikMod: .MOD .S3M .IT .XM. - http://www.libsdl.org/projects/SDL_mixer - - - - - 1.2.11 - High - Stable - - - 1 - - GNU Lesser General Public License - - - - Software Development/Libraries and Extensions/C Libraries - SDL, music, sound, WAV, VOC, MIDI, MID, MOD, S3M, XM, IT - qnx6 - none - Console - Developer - User - - repdata://LicenseUrl/COPYING - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/project/jni/sdl_mixer/SDL_mixer.qpg.in b/project/jni/sdl_mixer/SDL_mixer.qpg.in deleted file mode 100644 index 97eec21ee..000000000 --- a/project/jni/sdl_mixer/SDL_mixer.qpg.in +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - - QNX.ORG.RU Community - - - QNX.ORG.RU Team - Mike Gorchak - mike@malva.ua - - - - - - - - - - - - - - - - - - - - - Library - SDL_mixer - 1 - http://qnx.org.ru/repository - 2.0 - - - - SDL_mixer - SDL_mixer - slouken@libsdl.org - public - public - http://www.libsdl.org - - slouken@libsdl.org - Sam Lantinga, Stephane Peter and Ryan Gordon - http://www.libsdl.org - - slouken@libsdl.org - - - SDL_mixer - is simple multi-channel audio mixer. The mixer can currently load Microsoft WAVE files and Creative Labs VOC files as audio samples, and can load MIDI files via Timidity and the various music formats via MikMod. - SDL_mixer - is simple multi-channel audio mixer. The mixer can currently load Microsoft WAVE files and Creative Labs VOC files as audio samples, and can load MIDI files via Timidity and the following music formats via MikMod: .MOD .S3M .IT .XM. - http://www.libsdl.org/projects/SDL_mixer - - - - - @VERSION@ - High - Stable - - - 1 - - GNU Lesser General Public License - - - - Software Development/Libraries and Extensions/C Libraries - SDL, music, sound, WAV, VOC, MIDI, MID, MOD, S3M, XM, IT - qnx6 - none - Console - Developer - User - - repdata://LicenseUrl/COPYING - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/project/jni/sdl_mixer/SDL_mixer.spec b/project/jni/sdl_mixer/SDL_mixer.spec deleted file mode 100644 index 3a4628718..000000000 --- a/project/jni/sdl_mixer/SDL_mixer.spec +++ /dev/null @@ -1,64 +0,0 @@ -%define name SDL_mixer -%define version 1.2.11 -%define release 1 - -Summary: Simple DirectMedia Layer - Sample Mixer Library -Name: %{name} -Version: %{version} -Release: %{release} -Source0: %{name}-%{version}.tar.gz -License: LGPL -Group: System Environment/Libraries -BuildRoot: /var/tmp/%{name}-buildroot -Prefix: %{_prefix} - -%description -Due to popular demand, here is a simple multi-channel audio mixer. -It supports 4 channels of 16 bit stereo audio, plus a single channel -of music, mixed by the popular MikMod MOD, Timidity MIDI, Ogg Vorbis, -Tremor, SMPEG MP3, and libmad MP3 libraries. - -%package devel -Summary: Libraries, includes and more to develop SDL applications. -Group: Development/Libraries -Requires: %{name} - -%description devel -Due to popular demand, here is a simple multi-channel audio mixer. -It supports 4 channels of 16 bit stereo audio, plus a single channel -of music, mixed by the popular MikMod MOD, Timidity MIDI, Ogg Vorbis, -Tremor, SMPEG MP3, and libmad MP3 libraries. - -%prep -%setup - -%build -CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} -make - -%install -rm -rf $RPM_BUILD_ROOT -make install prefix=$RPM_BUILD_ROOT/%{prefix} - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root) -%doc README CHANGES COPYING -%{prefix}/lib/lib*.so.* - -%files devel -%defattr(-,root,root) -%{prefix}/lib/lib*.a -%{prefix}/lib/lib*.la -%{prefix}/lib/lib*.so -%{prefix}/include/SDL/ -%{prefix}/lib/pkgconfig/*.pc - -%changelog -* Wed Jan 19 2000 Sam Lantinga -- converted to get package information from configure -* Sun Jan 16 2000 Hakan Tandogan -- initial spec file - diff --git a/project/jni/sdl_mixer/SDL_mixer.spec.in b/project/jni/sdl_mixer/SDL_mixer.spec.in deleted file mode 100644 index 0beaf750a..000000000 --- a/project/jni/sdl_mixer/SDL_mixer.spec.in +++ /dev/null @@ -1,64 +0,0 @@ -%define name SDL_mixer -%define version @VERSION@ -%define release 1 - -Summary: Simple DirectMedia Layer - Sample Mixer Library -Name: %{name} -Version: %{version} -Release: %{release} -Source0: %{name}-%{version}.tar.gz -License: LGPL -Group: System Environment/Libraries -BuildRoot: /var/tmp/%{name}-buildroot -Prefix: %{_prefix} - -%description -Due to popular demand, here is a simple multi-channel audio mixer. -It supports 4 channels of 16 bit stereo audio, plus a single channel -of music, mixed by the popular MikMod MOD, Timidity MIDI, Ogg Vorbis, -Tremor, SMPEG MP3, and libmad MP3 libraries. - -%package devel -Summary: Libraries, includes and more to develop SDL applications. -Group: Development/Libraries -Requires: %{name} - -%description devel -Due to popular demand, here is a simple multi-channel audio mixer. -It supports 4 channels of 16 bit stereo audio, plus a single channel -of music, mixed by the popular MikMod MOD, Timidity MIDI, Ogg Vorbis, -Tremor, SMPEG MP3, and libmad MP3 libraries. - -%prep -%setup - -%build -CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} -make - -%install -rm -rf $RPM_BUILD_ROOT -make install prefix=$RPM_BUILD_ROOT/%{prefix} - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root) -%doc README CHANGES COPYING -%{prefix}/lib/lib*.so.* - -%files devel -%defattr(-,root,root) -%{prefix}/lib/lib*.a -%{prefix}/lib/lib*.la -%{prefix}/lib/lib*.so -%{prefix}/include/SDL/ -%{prefix}/lib/pkgconfig/*.pc - -%changelog -* Wed Jan 19 2000 Sam Lantinga -- converted to get package information from configure -* Sun Jan 16 2000 Hakan Tandogan -- initial spec file - diff --git a/project/jni/sdl_mixer/autogen.sh b/project/jni/sdl_mixer/autogen.sh deleted file mode 100755 index a46ebd456..000000000 --- a/project/jni/sdl_mixer/autogen.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# -echo "Generating build information using autoconf" -echo "This may take a while ..." - -# Regenerate configuration files -cat acinclude/* >aclocal.m4 -found=false -for autoconf in autoconf autoconf259 autoconf-2.59 -do if which $autoconf >/dev/null 2>&1; then $autoconf && found=true; break; fi -done -if test x$found = xfalse; then - echo "Couldn't find autoconf, aborting" - exit 1 -fi - -# Run configure for this platform -echo "Now you are ready to run ./configure" diff --git a/project/jni/sdl_mixer/configure.in b/project/jni/sdl_mixer/configure.in deleted file mode 100644 index 7d2338774..000000000 --- a/project/jni/sdl_mixer/configure.in +++ /dev/null @@ -1,584 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT(README) -AC_CONFIG_AUX_DIRS($srcdir/build-scripts) - -dnl Set various version strings - taken gratefully from the GTk sources - -# Making releases: -# MICRO_VERSION += 1; -# INTERFACE_AGE += 1; -# BINARY_AGE += 1; -# if any functions have been added, set INTERFACE_AGE to 0. -# if backwards compatibility has been broken, -# set BINARY_AGE and INTERFACE_AGE to 0. -# -MAJOR_VERSION=1 -MINOR_VERSION=2 -MICRO_VERSION=11 -INTERFACE_AGE=1 -BINARY_AGE=11 -VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION - -AC_SUBST(MAJOR_VERSION) -AC_SUBST(MINOR_VERSION) -AC_SUBST(MICRO_VERSION) -AC_SUBST(INTERFACE_AGE) -AC_SUBST(BINARY_AGE) -AC_SUBST(VERSION) - -# libtool versioning -LT_INIT([win32-dll]) - -LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION -LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE` -LT_REVISION=$INTERFACE_AGE -LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE` -m4_pattern_allow([^LT_]) - -AC_SUBST(LT_RELEASE) -AC_SUBST(LT_CURRENT) -AC_SUBST(LT_REVISION) -AC_SUBST(LT_AGE) - -dnl Detect the canonical build and host environments -AC_CONFIG_AUX_DIRS($srcdir/build-scripts) -dnl AC_CANONICAL_HOST - -dnl Check for tools -AC_PROG_LIBTOOL -AC_PROG_CC -AC_PROG_INSTALL -AC_PROG_MAKE_SET -if test -z "$host_alias"; then - hostaliaswindres= -else - hostaliaswindres="$host_alias-windres" -fi -AC_CHECK_PROGS(WINDRES, [windres $hostaliaswindres $host_os-windres]) - -dnl Set up the compiler and linker flags -case "$host" in - *-*-cygwin*) - # We build SDL on cygwin without the UNIX emulation layer - BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin" - BASE_LDFLAGS="-mno-cygwin" - ;; - *) - BASE_CFLAGS="-D_GNU_SOURCE=1" - BASE_LDFLAGS="" - ;; -esac -BUILD_CFLAGS="$CFLAGS $CPPFLAGS" -EXTRA_CFLAGS="$INCLUDE $BASE_CFLAGS" -BUILD_LDFLAGS="$LDFLAGS" -EXTRA_LDFLAGS="$BASE_LDFLAGS" -## These are common directories to find software packages -#for path in /usr/freeware /usr/pkg /usr/local; do -# if test -d $path/include; then -# EXTRA_CFLAGS="$EXTRA_CFLAGS -I$path/include" -# fi -# if test -d $path/lib; then -# EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L$path/lib" -# fi -#done -CPPFLAGS="$CPPFLAGS $EXTRA_CFLAGS" -CFLAGS="$CFLAGS $EXTRA_CFLAGS" -LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS" - -dnl Check for compiler characteristics -AC_C_CONST - -dnl See whether we can use gcc style dependency tracking -AC_ARG_ENABLE(dependency-tracking, -AC_HELP_STRING([--enable-dependency-tracking], - [Use gcc -MMD -MT dependency tracking [[default=yes]]]), - , enable_dependency_tracking=yes) -if test x$enable_dependency_tracking = xyes; then - have_gcc_mmd_mt=no - AC_MSG_CHECKING(for GCC -MMD -MT option) - AC_TRY_COMPILE([ - #if !defined(__GNUC__) || __GNUC__ < 3 - #error Dependency tracking requires GCC 3.0 or newer - #endif - ],[ - ],[ - have_gcc_mmd_mt=yes - ]) - AC_MSG_RESULT($have_gcc_mmd_mt) - - if test x$have_gcc_mmd_mt = xyes; then - DEPENDENCY_TRACKING_OPTIONS="-MMD -MT \$@" - fi -fi - -case "$host" in - *-*-cygwin* | *-*-mingw32*) - VERSION_SOURCES="$srcdir/version.rc" - EXE=".exe" - if test "$build" != "$host"; then # cross-compiling - # Default cross-compile location - ac_default_prefix=/usr/local/cross-tools/i386-mingw32 - else - # Look for the location of the tools and install there - if test "$BUILD_PREFIX" != ""; then - ac_default_prefix=$BUILD_PREFIX - fi - fi - ;; - *) - SOURCES="" - EXE="" - ;; -esac - -# Standard C sources -SOURCES="$SOURCES \ -$srcdir/effect_position.c \ -$srcdir/effect_stereoreverse.c \ -$srcdir/effects_internal.c \ -$srcdir/load_aiff.c \ -$srcdir/load_voc.c \ -$srcdir/mixer.c \ -$srcdir/music.c" - -dnl set this to use on systems that use lib64 instead of lib -base_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'` - -dnl Function to find a library in the compiler search path -find_lib() -{ - gcc_bin_path=[`$CC -print-search-dirs 2>/dev/null | fgrep programs: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`] - gcc_lib_path=[`$CC -print-search-dirs 2>/dev/null | fgrep libraries: | sed 's/[^=]*=\(.*\)/\1/' | sed 's/:/ /g'`] - env_lib_path=[`echo $LIBS $LDFLAGS $* | sed 's/-L[ ]*//g'`] - if test "$cross_compiling" = yes; then - host_lib_path="" - else - host_lib_path="/usr/$base_libdir /usr/local/$base_libdir" - fi - for path in $gcc_bin_path $gcc_lib_path $env_lib_path $host_lib_path; do - lib=[`ls -- $path/$1 2>/dev/null | sort | sed 's/.*\/\(.*\)/\1/; q'`] - if test x$lib != x; then - echo $lib - return - fi - done -} - -dnl Check for SDL -SDL_VERSION=1.2.10 -AM_PATH_SDL($SDL_VERSION, - :, - AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) -) -EXTRA_CFLAGS="$EXTRA_CFLAGS $SDL_CFLAGS" -EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SDL_LIBS" - -dnl Check for math library -AC_CHECK_LIB(m, pow, [LIBM="-lm"]) - -dnl Check command-line options - -AC_ARG_ENABLE([music-cmd], -AC_HELP_STRING([--enable-music-cmd], [support an external music player [[default=yes]]]), - [], [enable_music_cmd=detect]) -if test "x$enable_music_cmd" != xno; then - AC_CHECK_FUNCS([fork vfork]) - if test "x$ac_cv_func_fork" = "xyes"; then - EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_FORK" - elif test "x$ac_cv_func_vfork" = "xyes"; then - EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_VFORK" - elif test "x$enable_music_cmd" = "xyes"; then - AC_MSG_ERROR([external music player not available on your platform]) - else - enable_music_cmd=no - fi - if test "x$enable_music_cmd" != xno; then - SOURCES="$SOURCES $srcdir/music_cmd.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS -DCMD_MUSIC" - fi -fi - -AC_ARG_ENABLE([music-wave], -AC_HELP_STRING([--enable-music-wave], [enable streaming WAVE music [[default=yes]]]), - [], [enable_music_wave=yes]) -if test x$enable_music_wave = xyes; then - SOURCES="$SOURCES $srcdir/wavestream.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS -DWAV_MUSIC" -fi - -AC_ARG_ENABLE([music-mod], -AC_HELP_STRING([--enable-music-mod], [enable MOD music via mikmod [[default=yes]]]), - [], [enable_music_mod=yes]) -AC_ARG_ENABLE([music-mod-shared], -AC_HELP_STRING([--enable-music-mod-shared], [dynamically load MOD support [[default=yes]]]), - [], [enable_music_mod_shared=yes]) -if test x$enable_music_mod = xyes; then - have_libmikmod=no - libmikmod_maj=3 - libmikmod_min=1 - libmikmod_rev=10 - libmikmod_ver="$libmikmod_maj.$libmikmod_min.$libmikmod_rev" - AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no, [$PATH]) - if test "$LIBMIKMOD_CONFIG" != "no" ; then - - CFLAGS_SAVED="$CFLAGS" - LIBS_SAVED="$LIBS" - CFLAGS="$CFLAGS -DLIBMIKMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`" - LIBS="$LIBS `$LIBMIKMOD_CONFIG --libs`" - have_libmikmod=yes - AC_MSG_CHECKING([for libmikmod - version >= $libmikmod_ver]) - AC_TRY_RUN([ -#include "mikmod.h" -#include "stdio.h" - -int main(int argc, char **argv) -{ -long maj=$libmikmod_maj,min=$libmikmod_min,rev=$libmikmod_rev,ver=MikMod_GetVersion(); -/*printf("(%d.%d.%d) ",ver>>16,(ver>>8)&0xff,ver&0xff);*/ -if(ver>=((maj<<16)|(min<<8)|(rev))) { - printf("yes\n"); - return 0; -} -printf("no\n*** libmikmod is older than %d.%d.%d, not using.\n",maj,min,rev); -return 1; -} -], [], have_libmikmod=no; CFLAGS="$CFLAGS_SAVED"; LIBS="$LIBS_SAVED", - [echo $ac_n "cross compiling; assumed OK... $ac_c"]) - fi - - if test x$have_libmikmod = xyes; then - case "$host" in - *-*-darwin*) - mikmod_lib=[`find_lib libmikmod.dylib`] - ;; - *-*-cygwin* | *-*-mingw32*) - mikmod_lib=[`find_lib "mikmod*.dll"`] - ;; - *) - mikmod_lib=[`find_lib "libmikmod*.so.[0-9]"`] - if test x$mikmod_lib = x; then - mikmod_lib=[`find_lib "libmikmod*.so.[0-9]*"`] - fi - ;; - esac - SOURCES="$SOURCES $srcdir/*_mod.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS -DMOD_MUSIC `$LIBMIKMOD_CONFIG --cflags`" - if test x$enable_music_mod_shared = xyes && test x$mikmod_lib != x; then - echo "-- dynamic libmikmod -> $mikmod_lib" - EXTRA_CFLAGS="$EXTRA_CFLAGS -DMOD_DYNAMIC=\\\"$mikmod_lib\\\"" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS `$LIBMIKMOD_CONFIG --libs`" - fi - else - AC_MSG_WARN([*** Unable to find MikMod library (http://mikmod.raphnet.net/)]) - AC_MSG_WARN([MOD support disabled]) - fi -fi - -AC_ARG_ENABLE([music-midi], -AC_HELP_STRING([--enable-music-midi], [enable MIDI music via timidity [[default=yes]]]), - [], [enable_music_midi=yes]) -if test x$enable_music_midi = xyes; then - EXTRA_CFLAGS="$EXTRA_CFLAGS -DMID_MUSIC" - AC_ARG_ENABLE([music-timidity-midi], -AC_HELP_STRING([--enable-music-timidity-midi], [enable timidity MIDI output [[default=yes]]]), - [], [enable_music_timidity_midi=yes]) - if test x$enable_music_timidity_midi = xyes; then - EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_TIMIDITY_MIDI -I\$(srcdir)/timidity" - SOURCES="$SOURCES $srcdir/timidity/*.c" - fi - AC_ARG_ENABLE([music-native-midi], -AC_HELP_STRING([--enable-music-native-midi], [enable native MIDI music output [[default=yes]]]), - [], [enable_music_native_midi=yes]) - if test x$enable_music_native_midi = xyes; then - use_music_native_midi=no - case "$host" in - *-*-cygwin* | *-*-mingw32*) - use_music_native_midi=yes - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lwinmm" - ;; - *-*-darwin*) - use_music_native_midi=yes - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,CoreServices" - ;; - esac - if test x$use_music_native_midi = xyes; then - EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi" - SOURCES="$SOURCES $srcdir/native_midi/*.c" - fi - fi - AC_ARG_ENABLE([music-native-midi-gpl], -AC_HELP_STRING([--enable-music-native-midi-gpl], [enable native MIDI on UNIX using GPL code [[default=no]]]), - [], [enable_music_native_midi_gpl=no]) - if test x$enable_music_native_midi_gpl = xyes; then - use_music_native_midi_gpl=no - case "$host" in - *-*-linux* | *-*-freebsd*) - use_music_native_midi_gpl=yes - ;; - esac - if test x$use_music_native_midi_gpl = xyes; then - EXTRA_CFLAGS="$EXTRA_CFLAGS -DUSE_NATIVE_MIDI -I\$(srcdir)/native_midi" - SOURCES="$SOURCES $srcdir/native_midi_gpl/*.c" - fi - fi -fi - -AC_ARG_ENABLE([music-ogg], -AC_HELP_STRING([--enable-music-ogg], [enable Ogg Vorbis music [[default=yes]]]), - [], [enable_music_ogg=yes]) -AC_ARG_ENABLE(music-ogg-tremor, -AC_HELP_STRING([--enable-music-ogg-tremor], [enable OGG Vorbis music via libtremor [[default=no]]]), - [], enable_music_ogg_tremor=no) -AC_ARG_ENABLE([music-ogg-shared], -AC_HELP_STRING([--enable-music-ogg-shared], [dynamically load Ogg Vorbis support [[default=yes]]]), - [], [enable_music_ogg_shared=yes]) -if test x$enable_music_ogg = xyes; then - if test x$enable_music_ogg_tremor = xyes; then - AC_CHECK_HEADER([tremor/ivorbisfile.h], [have_tremor_hdr=yes]) - AC_CHECK_LIB([vorbisidec], [ov_open_callbacks], [have_tremor_lib=yes]) - if test x$have_tremor_hdr = xyes -a x$have_tremor_lib = xyes; then - case "$host" in - *-*-darwin*) - ogg_lib=[`find_lib libvorbisidec.dylib`] - if test x$ogg_lib = x; then - ogg_lib=[`find_lib libvorbisidec.[0-9]`] - fi - if test x$ogg_lib = x; then - ogg_lib=[`find_lib libvorbisidec.[0-9]*`] - fi - ;; - *-*-cygwin* | *-*-mingw32*) - ogg_lib=[`find_lib "vorbisidec*.dll"`] - ;; - *) - ogg_lib=[`find_lib "libvorbisidec.so.[0-9]"`] - if test x$ogg_lib = x; then - ogg_lib=[`find_lib "libvorbisidec.so.[0-9]*"`] - fi - ;; - esac - SOURCES="$SOURCES $srcdir/*_ogg.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC -DOGG_USE_TREMOR" - if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then - echo "-- dynamic libvorbisidec -> $ogg_lib" - EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\"" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisidec -lvorbis -logg $LIBM" - fi - else - AC_MSG_WARN([*** Unable to find Ogg Vorbis Tremor library (http://www.xiph.org/)]) - AC_MSG_WARN([Ogg Vorbis support disabled]) - fi - else - AC_CHECK_HEADER([vorbis/vorbisfile.h], [have_ogg_hdr=yes]) - AC_CHECK_LIB([vorbisfile], [ov_open_callbacks], [have_ogg_lib=yes]) - if test x$have_ogg_hdr = xyes -a x$have_ogg_lib = xyes; then - case "$host" in - *-*-darwin*) - ogg_lib=[`find_lib libvorbisfile.dylib`] - ;; - *-*-cygwin* | *-*-mingw32*) - ogg_lib=[`find_lib "libvorbisfile*.dll"`] - ;; - *) - ogg_lib=[`find_lib "libvorbisfile.so.[0-9]"`] - if test x$ogg_lib = x; then - ogg_lib=[`find_lib "libvorbisfile.so.[0-9]*"`] - fi - ;; - esac - SOURCES="$SOURCES $srcdir/*_ogg.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_MUSIC" - if test x$enable_music_ogg_shared = xyes && test x$ogg_lib != x; then - echo "-- dynamic libvorbisfile -> $ogg_lib" - EXTRA_CFLAGS="$EXTRA_CFLAGS -DOGG_DYNAMIC=\\\"$ogg_lib\\\"" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvorbisfile -lvorbis -logg $LIBM" - fi - else - AC_MSG_WARN([*** Unable to find Ogg Vorbis library (http://www.xiph.org/)]) - AC_MSG_WARN([Ogg Vorbis support disabled]) - fi - fi -fi - -libflac_ver=8 -AC_ARG_ENABLE([music-flac], -AC_HELP_STRING([--enable-music-flac], [enable FLAC music [[default=yes]]]), - [], [enable_music_flac=yes]) -AC_ARG_ENABLE([music-flac-shared], -AC_HELP_STRING([--enable-music-flac-shared], - [dynamically load FLAC support [[default=yes]]]), - [], [enable_music_flac_shared=yes]) -if test x$enable_music_flac = xyes; then - AC_CHECK_HEADER([FLAC/export.h], [have_flac_export=yes]) - if test x$have_flac_export = xyes; then - LIBS_SAVED="$LIBS" - LIBS="-lFLAC" - AC_MSG_CHECKING([for libflac so-name version >= $libflac_ver]) - AC_TRY_RUN([ -#include "FLAC/export.h" -#include "stdio.h" -int main( int argc, char *argv[] ) { -#if defined(FLAC_API_VERSION_CURRENT) && (FLAC_API_VERSION_CURRENT >= $libflac_ver) - return 0; -#else - return 1; -#endif -} -], have_flac_ver=yes, have_flac_ver=no) - LIBS="$LIBS_SAVED" - AC_MSG_RESULT($have_flac_ver) - fi - - if test x$have_flac_ver = xyes; then - AC_CHECK_HEADER([FLAC/stream_decoder.h], [have_flac_hdr=yes]) - AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_new], [have_flac_lib=yes]) - if test x$have_flac_hdr = xyes -a x$have_flac_lib = xyes; then - case "$host" in - *-*-darwin*) - flac_lib=[`find_lib libFLAC.dylib`] - ;; - *-*-cygwin* | *-*-mingw32*) - flac_lib=[`find_lib "libFLAC*.dll"`] - ;; - *) - flac_lib=[`find_lib "libFLAC.so.[0-9]"`] - if test x$flac_lib = x; then - flac_lib=[`find_lib "libFLAC.so.[0-9]*"`] - fi - ;; - esac - SOURCES="$SOURCES $srcdir/*_flac.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_MUSIC" - if test x$enable_music_flac_shared = xyes && test x$flac_lib != x; then - echo "-- dynamic libFLAC -> $flac_lib" - EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_DYNAMIC=\\\"$flac_lib\\\"" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lFLAC" - fi - fi - else - AC_MSG_WARN([*** Unable to find FLAC library (http://flac.sourceforge.net/)]) - AC_MSG_WARN([FLAC support disabled]) - fi -fi - -AC_ARG_ENABLE(music-mp3, -AC_HELP_STRING([--enable-music-mp3], [enable MP3 music via smpeg [[default=yes]]]), - [], enable_music_mp3=yes) -AC_ARG_ENABLE([music-mp3-shared], -AC_HELP_STRING([--enable-music-mp3-shared], [dynamically load MP3 support [[default=yes]]]), - [], [enable_music_mp3_shared=yes]) -if test x$enable_music_mp3 = xyes; then - SMPEG_VERSION=0.4.3 - AM_PATH_SMPEG($SMPEG_VERSION, have_smpeg=yes, have_smpeg=no) - if test x$have_smpeg = xyes; then - case "$host" in - *-*-darwin*) - smpeg_lib=[`find_lib libsmpeg.dylib`] - ;; - *-*-cygwin* | *-*-mingw32*) - smpeg_lib=[`find_lib "smpeg*.dll"`] - ;; - *) - smpeg_lib=[`find_lib "libsmpeg*.so.[0-9]"`] - if test x$smpeg_lib = x; then - smpeg_lib=[`find_lib "libsmpeg*.so.[0-9]*"`] - fi - ;; - esac - SOURCES="$SOURCES $srcdir/*_mp3.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MUSIC $SMPEG_CFLAGS" - if test x$enable_music_mp3_shared = xyes && test x$smpeg_lib != x; then - echo "-- dynamic libsmpeg -> $smpeg_lib" - EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_DYNAMIC=\\\"$smpeg_lib\\\"" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SMPEG_LIBS" - fi - else - AC_MSG_WARN([*** Unable to find SMPEG library (http://icculus.org/smpeg/)]) - fi -fi - -AC_ARG_ENABLE(music-mp3-mad-gpl, -AC_HELP_STRING([--enable-music-mp3-mad-gpl], [enable MP3 music via libmad GPL code [[default=no]]]), - [], [enable_music_mp3_mad_gpl=no]) -if test x$enable_music_mp3_mad_gpl = xyes; then - AC_MSG_CHECKING(for libmad headers) - have_libmad=no - AC_TRY_COMPILE([ - #include "mad.h" - ],[ - ],[ - have_libmad=yes - ]) - AC_MSG_RESULT($have_libmad) - if test x$have_libmad = xyes; then - SOURCES="$SOURCES $srcdir/music_mad.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS -DMP3_MAD_MUSIC" - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmad" - else - AC_MSG_WARN([*** Unable to find MAD library (http://www.underbit.com/products/mad/)]) - fi -fi - -if test x$have_smpeg != xyes -a x$have_libmad != xyes; then - AC_MSG_WARN([MP3 support disabled]) -fi - - -OBJECTS=`echo $SOURCES` -DEPENDS=`echo $SOURCES` -OBJECTS=`echo "$OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'` -DEPENDS=`echo "$DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\ -$(objects)/\2.lo: \1/\2.c\\ - \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'` - -VERSION_OBJECTS=`echo $VERSION_SOURCES` -VERSION_DEPENDS=`echo $VERSION_SOURCES` -VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'` -VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.rc,\\ -$(objects)/\2.o: \1/\2.rc\\ - \$(WINDRES) \$< \$@,g'` - -PLAYWAVE_SOURCES="$srcdir/playwave.c" -PLAYWAVE_OBJECTS=`echo $PLAYWAVE_SOURCES` -PLAYWAVE_DEPENDS=`echo $PLAYWAVE_SOURCES` -PLAYWAVE_OBJECTS=`echo "$PLAYWAVE_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'` -PLAYWAVE_DEPENDS=`echo "$PLAYWAVE_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\ -$(objects)/\2.lo: \1/\2.c\\ - \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'` - -PLAYMUS_SOURCES="$srcdir/playmus.c" -PLAYMUS_OBJECTS=`echo $PLAYMUS_SOURCES` -PLAYMUS_DEPENDS=`echo $PLAYMUS_SOURCES` -PLAYMUS_OBJECTS=`echo "$PLAYMUS_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'` -PLAYMUS_DEPENDS=`echo "$PLAYMUS_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\ -$(objects)/\2.lo: \1/\2.c\\ - \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'` - -dnl Expand the sources and objects needed to build the library -AC_SUBST(ac_aux_dir) -AC_SUBST(OBJECTS) -AC_SUBST(DEPENDS) -AC_SUBST(VERSION_OBJECTS) -AC_SUBST(VERSION_DEPENDS) -AC_SUBST(PLAYWAVE_OBJECTS) -AC_SUBST(PLAYWAVE_DEPENDS) -AC_SUBST(PLAYMUS_OBJECTS) -AC_SUBST(PLAYMUS_DEPENDS) -AC_SUBST(BUILD_CFLAGS) -AC_SUBST(EXTRA_CFLAGS) -AC_SUBST(BUILD_LDFLAGS) -AC_SUBST(EXTRA_LDFLAGS) -AC_SUBST(EXE) -AC_SUBST(WINDRES) -AC_SUBST(SDL_VERSION) -AC_SUBST(SDL_CFLAGS) -AC_SUBST(SDL_LIBS) - -AC_OUTPUT([ - Makefile SDL_mixer.spec SDL_mixer.qpg SDL_mixer.pc -]) diff --git a/project/jni/sdl_mixer/gcc-fat.sh b/project/jni/sdl_mixer/gcc-fat.sh deleted file mode 100755 index 528a6ffe5..000000000 --- a/project/jni/sdl_mixer/gcc-fat.sh +++ /dev/null @@ -1,185 +0,0 @@ -#!/bin/sh -# -# Build Universal binaries on Mac OS X, thanks Ryan! -# -# Usage: ./configure CC="sh gcc-fat.sh" && make && rm -rf ppc ppc64 x86 x64 - -# PowerPC 32-bit compiler flags (10.4 runtime compatibility) -GCC_COMPILE_PPC32="gcc-4.0 -arch ppc -mmacosx-version-min=10.4 \ --DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \ --nostdinc \ --F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \ --I/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1/include \ --isystem /Developer/SDKs/MacOSX10.4u.sdk/usr/include" - -GCC_LINK_PPC32="\ --L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1 \ --Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" - -# PowerPC 64-bit compiler flags (10.5 runtime compatibility) -GCC_COMPILE_PPC64="gcc-4.0 -arch ppc64 -mmacosx-version-min=10.5 \ --DMAC_OS_X_VERSION_MIN_REQUIRED=1050 \ --nostdinc \ --F/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks \ --I/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1/include \ --isystem /Developer/SDKs/MacOSX10.5.sdk/usr/include" - -GCC_LINK_PPC64="\ --L/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/powerpc-apple-darwin10/4.0.1/ppc64 \ --Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk" - -# Intel 32-bit compiler flags (10.4 runtime compatibility) -GCC_COMPILE_X86="gcc-4.0 -arch i386 -mmacosx-version-min=10.4 \ --DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \ --nostdinc \ --F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \ --I/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1/include \ --isystem /Developer/SDKs/MacOSX10.4u.sdk/usr/include" - -GCC_LINK_X86="\ --L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1 \ --Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" - -# Intel 64-bit compiler flags (10.5 runtime compatibility) -GCC_COMPILE_X64="gcc-4.0 -arch x86_64 -mmacosx-version-min=10.5 \ --DMAC_OS_X_VERSION_MIN_REQUIRED=1050 \ --nostdinc \ --F/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks \ --I/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1/include \ --isystem /Developer/SDKs/MacOSX10.5.sdk/usr/include" - -GCC_LINK_X64="\ --L/Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin10/4.0.1/x86_64 \ --Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk" - -# Output both PowerPC and Intel object files -args="$*" -compile=yes -link=yes -while test x$1 != x; do - case $1 in - --version) exec gcc $1;; - -v) exec gcc $1;; - -V) exec gcc $1;; - -print-prog-name=*) exec gcc $1;; - -print-search-dirs) exec gcc $1;; - -E) GCC_COMPILE_PPC32="$GCC_COMPILE_PPC32 -E" - GCC_COMPILE_PPC64="$GCC_COMPILE_PPC64 -E" - GCC_COMPILE_X86="$GCC_COMPILE_X86 -E" - GCC_COMPILE_X64="$GCC_COMPILE_X64 -E" - compile=no; link=no;; - -c) link=no;; - -o) output=$2;; - *.c|*.cc|*.cpp|*.S) source=$1;; - esac - shift -done -if test x$link = xyes; then - GCC_COMPILE_PPC32="$GCC_COMPILE_PPC32 $GCC_LINK_PPC32" - GCC_COMPILE_PPC64="$GCC_COMPILE_PPC64 $GCC_LINK_PPC64" - GCC_COMPILE_X86="$GCC_COMPILE_X86 $GCC_LINK_X86" - GCC_COMPILE_X64="$GCC_COMPILE_X64 $GCC_LINK_X64" -fi -if test x"$output" = x; then - if test x$link = xyes; then - output=a.out - elif test x$compile = xyes; then - output=`echo $source | sed -e 's|.*/||' -e 's|\(.*\)\.[^\.]*|\1|'`.o - fi -fi - -# Compile PPC 32-bit -if test x"$output" != x; then - dir=ppc/`dirname $output` - if test -d $dir; then - : - else - mkdir -p $dir - fi -fi -set -- $args -while test x$1 != x; do - if test -f "ppc/$1" && test "$1" != "$output"; then - ppc_args="$ppc_args ppc/$1" - else - ppc_args="$ppc_args $1" - fi - shift -done -$GCC_COMPILE_PPC32 $ppc_args || exit $? -if test x"$output" != x; then - cp $output ppc/$output -fi - -# Compile PPC 64-bit -if test x"$output" != x; then - dir=ppc64/`dirname $output` - if test -d $dir; then - : - else - mkdir -p $dir - fi -fi -set -- $args -while test x$1 != x; do - if test -f "ppc64/$1" && test "$1" != "$output"; then - ppc64_args="$ppc64_args ppc64/$1" - else - ppc64_args="$ppc64_args $1" - fi - shift -done -$GCC_COMPILE_PPC64 $ppc64_args || exit $? -if test x"$output" != x; then - cp $output ppc64/$output -fi - -# Compile X86 32-bit -if test x"$output" != x; then - dir=x86/`dirname $output` - if test -d $dir; then - : - else - mkdir -p $dir - fi -fi -set -- $args -while test x$1 != x; do - if test -f "x86/$1" && test "$1" != "$output"; then - x86_args="$x86_args x86/$1" - else - x86_args="$x86_args $1" - fi - shift -done -$GCC_COMPILE_X86 $x86_args || exit $? -if test x"$output" != x; then - cp $output x86/$output -fi - -# Compile X86 32-bit -if test x"$output" != x; then - dir=x64/`dirname $output` - if test -d $dir; then - : - else - mkdir -p $dir - fi -fi -set -- $args -while test x$1 != x; do - if test -f "x64/$1" && test "$1" != "$output"; then - x64_args="$x64_args x64/$1" - else - x64_args="$x64_args $1" - fi - shift -done -$GCC_COMPILE_X64 $x64_args || exit $? -if test x"$output" != x; then - cp $output x64/$output -fi - -if test x"$output" != x; then - lipo -create -o $output ppc/$output ppc64/$output x86/$output x64/$output -fi diff --git a/project/jni/sdl_mixer/version.rc b/project/jni/sdl_mixer/version.rc deleted file mode 100644 index be213ffb8..000000000 --- a/project/jni/sdl_mixer/version.rc +++ /dev/null @@ -1,38 +0,0 @@ - -#include "winresrc.h" - -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,2,11,0 - PRODUCTVERSION 1,2,11,0 - FILEFLAGSMASK 0x3fL - FILEFLAGS 0x0L - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", "\0" - VALUE "FileDescription", "SDL_mixer\0" - VALUE "FileVersion", "1, 2, 11, 0\0" - VALUE "InternalName", "SDL_mixer\0" - VALUE "LegalCopyright", "Copyright © 2009 Sam Lantinga\0" - VALUE "OriginalFilename", "SDL_mixer.dll\0" - VALUE "ProductName", "Simple DirectMedia Layer\0" - VALUE "ProductVersion", "1, 2, 11, 0\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END