Skip to content

Commit

Permalink
Merge branch 'main' into decouple-controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
briaguya-ai committed Nov 7, 2023
2 parents 4e87c80 + 07fc296 commit a709799
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 285 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build-validation.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: build-validation
on:
push:
branches:
- 'main'
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ include(cmake/Utils.cmake)
if (CMAKE_SYSTEM_NAME STREQUAL "Windows" AND USE_AUTO_VCPKG)
include(cmake/automate-vcpkg.cmake)

set(VCPKG_TRIPLET x64-windows-static)
set(VCPKG_TARGET_TRIPLET x64-windows-static)
if ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
set(VCPKG_TRIPLET x86-windows-static)
set(VCPKG_TARGET_TRIPLET x86-windows-static)
elseif ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
set(VCPKG_TRIPLET x64-windows-static)
set(VCPKG_TARGET_TRIPLET x64-windows-static)
endif()

vcpkg_bootstrap()
vcpkg_install_packages(zlib bzip2 sdl2 glew)
Expand Down
5 changes: 1 addition & 4 deletions extern/ZAPDUtils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,8 @@ if(MSVC)
)
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
target_compile_options(${PROJECT_NAME} PRIVATE
$<$<CONFIG:Debug>:
/O2;
/Ot
>
$<$<CONFIG:Release>:
/Oi
/Gy
>
/permissive-;
Expand Down
4 changes: 1 addition & 3 deletions include/libultraship/classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
#include "utils/binarytools/BinaryWriter.h"
#include "audio/Audio.h"
#include "audio/AudioPlayer.h"
#if defined(__linux__) || defined(__BSD__)
#include "audio/PulseAudioPlayer.h"
#elif defined(_WIN32)
#if defined(_WIN32)
#include "audio/WasapiAudioPlayer.h"
#endif
#include "audio/SDLAudioPlayer.h"
Expand Down
7 changes: 1 addition & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,11 @@ set(Source_Files__Audio
${CMAKE_CURRENT_SOURCE_DIR}/audio/AudioPlayer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/audio/SDLAudioPlayer.h
${CMAKE_CURRENT_SOURCE_DIR}/audio/SDLAudioPlayer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/audio/PulseAudioPlayer.h
${CMAKE_CURRENT_SOURCE_DIR}/audio/PulseAudioPlayer.cpp
)

if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
list(APPEND Source_Files__Audio ${CMAKE_CURRENT_SOURCE_DIR}/audio/WasapiAudioPlayer.h)
list(APPEND Source_Files__Audio ${CMAKE_CURRENT_SOURCE_DIR}/audio/WasapiAudioPlayer.cpp)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND Source_Files__Audio ${CMAKE_CURRENT_SOURCE_DIR}/audio/PulseAudioPlayer.h)
list(APPEND Source_Files__Audio ${CMAKE_CURRENT_SOURCE_DIR}/audio/PulseAudioPlayer.cpp)
endif()

source_group("audio" FILES ${Source_Files__Audio})
Expand Down Expand Up @@ -217,7 +212,7 @@ set(Source_Files__Log
${CMAKE_CURRENT_SOURCE_DIR}/log/luslog.cpp
)

source_group("Log" FILES ${Source_Files__Log})
source_group("log" FILES ${Source_Files__Log})

target_sources(libultraship PRIVATE ${Source_Files__Log} ${Source_Files__Log__SPDLog})

Expand Down
5 changes: 0 additions & 5 deletions src/audio/Audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ void Audio::InitAudioPlayer() {
case AudioBackend::WASAPI:
mAudioPlayer = std::make_shared<WasapiAudioPlayer>();
break;
#endif
#if defined(__linux)
case AudioBackend::PULSE:
mAudioPlayer = std::make_shared<PulseAudioPlayer>();
break;
#endif
default:
mAudioPlayer = std::make_shared<SDLAudioPlayer>();
Expand Down
2 changes: 0 additions & 2 deletions src/audio/AudioPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ class AudioPlayer {

#ifdef _WIN32
#include "WasapiAudioPlayer.h"
#elif defined(__linux)
#include "PulseAudioPlayer.h"
#endif

#include "SDLAudioPlayer.h"
191 changes: 0 additions & 191 deletions src/audio/PulseAudioPlayer.cpp

This file was deleted.

28 changes: 0 additions & 28 deletions src/audio/PulseAudioPlayer.h

This file was deleted.

9 changes: 3 additions & 6 deletions src/config/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,10 @@ AudioBackend Config::GetAudioBackend() {
return AudioBackend::WASAPI;
}

// Migrate pulse player in config to sdl
if (backendName == "pulse") {
return AudioBackend::PULSE;
SetAudioBackend(AudioBackend::SDL);
return AudioBackend::SDL;
}

if (backendName == "sdl") {
Expand All @@ -190,8 +192,6 @@ AudioBackend Config::GetAudioBackend() {
backendName);
#ifdef _WIN32
return AudioBackend::WASAPI;
#elif defined(__linux)
return AudioBackend::PULSE;
#endif

return AudioBackend::SDL;
Expand All @@ -202,9 +202,6 @@ void Config::SetAudioBackend(AudioBackend backend) {
case AudioBackend::WASAPI:
SetString("Window.AudioBackend", "wasapi");
break;
case AudioBackend::PULSE:
SetString("Window.AudioBackend", "pulse");
break;
case AudioBackend::SDL:
SetString("Window.AudioBackend", "sdl");
break;
Expand Down
Loading

0 comments on commit a709799

Please sign in to comment.