diff --git a/.github/workflows/build-baremetal.yaml b/.github/workflows/build-standalone.yaml similarity index 100% rename from .github/workflows/build-baremetal.yaml rename to .github/workflows/build-standalone.yaml diff --git a/.github/workflows/build-steam.yaml b/.github/workflows/build-steam.yaml new file mode 100644 index 00000000..73e4aa2c --- /dev/null +++ b/.github/workflows/build-steam.yaml @@ -0,0 +1,86 @@ +name: Build Modshot with Steam support +on: push +jobs: + build-windows: + name: Build ModShot for Windows (Steam support) + runs-on: windows-2019 + env: + CONAN_USER_HOME: C:\.conan + CONAN_USER_HOME_SHORT: C:\.conan + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Install conan and xxd + run: choco install -y vim; pip install conan + - name: Set path to include xxd + run: '[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\tools\vim\vim82", "Machine")' + - name: Configure conan + run: | + conan remote add eliza https://api.bintray.com/conan/eliza/conan; + conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan; + setx CONAN_USE_ALWAYS_SHORT_PATHS 1; + mkdir ${{ runner.temp }}\build + - name: Cache conan dependencies + uses: actions/cache@v2 + with: + path: C:\.conan + key: ${{ runner.os }}-cached-conan-modules-${{ hashFiles('conanfile.py') }}-steam + - name: Build dependencies using conan + run: conan install ${{ github.workspace }} --build=missing -o platform=steam + working-directory: ${{ runner.temp }}\build + - name: Build ModShot + run: conan build ${{ github.workspace }} + working-directory: ${{ runner.temp }}\build + - name: Create dist folder + run: | + mkdir ${{ runner.temp }}\built_artifact; + move ${{ runner.temp }}\build\bin\lib ${{ runner.temp }}\built_artifact\lib; + move ${{ runner.temp }}\build\bin\* ${{ runner.temp }}\built_artifact\lib; + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: modshot_build_steam_windows_${{ github.sha }} + path: ${{ runner.temp }}\built_artifact + build-linux: + name: Build ModShot for Linux (Steam support) + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Install dependencies + run: | + sudo DEBIAN_FRONTEND=noninteractive apt install -y \ + libgtk2.0-dev libxfconf-0-dev libwmf0.2-7-gtk libegl1-mesa-dev libgbm-dev libasound2-dev libjack-dev libpulse-dev libaudio-dev patchelf && + sudo curl -Lo /usr/local/bin/linuxdeploy-x86_64.AppImage https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage && + sudo chmod +x /usr/local/bin/linuxdeploy-x86_64.AppImage + - name: Setup Python + uses: actions/setup-python@v2 + - name: Install and configure conan + run: | + pip3 install conan + conan remote add eliza https://api.bintray.com/conan/eliza/conan; + conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan; + mkdir ${{ runner.temp }}/build + - name: Cache conan dependencies + uses: actions/cache@v2 + with: + path: ~/.conan + key: ${{ runner.os }}-cached-conan-modules-${{ hashFiles('conanfile.py') }}-steam + - name: Build dependencies using conan + run: conan install ${{ github.workspace }} --build=missing -o platform=steam + working-directory: ${{ runner.temp }}/build + - name: Build ModShot + run: conan build ${{ github.workspace }} + working-directory: ${{ runner.temp }}/build + - name: Create dist folder + run: | + mkdir ${{ runner.temp }}/dist && + ${{ github.workspace }}/make-linux-dist.sh ${{ runner.temp }}/build ${{ runner.temp }}/dist && + cd ${{ runner.temp }}/dist && + rm oneshot && + tar czf ${{ runner.temp }}/modshot_${{ github.sha }}.tar.gz . + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: modshot_build_steam_linux_${{ github.sha }} + path: ${{ runner.temp }}/modshot_${{ github.sha }}.tar.gz diff --git a/.gitignore b/.gitignore index e388fcf8..5721b7d5 100644 --- a/.gitignore +++ b/.gitignore @@ -65,4 +65,4 @@ src/version.h !build-entrypoint-linux.sh !build-entrypoint-windows.bat -conan.lock +.vscode diff --git a/CMakeLists.txt b/CMakeLists.txt index 6607d176..5141431a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,10 @@ conan_basic_setup(TARGETS) ## Setup options ## +# Note this option only adds steamshim_child into oneshot. +# It's outside this repo's responsibility to compile the parent. +# Contact rkevin for details. option(STEAM "Build for Steam" OFF) -set(STEAMWORKS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/steamworks" CACHE PATH "Path to Steamworks folder") option(DEBUG "Debug mode" OFF) ## Misc setup ## @@ -272,6 +274,7 @@ set(BINDING_SOURCE binding-mri/chroma-binding.cpp binding-mri/niko-binding.cpp binding-mri/modshot-window-binding.cpp + binding-mri/aleffect-binding.cpp ) source_group("Binding Source" FILES ${BINDING_SOURCE} ${BINDING_HEADERS}) @@ -307,17 +310,7 @@ IF(APPLE) add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND cmake -P "${CMAKE_SOURCE_DIR}/patches/mac/CompleteBundle.cmake" VERBATIM) ENDIF() -if(STEAM) - add_subdirectory(steamshim_parent) - - # steam_appid.txt - configure_file( - "${CMAKE_SOURCE_DIR}/steam_appid.txt" - "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/steam_appid.txt" - COPYONLY) -endif() - -if(WIN32) +if(WIN32 AND NOT STEAM) add_executable("oneshot-shim" WIN32 "${CMAKE_SOURCE_DIR}/windows/shim.c" "${CMAKE_SOURCE_DIR}/assets/resources.rc") diff --git a/README.md b/README.md index f14d0534..70acefe7 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,15 @@ Thanks to [rkevin-arch](https://github.com/rkevin-arch) for the docker build! > > It is licensed under the GNU General Public License v2+. -*OneShot* also makes use of [steamshim](https://hg.icculus.org/icculus/steamshim/) for GPL compliance while making use of Steamworks features. See LICENSE.steamshim.txt for details. +*ModShot* also makes use of [steamshim](https://hg.icculus.org/icculus/steamshim/) for GPL compliance while making use of Steamworks features. See LICENSE.steamshim.txt for details. +You can compile ModShot with steam without compiling steamshim, but you will need to source the steamshim binary yourself. # Purpose -> Modshot makes full use of all of these and is designed to add features not added in vanilla OneShot. It adds a number of new features and aims to make modding easier, whilst adding general purpose and specialized features, such as custom window titles, discord rich presence, chroma support, and much more. With this, oneshot now reads Scripts.rxdata instead of xScripts.rxdata, meaning modders won't have to delete and rename files constantly. Feel free to make pull requests of features you would like to see. +> Modshot makes full use of all of these and is designed to add features not added in vanilla ModShot. It adds a number of new features and aims to make modding easier, whilst adding general purpose and specialized features, such as custom window titles, discord rich presence, chroma support, and much more. With this, oneshot now reads Scripts.rxdata instead of xScripts.rxdata, meaning modders won't have to delete and rename files constantly. Feel free to make pull requests of features you would like to see. # Usage Please credit the project in some wayy, either by a direct title card, or some other means. - - Main features currently: @@ -41,13 +40,15 @@ Please credit the project in some wayy, either by a direct title card, or some o > A wiki is in progress and will be made when more features are added. ### Supported image/audio formats -These depend on the SDL auxiliary libraries. *OneShot* only makes use of bmp/png for images and oggvorbis/wav for audio. +These depend on the SDL auxiliary libraries. *ModShot* only makes use of bmp/png for images and oggvorbis/wav for audio. + +To run *ModShot*, you should have a graphics card capable of at least **OpenGL (ES) 2.0** with an up-to-date driver installed. -To run *OneShot*, you should have a graphics card capable of at least **OpenGL (ES) 2.0** with an up-to-date driver installed. +To run *ModShot*, you must also have a x64 system. Currently, compiling for x86 is unsupported. ## Configuration -*OneShot* reads configuration data from the file "oneshot.conf". The format is ini-style. Do *not* use quotes around file paths (spaces won't break). Lines starting with '#' are comments. See 'oneshot.conf.sample' for a list of accepted entries. +*ModShot* reads configuration data from the file "oneshot.conf". The format is ini-style. Do *not* use quotes around file paths (spaces won't break). Lines starting with '#' are comments. See 'oneshot.conf.sample' for a list of accepted entries. Note that this feature appears to be brpken for the moment until we get around to fixing it. Using command line options does work, however. All option entries can alternatively be specified as command line options. Any options that are not arrays (eg. preloaded scripts) specified as command line options will override entries in oneshot.conf. Note that you will have to wrap values containing spaces in quotes (unlike in oneshot.conf). @@ -55,3 +56,10 @@ The syntax is: `--