Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase & Squash the English Rework #18

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 15 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@ on:

jobs:
build:
name: ${{ matrix.platform.name }} ${{ matrix.config.name }} ${{ matrix.arch.name }}
name: ${{ matrix.platform.name }} ${{ matrix.config.name }}
runs-on: ${{ matrix.platform.os }}

strategy:
fail-fast: false
matrix:
platform:
- { name: Windows VS2019, os: windows-2019 }
- { name: Windows VS2022, os: windows-2022 }
arch:
- { name: X86, flag: Win32 }
- { name: X64, flag: x64 }
- { name: Windows VS2019 X86, os: windows-2019, flags: -A Win32 }
- { name: Windows VS2019 X64, os: windows-2019, flags: -A x64 }
- { name: Windows VS2022 X86, os: windows-2022, flags: -A Win32 }
- { name: Windows VS2022 X64, os: windows-2022, flags: -A x64 }
- { name: Linux GCC, os: ubuntu-latest }
- { name: Linux Clang, os: ubuntu-latest, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ }
config:
- { name: Shared, flags: -DBUILD_SHARED_LIBS=TRUE }
- { name: Static, flags: -DBUILD_SHARED_LIBS=FALSE }
Expand All @@ -37,9 +38,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install Linux Dependencies
if: runner.os == 'Linux'
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

- name: Configure
shell: bash
run: cmake -A ${{ matrix.arch.flag }} -S . -B build -DCMAKE_INSTALL_PREFIX=install ${{ matrix.platform.flags }} ${{ matrix.config.flags }}
run: cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install ${{ matrix.platform.flags }} ${{ matrix.config.flags }}

- name: Build
shell: bash
Expand All @@ -52,15 +57,15 @@ jobs:
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: Schiffbruch-${{ matrix.platform.name }}-${{ matrix.config.name }}-${{ matrix.arch.name }}
name: Schiffbruch-${{ matrix.platform.name }}-${{ matrix.config.name }}
path: ./install/bin/*

- name: Get Artifact
id: get_artifact
if: startsWith(github.ref, 'refs/tags/')
uses: actions/download-artifact@v3
with:
name: Schiffbruch-${{ matrix.platform.name }}-${{ matrix.config.name }}-${{ matrix.arch.name }}
name: Schiffbruch-${{ matrix.platform.name }}-${{ matrix.config.name }}

- name: Create Release
id: create_release
Expand All @@ -81,5 +86,5 @@ jobs:
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.get_artifact.outputs.download-path }}
asset_name: Schiffbruch-${{ matrix.platform.name }}-${{ matrix.config.name }}-${{ matrix.arch.name }}.zip
asset_name: Schiffbruch-${{ matrix.platform.name }}-${{ matrix.config.name }}.zip
asset_content_type: application/zip
125 changes: 118 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,82 @@ FetchContent_Declare(SFML
GIT_TAG 2.6.x)
FetchContent_MakeAvailable(SFML)

add_executable(Schiffbruch WIN32
option(ENABLE_IPO "Enable link-time optimization, improves speed and memory usage (https://en.wikipedia.org/wiki/Interprocedural_optimization)")
if(ENABLE_IPO)
include(CheckIPOSupported)
check_ipo_supported(RESULT IPO_AVAILABLE OUTPUT IPO_ERROR)
if (IPO_AVAILABLE)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION True)

if (CMAKE_COMPILER_IS_GNUCXX)
message(STATUS "Enabling all link time optimizations")
add_definitions(-fuse-linker-plugin)
else()
message(STATUS "Disabling linker plugin for link time optimization")
endif()
else()
message(STATUS "IPO/LTO not supported: <${IPO_ERROR}>")
endif()
else()
message(STATUS "Not enabling IPO/LTO")
endif()

option(ENABLE_SANITIZERS "Enable runtime sanitizing (for development)")
if(ENABLE_SANITIZERS)
message("Enabling asan and ubsan")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")
endif()

add_subdirectory(tools/resgen)

add_resource(MISC_BMP "bin/images/Misc.BMP")
add_resource(PANEL_PNG "bin/images/Panel.png")
add_resource(GUYANI_BMP "bin/images/GuyAni.bmp")
add_resource(ANIMATION_BMP "bin/images/Animation.BMP")
add_resource(BAUM_BMP "bin/images/Baum.bmp")
add_resource(CURSOR_BMP "bin/images/Cursor.BMP")
add_resource(BUTTONS_BMP "bin/images/Buttons.bmp")
add_resource(SCHRIFT2_BMP "bin/images/Schrift2.bmp")
add_resource(SCHRIFT1_BMP "bin/images/Schrift1.BMP")
add_resource(TEXTFELD_BMP "bin/images/Textfeld.bmp")
add_resource(PAPIER_BMP "bin/images/Papier.bmp")
add_resource(INVENTAR_BMP "bin/images/Inventar.bmp")
add_resource(BAU_BMP "bin/images/Bau.bmp")
add_resource(CREDITS_BMP "bin/images/Credits.bmp")
add_resource(LOGO_BMP "bin/images/Logo.bmp")
add_resource(LOGO_PNG "bin/images/Logo.png")

add_resource(ABSPANN_WAV "bin/sounds/abspann.wav")
add_resource(ANGEL_WAV "bin/sounds/angel.wav")
add_resource(BAUMFAELLT_WAV "bin/sounds/baumfaellt.wav")
add_resource(BRANDUNG_WAV "bin/sounds/brandung.wav")
add_resource(CRASH_WAV "bin/sounds/crash.wav")
add_resource(ERFINDUNG_WAV "bin/sounds/erfindung.wav")
add_resource(FAELLEN_WAV "bin/sounds/faellen.wav")
add_resource(FEUER_WAV "bin/sounds/feuer.wav")
add_resource(FLUSS_WAV "bin/sounds/fluss.wav")
add_resource(HAMMER_WAV "bin/sounds/hammer.wav")
add_resource(KLICK2_WAV "bin/sounds/klick2.wav")
add_resource(KLICK_WAV "bin/sounds/klick.wav")
add_resource(KNISTERN_WAV "bin/sounds/knistern.wav")
add_resource(LOGO_WAV "bin/sounds/logo.wav")
add_resource(PLATSCH_WAV "bin/sounds/platsch.wav")
add_resource(SCHAUFELN_WAV "bin/sounds/schaufeln.wav")
add_resource(SCHLAGEN_WAV "bin/sounds/schlagen.wav")
add_resource(SCHLEUDER_WAV "bin/sounds/schleuder.wav")
add_resource(SCHNARCHEN_WAV "bin/sounds/schnarchen.wav")
add_resource(SCHWIMMEN_WAV "bin/sounds/schwimmen.wav")
add_resource(STURM_WAV "bin/sounds/sturm.wav")
add_resource(TRINKEN_WAV "bin/sounds/trinken.wav")
add_resource(WALD_WAV "bin/sounds/wald.wav")
add_resource(WOLF_WAV "bin/sounds/wolf.wav")

include_directories(${PROJECT_BINARY_DIR})

add_executable(Schiffbruch
src/Action.cpp
src/Application.cpp
src/ddutil.cpp
src/Direct.cpp
src/Game.cpp
src/globals.cpp
Expand All @@ -20,11 +92,11 @@ add_executable(Schiffbruch WIN32
src/Routing.cpp
src/Sound.cpp
src/World.cpp
src/strings_en.cpp

src/Action.hpp
src/Application.hpp
src/constants.hpp
src/ddutil.h
src/Direct.hpp
src/extern.hpp
src/Game.hpp
Expand All @@ -38,11 +110,51 @@ add_executable(Schiffbruch WIN32
src/types.hpp
src/World.hpp

src/Schiffbruch.rc
${MISC_BMP}
${PANEL_PNG}
${GUYANI_BMP}
${ANIMATION_BMP}
${BAUM_BMP}
${CURSOR_BMP}
${BUTTONS_BMP}
${SCHRIFT2_BMP}
${SCHRIFT1_BMP}
${TEXTFELD_BMP}
${PAPIER_BMP}
${INVENTAR_BMP}
${BAU_BMP}
${CREDITS_BMP}
${LOGO_BMP}
${LOGO_PNG}

${ABSPANN_WAV}
${ANGEL_WAV}
${BAUMFAELLT_WAV}
${BRANDUNG_WAV}
${CRASH_WAV}
${ERFINDUNG_WAV}
${FAELLEN_WAV}
${FEUER_WAV}
${FLUSS_WAV}
${HAMMER_WAV}
${KLICK2_WAV}
${KLICK_WAV}
${KNISTERN_WAV}
${LOGO_WAV}
${PLATSCH_WAV}
${SCHAUFELN_WAV}
${SCHLAGEN_WAV}
${SCHLEUDER_WAV}
${SCHNARCHEN_WAV}
${SCHWIMMEN_WAV}
${STURM_WAV}
${TRINKEN_WAV}
${WALD_WAV}
${WOLF_WAV}
)

target_link_libraries(Schiffbruch PRIVATE sfml-graphics sfml-audio sfml-main dxguid ddraw)
target_compile_features(Schiffbruch PRIVATE cxx_std_17)
target_link_libraries(Schiffbruch PRIVATE sfml-graphics sfml-audio)

# Copy DLLs next to the executable
if (WIN32 AND BUILD_SHARED_LIBS)
Expand All @@ -51,5 +163,4 @@ if (WIN32 AND BUILD_SHARED_LIBS)
endif()

install(DIRECTORY bin/ DESTINATION ${CMAKE_INSTALL_BINDIR})

install(TARGETS Schiffbruch)
install(TARGETS Schiffbruch)
Binary file added bin/images/Logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified bin/images/Panel.bmp
Binary file not shown.
Binary file added bin/images/Panel.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified bin/images/Schrift2.bmp
Binary file not shown.