Skip to content

Commit

Permalink
Merge pull request elizagamedev#1 from Eternabyte/merge-attempt
Browse files Browse the repository at this point in the history
Merge attempt
  • Loading branch information
VIRMSKVLL authored Apr 25, 2021
2 parents ee7ee3c + 2b5d5c0 commit 07348b6
Show file tree
Hide file tree
Showing 33 changed files with 2,314 additions and 128 deletions.
File renamed without changes.
86 changes: 86 additions & 0 deletions .github/workflows/build-steam.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ src/version.h
!build-entrypoint-linux.sh
!build-entrypoint-windows.bat

conan.lock
.vscode
17 changes: 5 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ##
Expand Down Expand Up @@ -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})
Expand Down Expand Up @@ -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")
Expand Down
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<There are a large multitude of additional features modshot adds and it is iddifuclt to explain them all. Please refer to the wiki for in-depth usage.>

Main features currently:

Expand All @@ -41,17 +40,26 @@ 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).

The syntax is: `--<option>=<value>`

Example: `./oneshot --gameFolder="oneshot" --vsync=true`

### External gems

Modshot builds come pre-packaged with the ruby standard library in `/lib/ruby/`. You can require gems from this folder at any point by using `require '<gem>'`.

You can ship your own gems by finding the gem install location (Typically `C:\Ruby27-x64\lib\ruby\gems\2.7.0\gems`), going inside the gem, and copying over all the files inside lib.

Some gems may ship with external dlls/sos, those are a little buggy at the moment, and may throw a loaderror when trying to use them. You may have some success putting the dlls/sos found in `/<gem>/ext/` in `/lib/`.
Loading

0 comments on commit 07348b6

Please sign in to comment.