diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b8e74b41..f8e450921 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,15 +107,26 @@ if((WIN32 AND NOT MINGW) OR APPLE) add_subdirectory("${PROJECT_SOURCE_DIR}/lib/libpng") include_directories("${PROJECT_SOURCE_DIR}/lib/libpng") - #build jpeg library - add_subdirectory("${PROJECT_SOURCE_DIR}/lib/jpeglib") - include_directories("${PROJECT_SOURCE_DIR}/lib/jpeglib") - set(PNG_PNG_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lib/libpng/") set(PNG_LIBRARY png15_static) +endif() + +# Add jpeg-turbo library +if (APPLE) + add_subdirectory("${PROJECT_SOURCE_DIR}/lib/jpeglib") + include_directories("${PROJECT_SOURCE_DIR}/lib/jpeglib") set(JPEG_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lib/jpeglib/") set(JPEG_LIBRARY jpeglib) +else() + find_package(JPEG REQUIRED) + include_directories(${JPEG_INCLUDE_DIR}) endif() + +if(NOT SERVER_ONLY AND NOT USE_GLES2) + add_subdirectory("${PROJECT_SOURCE_DIR}/lib/graphics_utils") + include_directories("${PROJECT_SOURCE_DIR}/lib/graphics_utils") +endif() + # Build the irrlicht library add_subdirectory("${PROJECT_SOURCE_DIR}/lib/irrlicht") include_directories("${PROJECT_SOURCE_DIR}/lib/irrlicht/include") @@ -368,11 +379,12 @@ target_link_libraries(supertuxkart ${OGGVORBIS_LIBRARIES} ${OPENAL_LIBRARY} ${FREETYPE_LIBRARIES} + ${JPEG_LIBRARIES} ) if(NOT SERVER_ONLY) if(NOT USE_GLES2) - target_link_libraries(supertuxkart ${OPENGL_LIBRARIES} glew) + target_link_libraries(supertuxkart ${OPENGL_LIBRARIES} glew graphics_utils) else() target_link_libraries(supertuxkart EGL GLESv2) endif() diff --git a/android/generate_assets.sh b/android/generate_assets.sh index 2fdec9214..30bf65df2 100755 --- a/android/generate_assets.sh +++ b/android/generate_assets.sh @@ -29,13 +29,16 @@ export ASSETS_PATHS="../data \ export ASSETS_DIRS="library models music sfx textures" export TEXTURE_SIZE=256 -export SOUND_QUALITY=64 +export SOUND_QUALITY=42 +export SOUND_MONO=1 +export SOUND_SAMPLE=32000 export RUN_OPTIMIZE_SCRIPT=0 export DECREASE_QUALITY=1 ################################################################################ +export LANG=C cd "`dirname "$0"`" @@ -191,7 +194,22 @@ convert_sound() oggdec "$FILE" -o tmp.wav if [ -s tmp.wav ]; then - oggenc --downmix -b $SOUND_QUALITY tmp.wav -o tmp.ogg + OGGENC_CMD="" + + if [ "$SOUND_MONO" -gt 0 ]; then + OGGENC_CMD="$OGGENC_CMD --downmix" + fi + + OGG_RATE=`ogginfo "$FILE" | grep "Rate: " | cut -f 2 -d " " \ + | grep -o '[0-9]*'` + + if [ ! -z "$OGG_RATE" ] && [ "$OGG_RATE" -gt "32000" ]; then + OGGENC_CMD="$OGGENC_CMD --resample 32000" + fi + + OGGENC_CMD="$OGGENC_CMD -b $SOUND_QUALITY" + + oggenc $OGGENC_CMD tmp.wav -o tmp.ogg fi if [ -s tmp.ogg ]; then diff --git a/data/gui/custom_video_settings.stkgui b/data/gui/custom_video_settings.stkgui index 3a0a1b9a8..be2b29448 100644 --- a/data/gui/custom_video_settings.stkgui +++ b/data/gui/custom_video_settings.stkgui @@ -147,16 +147,8 @@