Skip to content

Commit e02e8b4

Browse files
authored
Reorganize the code base (#81)
* Reorganize the code base, bump MetaHookSv and libsndfile to latest, make libsndfile static-link to MetaAudio.dll * remove unused files. * Adding headers to project * refactoring snd_hook.cpp, with modern pattern search. * remove unused interface.cpp * update github action * Add OpenAL32.dll * move AL DLL * update CMakeLists.txt * remove unused shit. * Don't forget to copy OpenAL32.dll * fix action. * Fix crash in 6153 * update README.md * update README.md * Remove compiled libsndfile * bump OpenAL-soft * fix livebuild action * update README.md * cleanup submodules. * Add ogg and flac support. * update README.md
1 parent 43bcab6 commit e02e8b4

73 files changed

Lines changed: 2479 additions & 5928 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 0 additions & 121 deletions
This file was deleted.

.github/workflows/livebuild.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: windows
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
env:
10+
# Path to the solution file relative to the root of the project.
11+
SOLUTION_FILE_PATH: .
12+
13+
# Configuration type to build.
14+
# You can convert this to a build matrix if you need coverage of multiple configuration types.
15+
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
16+
BUILD_CONFIGURATION: Release
17+
18+
jobs:
19+
build:
20+
runs-on: windows-latest
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
submodules: recursive
26+
fetch-depth: 0
27+
28+
- name: Get branch name
29+
run: echo "BranchName=$env:GITHUB_REF_NAME" >> $env:GITHUB_ENV
30+
31+
- name: Get commit hash
32+
run: echo "CommitHash=$(git rev-parse --short=7 HEAD)" >> $env:GITHUB_ENV
33+
34+
- name: Get commit count
35+
run: echo "CommitCount=$(git rev-list --count ${{env.BranchName}})" >> $env:GITHUB_ENV
36+
37+
- name: Get current date
38+
run: echo "CurrentDate=$(date +'%Y-%m-%d')" >> $env:GITHUB_ENV
39+
40+
- name: Build MetaAudio.dll
41+
working-directory: ${{env.GITHUB_WORKSPACE}}
42+
run: scripts\build-MetaAudio-x86-Release.bat
43+
shell: cmd
44+
45+
- name: Create Output directory
46+
run: |
47+
mkdir "Build-Output"
48+
mkdir "Build-Output\metahook"
49+
mkdir "Build-Output\metahook\plugins"
50+
mkdir "Build-Output\metahook\dlls"
51+
shell: cmd
52+
53+
- name: Copy dlls to Output
54+
run: |
55+
copy "install\x86\Release\bin\MetaAudio.dll" "Build-Output\metahook\plugins"
56+
copy "install\x86\Release\bin\sndfile.dll" "Build-Output\metahook\dlls"
57+
copy "install\x86\Release\bin\OpenAL32.dll" "Build-Output\metahook\dlls"
58+
shell: cmd
59+
60+
- name: Upload a Build Artifact
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: MetaAudio-windows-x86.zip
64+
path: Build-Output

.github/workflows/release.yml

Lines changed: 31 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ name: windows
33
on:
44
push:
55
tags:
6-
- "v*"
7-
pull_request:
8-
tags:
9-
- "v*"
6+
- 'v*'
7+
108

119
env:
1210
# Path to the solution file relative to the root of the project.
@@ -19,90 +17,56 @@ env:
1917

2018
jobs:
2119
build:
22-
23-
runs-on: windows-2019
24-
if: github.repository == 'LAGonauta/MetaAudio'
20+
runs-on: windows-latest
2521

2622
steps:
2723
- uses: actions/checkout@v4
2824
with:
2925
submodules: recursive
26+
fetch-depth: 0
3027

31-
- name: Init dependencies
32-
working-directory: ${{env.GITHUB_WORKSPACE}}
33-
run: build-initdeps.bat
34-
shell: cmd
28+
- name: Get branch name
29+
run: echo "BranchName=$env:GITHUB_REF_NAME" >> $env:GITHUB_ENV
3530

36-
- name: Build MetaAudio.dll
37-
working-directory: ${{env.GITHUB_WORKSPACE}}
38-
run: build-MetaAudio.bat
39-
shell: cmd
31+
- name: Get commit hash
32+
run: echo "CommitHash=$(git rev-parse --short=7 HEAD)" >> $env:GITHUB_ENV
33+
34+
- name: Get commit count
35+
run: echo "CommitCount=$(git rev-list --count ${{env.BranchName}})" >> $env:GITHUB_ENV
4036

41-
- name: Create Output directory
42-
working-directory: ${{env.GITHUB_WORKSPACE}}
43-
run: mkdir Output
44-
shell: cmd
37+
- name: Get current date
38+
run: echo "CurrentDate=$(date +'%Y-%m-%d')" >> $env:GITHUB_ENV
4539

46-
- name: Copy Build to Output
47-
working-directory: ${{env.GITHUB_WORKSPACE}}
48-
run: |
49-
mkdir "Output\${{env.BUILD_CONFIGURATION}}"
50-
xcopy "Build\${{env.BUILD_CONFIGURATION}}\MetaAudio.dll" "Output\${{env.BUILD_CONFIGURATION}}" /y /e
51-
shell: cmd
52-
53-
- name: Copy SteamAppsLocation to Output
40+
- name: Build MetaAudio.dll
5441
working-directory: ${{env.GITHUB_WORKSPACE}}
55-
run: |
56-
mkdir "Output\SteamAppsLocation"
57-
copy "SteamAppsLocation\SteamAppsLocation.exe" "Output\SteamAppsLocation" /y
58-
copy "SteamAppsLocation\steam_appid.txt" "Output\SteamAppsLocation" /y
59-
copy "SteamAppsLocation\steam_api.dll" "Output\SteamAppsLocation" /y
42+
run: scripts\build-MetaAudio-x86-Release.bat
6043
shell: cmd
6144

62-
- name: Copy sndfile to Output
63-
working-directory: ${{env.GITHUB_WORKSPACE}}
45+
- name: Create Output directory
6446
run: |
65-
xcopy "externals\libsndfile\lib\sndfile.dll" "Output\externals\libsndfile\lib\" /y /e
47+
mkdir "Build-Output"
48+
mkdir "Build-Output\metahook"
49+
mkdir "Build-Output\metahook\plugins"
50+
mkdir "Build-Output\metahook\dlls"
6651
shell: cmd
6752

68-
- name: Copy install bat to Output
69-
working-directory: ${{env.GITHUB_WORKSPACE}}
53+
- name: Copy dlls to Output
7054
run: |
71-
copy "install-to-OpposingForce.bat" "Output" /y
72-
copy "install-to-HalfLife.bat" "Output" /y
73-
copy "install-to-DayOfDefeat.bat" "Output" /y
74-
copy "install-to-CSCZDeletedScenes.bat" "Output" /y
75-
copy "install-to-CounterStrike.bat" "Output" /y
76-
copy "install-to-ConditionZero.bat" "Output" /y
77-
copy "install-to-BlueShift.bat" "Output" /y
55+
copy "install\x86\Release\bin\MetaAudio.dll" "Build-Output\metahook\plugins"
56+
copy "install\x86\Release\bin\sndfile.dll" "Build-Output\metahook\dlls"
57+
copy "install\x86\Release\bin\OpenAL32.dll" "Build-Output\metahook\dlls"
7858
shell: cmd
79-
80-
- name: Download MetaHook
81-
run: |
82-
Invoke-WebRequest -Uri https://github.com/hzqst/MetaHookSv/releases/download/v20231210a/MetaHookSv-windows-x86.zip -OutFile MetaHook.zip
83-
if (!(Get-FileHash ./MetaHook.zip).Hash.Equals("E5F3DB974C0D00241125757A6CE83E1BCF114D156E8E3E27C7622CAE7DDE36A1")) {
84-
Exit -1
85-
}
86-
Expand-Archive ./MetaHook.zip -DestinationPath MetaHook/
87-
New-Item -Type dir -Force ./Output/${{env.BUILD_CONFIGURATION}}
88-
Copy-Item ./MetaHook/Build/svencoop.exe ./Output/${{env.BUILD_CONFIGURATION}}/metahook.exe
89-
shell: pwsh
90-
59+
9160
- name: Zipping All
92-
uses: vimtor/action-zip@v1.1
93-
with:
94-
files: Output/
95-
dest: MetaAudio-windows-x86.zip
96-
97-
- uses: actions/upload-artifact@v3
61+
uses: vimtor/action-zip@v1
9862
with:
99-
name: MetaAudio
100-
path: MetaAudio-windows-x86.zip
63+
files: Build-Output/
64+
dest: MetaAudio-windows-x86.zip
10165

10266
- name: Create Release
10367
uses: softprops/action-gh-release@v1
10468
if: startsWith(github.ref, 'refs/tags/')
10569
with:
106-
name: MetaAudio-${{ github.ref }}
107-
files: |
108-
MetaAudio-windows-x86.zip
70+
name: MetaAudio-${{ github.ref }}
71+
files: |
72+
MetaAudio-windows-x86.zip

.gitmodules

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,21 @@
88
[submodule "externals/MetaHookSv"]
99
path = externals/MetaHookSv
1010
url = https://github.com/hzqst/MetaHookSv
11+
[submodule "externals/ogg"]
12+
path = externals/ogg
13+
url = https://github.com/xiph/ogg
14+
[submodule "externals/libsndfile"]
15+
path = externals/libsndfile
16+
url = https://github.com/libsndfile/libsndfile
17+
[submodule "externals/openal-soft"]
18+
path = externals/openal-soft
19+
url = https://github.com/kcat/openal-soft
20+
[submodule "externals/flac"]
21+
path = externals/flac
22+
url = https://github.com/xiph/flac
23+
[submodule "externals/opus"]
24+
path = externals/opus
25+
url = https://github.com/xiph/opus
26+
[submodule "externals/vorbis"]
27+
path = externals/vorbis
28+
url = https://github.com/xiph/vorbis

0 commit comments

Comments
 (0)