diff --git a/CMakeLists.txt b/CMakeLists.txt index e4a2362661..b1f98c2577 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,7 +68,9 @@ if(USING_GLES2) else() include(FindOpenGL REQUIRED) endif() -include(FindSDL) +if (NOT BLACKBERRY AND NOT ANDROID) + include(FindSDL) +endif() include(FindThreads) if(APPLE) find_library(COCOA_LIBRARY Cocoa) @@ -365,6 +367,7 @@ if(ANDROID) endif() set(nativeExtra) +set(nativeExtraLibs) if(ANDROID) set(nativeExtra ${nativeExtra} native/base/NativeApp.h @@ -376,10 +379,25 @@ if(ANDROID) native/android/native-audio-so.cpp native/android/native-audio-so.h) target_link_libraries(native_audio OpenSLES) -endif() -if(BLACKBERRY) - set(nativeExtra ${nativeExtra} - native/base/BlackberryMain.cpp) + # No target +elseif(BLACKBERRY) + set(nativeExtra ${nativeExtra} native/base/BlackberryMain.cpp) + set(nativeExtraLibs ${nativeExtraLibs} asound bps screen socket EGL) + set(TargetBin PPSSPPBlackberry) +elseif(SDL_FOUND) +# Require SDL + include_directories(${SDL_INCLUDE_DIR}) + set(nativeExtra ${nativeExtra} native/base/PCMain.cpp) + set(nativeExtraLibs ${nativeExtraLibs} ${SDL_LIBRARY}) + if(APPLE) + set(nativeExtra ${nativeExtra} SDL/SDLMain.h SDL/SDLMain.mm) + set(nativeExtraLibs ${nativeExtraLibs} ${COCOA_LIBRARY}) + endif() + if(NOT IOS) # No target + set(TargetBin PPSSPPSDL) + endif() +else() + message(FATAL_ERROR "Could not find SDL. Failing.") endif() if(X86) @@ -409,7 +427,6 @@ add_library(native STATIC native/base/linked_ptr.h native/base/logging.h native/base/mutex.h -# native/base/PCMain.cpp native/base/scoped_ptr.h native/base/stats.h native/base/stringutil.cpp @@ -826,43 +843,23 @@ if(HEADLESS) setup_target_project(PPSSPPHeadless headless) endif() -if(SDL_FOUND) - include_directories(${SDL_INCLUDE_DIR}) +set(NativeAppSource + android/jni/NativeApp.cpp + android/jni/EmuScreen.cpp + android/jni/MenuScreens.cpp + android/jni/GamepadEmu.cpp + android/jni/UIShader.cpp + android/jni/ui_atlas.cpp) +set(AndroidAssets + android/assets/ui_atlas.zim + android/assets/ppge_atlas.zim) +set(LinkCommon ${CoreLibName} ${CMAKE_THREAD_LIBS_INIT} ${nativeExtraLibs}) - set(NativeAppSource - android/jni/NativeApp.cpp - android/jni/EmuScreen.cpp - android/jni/MenuScreens.cpp - android/jni/GamepadEmu.cpp - android/jni/UIShader.cpp - android/jni/ui_atlas.cpp) - set(AndroidAssets - android/assets/ui_atlas.zim - android/assets/ppge_atlas.zim) - set(LinkCommon ${CoreLibName} - ${SDL_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) - - if(BLACKBERRY) - add_executable(PPSSPPBlackberry native/base/BlackberryMain.cpp ${NativeAppSource}) - target_link_libraries(PPSSPPBlackberry ${LinkCommon} bps screen socket EGL GLESv2) - elseif(ANDROID) - # no target - elseif(IOS) - # no target - else() - set(SDL_Main native/base/PCMain.cpp) - if(APPLE) - set(SDL_Main ${SDL_Main} - SDL/SDLMain.h - SDL/SDLMain.mm) - set(LinkCommon ${LinkCommon} ${COCOA_LIBRARY}) - endif() - - add_executable(PPSSPPSDL ${SDL_Main} ${NativeAppSource}) - target_link_libraries(PPSSPPSDL ${LinkCommon}) - endif() - - file(INSTALL ${AndroidAssets} DESTINATION assets) +if (TargetBin) + add_executable(${TargetBin} ${NativeAppSource}) + target_link_libraries(${TargetBin} ${LinkCommon}) endif() +file(INSTALL ${AndroidAssets} DESTINATION assets) + #include(CPack) diff --git a/GPU/GLES/FragmentShaderGenerator.cpp b/GPU/GLES/FragmentShaderGenerator.cpp index b225c299bf..6dbbb39fa8 100644 --- a/GPU/GLES/FragmentShaderGenerator.cpp +++ b/GPU/GLES/FragmentShaderGenerator.cpp @@ -19,6 +19,12 @@ #define GLSL_ES_1_0 #else #define GLSL_1_3 + +// SDL 1.2 on Apple does not have support for OpenGL 3 and hence needs +// special treatment in the shader generator. +#if defined(__APPLE__) +#define FORCE_OPENGL_2_0 +#endif #endif @@ -30,13 +36,6 @@ // TODO: remove static char buffer[16384]; -// SDL 1.2 on Apple does not have support for OpenGL 3 and hence needs -// special treatment in the shader generator. -#ifdef __APPLE__ -#define FORCE_OPENGL_2_0 -#endif - - #define WRITE p+=sprintf // GL_NV_shader_framebuffer_fetch looks interesting.... diff --git a/SDL/bar-descriptor.xml b/SDL/bar-descriptor.xml index 25c2f82a77..13e3b2e56b 100644 --- a/SDL/bar-descriptor.xml +++ b/SDL/bar-descriptor.xml @@ -3,7 +3,7 @@ com.Qtness.PPSSPP PPSSPP PPSSPPBlackberry - 0.31 + 0.4 1 Playstation portable emulator. @@ -20,8 +20,6 @@ PPSSPPBlackberry icon-114.png assets - lib/libSDL12.so - lib/libTouchControlOverlay.so core.games @@ -33,6 +31,4 @@ run_native access_shared play_audio - - diff --git a/SDL/blackberry_build.sh b/SDL/blackberry_build.sh index 5ef80f155d..89d2c98423 100755 --- a/SDL/blackberry_build.sh +++ b/SDL/blackberry_build.sh @@ -7,45 +7,8 @@ if [ -z "$BB_OS" ]; then fi echo "Building for Blackberry ${BB_OS}" -PPSSPP_ROOT=${PWD}/.. -if [ -z "$PROJECT_ROOT" ]; then - PROJECT_ROOT=${PPSSPP_ROOT}/.. -fi -if [ -z "$SDL_PROJECT" ]; then - SDL_PROJECT="$PROJECT_ROOT/SDL" -fi -if [ -z "$TCO_PROJECT" ]; then - TCO_PROJECT="$PROJECT_ROOT/TouchControlOverlay" -fi - -while true; do - case "$1" in - -h | --help ) - echo "Build script for BlackBerry" - echo - echo "Options: " - echo " -h, --help Show this help message." - echo " -p, --project-root PATH Specify the root directory containing all projects. (default is PPSSPP's parent)" - echo "Dependency Paths (defaults are under project root): " - echo " --sdl PATH SDL 1.2 project directory (default is SDL)" - echo " --tco PATH TouchControlOverlay project directory (default is TouchControlOverlay)" - exit 0 - ;; - -p | --project-root ) PROJECT_ROOT="$2"; shift 2 ;; - --sdl ) SDL_PROJECT="$2"; shift 2 ;; - --tco ) TCO_PROJECT="$2"; shift 2 ;; - -- ) shift; break ;; - * ) break ;; - esac -done - -cmake \ --DCMAKE_C_COMPILER="${QNX_HOST}/usr/bin/ntoarmv7-gcc" \ --DCMAKE_CXX_COMPILER="${QNX_HOST}/usr/bin/ntoarmv7-g++" \ --DSDL_INCLUDE_DIR="${SDL_PROJECT}/include" \ --DSDL_LIBRARY="${SDL_PROJECT}/Device-Release/libSDL12.so;${TCO_PROJECT}/Device-Release/libTouchControlOverlay.so" \ --DBLACKBERRY=${BB_OS} \ -${PPSSPP_ROOT} +# Set up cmake with GCC 4.6.3 cross-compiler from PATH +CC=ntoarmv7-gcc CXX=ntoarmv7-g++ cmake -DBLACKBERRY=${BB_OS} .. # Compile and create unsigned PPSSPP.bar with debugtoken DEBUG="-devMode -debugToken ${HOME}/debugtoken.bar" diff --git a/android/CMakeLists.txt b/android/CMakeLists.txt deleted file mode 100644 index 19378678b3..0000000000 --- a/android/CMakeLists.txt +++ /dev/null @@ -1,104 +0,0 @@ -cmake_minimum_required(VERSION 2.6) - -project (PPSSPP) - -find_package(PkgConfig) - -find_package(PNG REQUIRED) -pkg_check_modules(SDL sdl) - -if (APPLE) - find_library(OGL_LIBRARY OpenGL) - include_directories(/usr/X11/include) -endif() - - -include(FindOpenGL) -include(FindSDL) - -add_definitions(-g) -add_definitions(-O0) -add_definitions(-Wall) -add_definitions(-DSDL) -add_definitions(-Wno-multichar) -add_definitions(-fno-strict-aliasing) -add_definitions(-DUSE_PROFILER) - -include_directories(jni) -include_directories(../native) -include_directories(../native/base) -include_directories(../native/math/lin) -include_directories(../native/audio) -include_directories(../native/ext/libzip) -include_directories(../native/ext/etcpack) -include_directories(/usr/local/include) -include_directories(${SDL_INCLUDE_DIR}) -include_directories(${PNG_INCLUDE_DIR}) - -link_directories(/usr/local/lib) -link_directories(/usr/X11/lib) - -add_subdirectory(../native/base base) -add_subdirectory(../native/gfx gfx) -add_subdirectory(../native/profiler profiler) -add_subdirectory(../native/gfx_es2 gfx_es2) -add_subdirectory(../native/file file) -add_subdirectory(../native/image image) -add_subdirectory(../native/ui ui) -add_subdirectory(../native/net net) -add_subdirectory(../native/json jsonwriter) -add_subdirectory(../native/audio audio) -add_subdirectory(../native/math math) -add_subdirectory(../native/ext/libzip libzip) -add_subdirectory(../native/ext/etcpack etcpack) -add_subdirectory(../native/ext/vjson vjson) -add_subdirectory(../native/ext/stb_vorbis stb_vorbis) -add_subdirectory(../native/ext/sha1 sha1) - -set(LIBS ${LIBS} ${SDL_LIBRARY} ${OPENGL_LIBRARIES} GLEW file lin ${PNG_LIBRARY} z gfx gfx_es2 ui etcdec image mixer net profiler timeutil file zip base lin vjson stb_vorbis sha1 jsonwriter) - -set(FILES - jni/ui_atlas.cpp - jni/ray_intersections.cpp - jni/collision.cpp - jni/AudioManager.cpp - jni/Campaign.cpp - jni/CampaignEndScreen.cpp - jni/CalibrateScreen.cpp - jni/CreditsScreen.cpp - jni/Curves.cpp - jni/CollidableMesh.cpp - jni/DrawList.cpp - jni/Globals.cpp - jni/Level.cpp - jni/CampaignEndScreen.cpp - jni/Material.cpp - jni/MainMenuScreen.cpp - jni/MessageBus.cpp - jni/Mesh.cpp - jni/MeshGenerator.cpp - jni/NativeApp.cpp - jni/GfxUtil.cpp - jni/GfxWrapper.cpp - jni/BallSimulator.cpp - jni/Node.cpp - jni/NormalGame.cpp - jni/NormalGameScreen.cpp - jni/Scene.cpp - jni/Sky.cpp - jni/ShaderManager.cpp - jni/StickSim.cpp - jni/TextureManager.cpp - jni/Transformation.cpp) - -if (APPLE) - SET(FILES ${FILES} jni/SDLMain.m) -endif (APPLE) - -add_executable(rollerball ../native/base/PCMain.cpp ${FILES}) - -target_link_libraries(rollerball ${LIBS}) - -#add_executable(meshtool jni/Meshtool.cpp ${FILES}) - -#target_link_libraries(meshtool ${LIBS}) diff --git a/android/jni/MenuScreens.cpp b/android/jni/MenuScreens.cpp index 9fc656b229..f98f6986af 100644 --- a/android/jni/MenuScreens.cpp +++ b/android/jni/MenuScreens.cpp @@ -376,16 +376,23 @@ static const char *credits[] = "ced2911", "soywiz", "kovensky", + "xsacha", "", "Written in C++ for speed and portability", "", "", "Free tools used:", +#ifdef ANDROID "Android SDK + NDK", +#elif BLACKBERRY + "Blackberry NDK", +#else + "SDL", +#endif "CMake", "freetype2", "zlib", - "the free PSP SDK", + "PSP SDK", "", "", "Check out the website:",