Skip to content

Commit c33a166

Browse files
committed
Enable Linux builds
1 parent b34284a commit c33a166

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

Diff for: .github/workflows/ci.yml

+15-10
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,19 @@ on:
1717

1818
jobs:
1919
build:
20-
name: ${{ matrix.platform.name }} ${{ matrix.config.name }} ${{ matrix.arch.name }}
20+
name: ${{ matrix.platform.name }} ${{ matrix.config.name }}
2121
runs-on: ${{ matrix.platform.os }}
2222

2323
strategy:
2424
fail-fast: false
2525
matrix:
2626
platform:
27-
- { name: Windows VS2019, os: windows-2019 }
28-
- { name: Windows VS2022, os: windows-2022 }
29-
arch:
30-
- { name: X86, flag: Win32 }
31-
- { name: X64, flag: x64 }
27+
- { name: Windows VS2019 X86, os: windows-2019, flags: -A Win32 }
28+
- { name: Windows VS2019 X64, os: windows-2019, flags: -A x64 }
29+
- { name: Windows VS2022 X86, os: windows-2022, flags: -A Win32 }
30+
- { name: Windows VS2022 X64, os: windows-2022, flags: -A x64 }
31+
- { name: Linux GCC, os: ubuntu-latest }
32+
- { name: Linux Clang, os: ubuntu-latest, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ }
3233
config:
3334
- { name: Shared, flags: -DBUILD_SHARED_LIBS=TRUE }
3435
- { name: Static, flags: -DBUILD_SHARED_LIBS=FALSE }
@@ -37,9 +38,13 @@ jobs:
3738
- name: Checkout
3839
uses: actions/checkout@v3
3940

41+
- name: Install Linux Dependencies
42+
if: runner.os == 'Linux'
43+
run: sudo apt-get update && sudo apt-get install libxrandr-dev libxcursor-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev libdrm-dev libgbm-dev
44+
4045
- name: Configure
4146
shell: bash
42-
run: cmake -A ${{ matrix.arch.flag }} -S . -B build -DCMAKE_INSTALL_PREFIX=install ${{ matrix.platform.flags }} ${{ matrix.config.flags }}
47+
run: cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install ${{ matrix.platform.flags }} ${{ matrix.config.flags }}
4348

4449
- name: Build
4550
shell: bash
@@ -52,15 +57,15 @@ jobs:
5257
- name: Upload Artifact
5358
uses: actions/upload-artifact@v3
5459
with:
55-
name: Schiffbruch-${{ matrix.platform.name }}-${{ matrix.config.name }}-${{ matrix.arch.name }}
60+
name: Schiffbruch-${{ matrix.platform.name }}-${{ matrix.config.name }}
5661
path: ./install/bin/*
5762

5863
- name: Get Artifact
5964
id: get_artifact
6065
if: startsWith(github.ref, 'refs/tags/')
6166
uses: actions/download-artifact@v3
6267
with:
63-
name: Schiffbruch-${{ matrix.platform.name }}-${{ matrix.config.name }}-${{ matrix.arch.name }}
68+
name: Schiffbruch-${{ matrix.platform.name }}-${{ matrix.config.name }}
6469

6570
- name: Create Release
6671
id: create_release
@@ -81,5 +86,5 @@ jobs:
8186
with:
8287
upload_url: ${{ steps.create_release.outputs.upload_url }}
8388
asset_path: ${{ steps.get_artifact.outputs.download-path }}
84-
asset_name: Schiffbruch-${{ matrix.platform.name }}-${{ matrix.config.name }}-${{ matrix.arch.name }}.zip
89+
asset_name: Schiffbruch-${{ matrix.platform.name }}-${{ matrix.config.name }}.zip
8590
asset_content_type: application/zip

Diff for: CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ add_executable(Schiffbruch
154154
)
155155

156156
target_compile_features(Schiffbruch PRIVATE cxx_std_17)
157-
target_link_libraries(Schiffbruch PRIVATE sfml-graphics sfml-audio sfml-main dxguid ddraw)
157+
target_link_libraries(Schiffbruch PRIVATE sfml-graphics sfml-audio)
158158

159159
# Copy DLLs next to the executable
160160
if (WIN32 AND BUILD_SHARED_LIBS)

Diff for: src/Renderer.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#define MB_LEFT sf::Mouse::Left;
2121

22-
constexpr auto M_PI = 3.14159265358979323846;
22+
constexpr auto PI = 3.14159265358979323846;
2323

2424
namespace Renderer {
2525

@@ -648,15 +648,15 @@ void DrawPanel()
648648
short diffy = static_cast<short>(Bmp[Tiles::SUN].targetRect.bottom) - static_cast<short>(Bmp[Tiles::SUN].targetRect.top) - Bmp[Tiles::SUN].Height / 2;
649649
short TagesZeit = (Hours * 10 + Minutes * 10 / 60);
650650

651-
DrawPicture(static_cast<short>(Bmp[Tiles::SUN].targetRect.left + diffx * cos(M_PI - M_PI * TagesZeit / 120) + diffx),
652-
static_cast<short>(Bmp[Tiles::SUN].targetRect.top + (-diffy * sin(M_PI - M_PI * TagesZeit / 120) + diffy)),
651+
DrawPicture(static_cast<short>(Bmp[Tiles::SUN].targetRect.left + diffx * cos(PI - PI * TagesZeit / 120) + diffx),
652+
static_cast<short>(Bmp[Tiles::SUN].targetRect.top + (-diffy * sin(PI - PI * TagesZeit / 120) + diffy)),
653653
Tiles::SUN, Bmp[Tiles::SUN].targetRect, false, -1);
654654

655655
// Rettungsring
656656
short Ringtmp;
657657

658658
if (Chance < 100) {
659-
Ringtmp = static_cast<short>(100 * sin(M_PI / 200 * Chance));
659+
Ringtmp = static_cast<short>(100 * sin(PI / 200 * Chance));
660660
} else {
661661
Ringtmp = 100;
662662
}
@@ -1069,7 +1069,7 @@ void ShowCredits()
10691069
for (int z = 1; z < 10; z++) {
10701070
if (CreditsList[CreditsNum][z].IsRunning) {
10711071
CreditsBlt(CreditsList[CreditsNum][z].Picture,
1072-
static_cast<short>(100 * sin(M_PI / MAX_SCREEN_Y * (Bmp[CreditsList[CreditsNum][z].Picture].targetRect.top +
1072+
static_cast<short>(100 * sin(PI / MAX_SCREEN_Y * (Bmp[CreditsList[CreditsNum][z].Picture].targetRect.top +
10731073
Bmp[CreditsList[CreditsNum][z].IsRunning].Height / 2))));
10741074
}
10751075
}

0 commit comments

Comments
 (0)