Merge branch 'tsourdt3rdport1' into 'next'

SDL_Mixer_X Engine Upgrades

See merge request STJr/SRB2!2400
This commit is contained in:
StarManiaKG 2025-03-22 13:55:41 +00:00
commit c820afd66b
46 changed files with 8142 additions and 998 deletions

View file

@ -0,0 +1,34 @@
# Find SDL2_MixerX
# Once done, this will define
#
# SDL2_MIXERX_FOUND - system has SDL2_MixerX
# SDL2_MIXERX_INCLUDE_DIRS - SDL2_MixerX include directories
# SDL2_MIXERX_LIBRARIES - link libraries
include(LibFindMacros)
libfind_pkg_check_modules(SDL2_MIXERX_PKGCONF SDL2_mixerx)
# includes
find_path(SDL2_MIXERX_INCLUDE_DIR
NAMES SDL_mixer_ext.h
PATHS
${SDL2_MIXERX_PKGCONF_INCLUDE_DIRS}
"/usr/include/SDL2"
"/usr/local/include/SDL2"
)
# library
find_library(SDL2_MIXERX_LIBRARY
NAMES SDL2_mixer_ext
PATHS
${SDL2_MIXERX_PKGCONF_LIBRARY_DIRS}
"/usr/lib"
"/usr/local/lib"
)
# set include dir variables
set(SDL2_MIXERX_PROCESS_INCLUDES SDL2_MIXERX_INCLUDE_DIR)
set(SDL2_MIXERX_PROCESS_LIBS SDL2_MIXERX_LIBRARY)
libfind_process(MIXERX)

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,19 @@
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Import target "SDL2_mixer_ext::SDL2_mixer_ext" for configuration ""
set_property(TARGET SDL2_mixer_ext::SDL2_mixer_ext APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
set_target_properties(SDL2_mixer_ext::SDL2_mixer_ext PROPERTIES
IMPORTED_IMPLIB_NOCONFIG "${_IMPORT_PREFIX}/lib/libSDL2_mixer_ext.dll.a"
IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/bin/SDL2_mixer_ext.dll"
)
list(APPEND _cmake_import_check_targets SDL2_mixer_ext::SDL2_mixer_ext )
list(APPEND _cmake_import_check_files_for_SDL2_mixer_ext::SDL2_mixer_ext "${_IMPORT_PREFIX}/lib/libSDL2_mixer_ext.dll.a" "${_IMPORT_PREFIX}/bin/SDL2_mixer_ext.dll" )
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)

View file

@ -0,0 +1,102 @@
# Generated by CMake
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
message(FATAL_ERROR "CMake >= 2.8.0 required")
endif()
if(CMAKE_VERSION VERSION_LESS "2.8.3")
message(FATAL_ERROR "CMake >= 2.8.3 required")
endif()
cmake_policy(PUSH)
cmake_policy(VERSION 2.8.3...3.26)
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
set(_cmake_targets_defined "")
set(_cmake_targets_not_defined "")
set(_cmake_expected_targets "")
foreach(_cmake_expected_target IN ITEMS SDL2_mixer_ext::SDL2_mixer_ext)
list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
if(TARGET "${_cmake_expected_target}")
list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
else()
list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
endif()
endforeach()
unset(_cmake_expected_target)
if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
unset(_cmake_targets_defined)
unset(_cmake_targets_not_defined)
unset(_cmake_expected_targets)
unset(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)
return()
endif()
if(NOT _cmake_targets_defined STREQUAL "")
string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
endif()
unset(_cmake_targets_defined)
unset(_cmake_targets_not_defined)
unset(_cmake_expected_targets)
# Compute the installation prefix relative to this file.
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
if(_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif()
# Create imported target SDL2_mixer_ext::SDL2_mixer_ext
add_library(SDL2_mixer_ext::SDL2_mixer_ext SHARED IMPORTED)
set_target_properties(SDL2_mixer_ext::SDL2_mixer_ext PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/SDL2"
)
# Load information for each installed configuration.
file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/SDL2_mixer_ext-shared-targets-*.cmake")
foreach(_cmake_config_file IN LISTS _cmake_config_files)
include("${_cmake_config_file}")
endforeach()
unset(_cmake_config_file)
unset(_cmake_config_files)
# Cleanup temporary variables.
set(_IMPORT_PREFIX)
# Loop over all imported files and verify that they actually exist
foreach(_cmake_target IN LISTS _cmake_import_check_targets)
foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
if(NOT EXISTS "${_cmake_file}")
message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
\"${_cmake_file}\"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
\"${CMAKE_CURRENT_LIST_FILE}\"
but not all the files it references.
")
endif()
endforeach()
unset(_cmake_file)
unset("_cmake_import_check_files_for_${_cmake_target}")
endforeach()
unset(_cmake_target)
unset(_cmake_import_check_targets)
# This file does not depend on other imported targets which have
# been exported from the same project but in a separate export set.
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)

View file

@ -0,0 +1,19 @@
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Import target "SDL2_mixer_ext::SDL2_mixer_ext_Static" for configuration ""
set_property(TARGET SDL2_mixer_ext::SDL2_mixer_ext_Static APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
set_target_properties(SDL2_mixer_ext::SDL2_mixer_ext_Static PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_NOCONFIG "C;CXX"
IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/lib/libSDL2_mixer_ext.a"
)
list(APPEND _cmake_import_check_targets SDL2_mixer_ext::SDL2_mixer_ext_Static )
list(APPEND _cmake_import_check_files_for_SDL2_mixer_ext::SDL2_mixer_ext_Static "${_IMPORT_PREFIX}/lib/libSDL2_mixer_ext.a" )
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)

View file

@ -0,0 +1,107 @@
# Generated by CMake
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
message(FATAL_ERROR "CMake >= 2.8.0 required")
endif()
if(CMAKE_VERSION VERSION_LESS "2.8.3")
message(FATAL_ERROR "CMake >= 2.8.3 required")
endif()
cmake_policy(PUSH)
cmake_policy(VERSION 2.8.3...3.26)
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
set(_cmake_targets_defined "")
set(_cmake_targets_not_defined "")
set(_cmake_expected_targets "")
foreach(_cmake_expected_target IN ITEMS SDL2_mixer_ext::SDL2_mixer_ext_Static)
list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
if(TARGET "${_cmake_expected_target}")
list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
else()
list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
endif()
endforeach()
unset(_cmake_expected_target)
if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
unset(_cmake_targets_defined)
unset(_cmake_targets_not_defined)
unset(_cmake_expected_targets)
unset(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)
return()
endif()
if(NOT _cmake_targets_defined STREQUAL "")
string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
endif()
unset(_cmake_targets_defined)
unset(_cmake_targets_not_defined)
unset(_cmake_expected_targets)
# Compute the installation prefix relative to this file.
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
if(_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif()
# Create imported target SDL2_mixer_ext::SDL2_mixer_ext_Static
add_library(SDL2_mixer_ext::SDL2_mixer_ext_Static STATIC IMPORTED)
set_target_properties(SDL2_mixer_ext::SDL2_mixer_ext_Static PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/SDL2"
INTERFACE_LINK_LIBRARIES "C:/msys64/home/Drayt/Github/codecbuild32/lib/libopusfile.a;C:/msys64/home/Drayt/Github/codecbuild32/lib/libopus.a;C:/msys64/home/Drayt/Github/codecbuild32/lib/libopusfile.a;C:/msys64/home/Drayt/Github/codecbuild32/lib/libwavpack.a;C:/msys64/home/Drayt/Github/codecbuild32/lib/libmodplug.a;C:/msys64/home/Drayt/Github/BittenTSoURDt3rd/libs/gme/win32/libgme.dll.a;C:/msys64/mingw32/lib/libz.dll.a;C:/msys64/home/Drayt/Github/codecbuild32/lib/libOPNMIDI.a;C:/msys64/home/Drayt/Github/codecbuild32/bin/libfluidlite.dll;C:/msys64/home/Drayt/Github/codecbuild32/lib/libvorbisfile.a;C:/msys64/home/Drayt/Github/codecbuild32/lib/libvorbis.a;C:/msys64/home/Drayt/Github/codecbuild32/lib/libvorbisfile.a;winmm;C:/msys64/home/Drayt/Github/codecbuild32/lib/libogg.a;SDL2::SDL2;SDL2::SDL2main;stdc++"
)
if(CMAKE_VERSION VERSION_LESS 2.8.12)
message(FATAL_ERROR "This file relies on consumers using CMake 2.8.12 or greater.")
endif()
# Load information for each installed configuration.
file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/SDL2_mixer_ext-static-targets-*.cmake")
foreach(_cmake_config_file IN LISTS _cmake_config_files)
include("${_cmake_config_file}")
endforeach()
unset(_cmake_config_file)
unset(_cmake_config_files)
# Cleanup temporary variables.
set(_IMPORT_PREFIX)
# Loop over all imported files and verify that they actually exist
foreach(_cmake_target IN LISTS _cmake_import_check_targets)
foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
if(NOT EXISTS "${_cmake_file}")
message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
\"${_cmake_file}\"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
\"${CMAKE_CURRENT_LIST_FILE}\"
but not all the files it references.
")
endif()
endforeach()
unset(_cmake_file)
unset("_cmake_import_check_files_for_${_cmake_target}")
endforeach()
unset(_cmake_target)
unset(_cmake_import_check_targets)
# This file does not depend on other imported targets which have
# been exported from the same project but in a separate export set.
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)

View file

@ -0,0 +1,39 @@
include(FeatureSummary)
set_package_properties(SDL2_mixer_ext PROPERTIES
URL "https://wohlsoft.github.io/SDL-Mixer-X"
DESCRIPTION "SDL Mixer X, a fork of SDL_mixer, a mixer library for Simple DirectMedia Layer"
)
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
####### Any changes to this file will be overwritten by the next CMake run ####
####### The input file was SDL2_mixer_extConfig.cmake.in ########
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
macro(set_and_check _var _file)
set(${_var} "${_file}")
if(NOT EXISTS "${_file}")
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
endif()
endmacro()
macro(check_required_components _NAME)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(NOT ${_NAME}_${comp}_FOUND)
if(${_NAME}_FIND_REQUIRED_${comp})
set(${_NAME}_FOUND FALSE)
endif()
endif()
endforeach()
endmacro()
####################################################################################
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2_mixer_ext-shared-targets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/SDL2_mixer_ext-shared-targets.cmake")
endif()
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2_mixer_ext-static-targets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/SDL2_mixer_ext-static-targets.cmake")
endif()

View file

@ -0,0 +1,12 @@
prefix=C:/msys64/home/Drayt/Github/i686-w64-mingw
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: SDL2_mixer_ext
Description: SDL Mixer X, a fork of SDL_mixer, a mixer library for Simple DirectMedia Layer
Version: 2.7.0.0
Requires: sdl2 >= 2.0.7
Libs: -L${libdir} -lSDL2_mixer_ext
Cflags: -I${includedir}/SDL2

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,19 @@
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Import target "SDL2_mixer_ext::SDL2_mixer_ext" for configuration ""
set_property(TARGET SDL2_mixer_ext::SDL2_mixer_ext APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
set_target_properties(SDL2_mixer_ext::SDL2_mixer_ext PROPERTIES
IMPORTED_IMPLIB_NOCONFIG "${_IMPORT_PREFIX}/lib/libSDL2_mixer_ext.dll.a"
IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/bin/SDL2_mixer_ext.dll"
)
list(APPEND _cmake_import_check_targets SDL2_mixer_ext::SDL2_mixer_ext )
list(APPEND _cmake_import_check_files_for_SDL2_mixer_ext::SDL2_mixer_ext "${_IMPORT_PREFIX}/lib/libSDL2_mixer_ext.dll.a" "${_IMPORT_PREFIX}/bin/SDL2_mixer_ext.dll" )
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)

View file

@ -0,0 +1,102 @@
# Generated by CMake
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
message(FATAL_ERROR "CMake >= 2.8.0 required")
endif()
if(CMAKE_VERSION VERSION_LESS "2.8.3")
message(FATAL_ERROR "CMake >= 2.8.3 required")
endif()
cmake_policy(PUSH)
cmake_policy(VERSION 2.8.3...3.26)
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
set(_cmake_targets_defined "")
set(_cmake_targets_not_defined "")
set(_cmake_expected_targets "")
foreach(_cmake_expected_target IN ITEMS SDL2_mixer_ext::SDL2_mixer_ext)
list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
if(TARGET "${_cmake_expected_target}")
list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
else()
list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
endif()
endforeach()
unset(_cmake_expected_target)
if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
unset(_cmake_targets_defined)
unset(_cmake_targets_not_defined)
unset(_cmake_expected_targets)
unset(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)
return()
endif()
if(NOT _cmake_targets_defined STREQUAL "")
string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
endif()
unset(_cmake_targets_defined)
unset(_cmake_targets_not_defined)
unset(_cmake_expected_targets)
# Compute the installation prefix relative to this file.
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
if(_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif()
# Create imported target SDL2_mixer_ext::SDL2_mixer_ext
add_library(SDL2_mixer_ext::SDL2_mixer_ext SHARED IMPORTED)
set_target_properties(SDL2_mixer_ext::SDL2_mixer_ext PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/SDL2"
)
# Load information for each installed configuration.
file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/SDL2_mixer_ext-shared-targets-*.cmake")
foreach(_cmake_config_file IN LISTS _cmake_config_files)
include("${_cmake_config_file}")
endforeach()
unset(_cmake_config_file)
unset(_cmake_config_files)
# Cleanup temporary variables.
set(_IMPORT_PREFIX)
# Loop over all imported files and verify that they actually exist
foreach(_cmake_target IN LISTS _cmake_import_check_targets)
foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
if(NOT EXISTS "${_cmake_file}")
message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
\"${_cmake_file}\"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
\"${CMAKE_CURRENT_LIST_FILE}\"
but not all the files it references.
")
endif()
endforeach()
unset(_cmake_file)
unset("_cmake_import_check_files_for_${_cmake_target}")
endforeach()
unset(_cmake_target)
unset(_cmake_import_check_targets)
# This file does not depend on other imported targets which have
# been exported from the same project but in a separate export set.
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)

View file

@ -0,0 +1,19 @@
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Import target "SDL2_mixer_ext::SDL2_mixer_ext_Static" for configuration ""
set_property(TARGET SDL2_mixer_ext::SDL2_mixer_ext_Static APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
set_target_properties(SDL2_mixer_ext::SDL2_mixer_ext_Static PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_NOCONFIG "C;CXX"
IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/lib/libSDL2_mixer_ext.a"
)
list(APPEND _cmake_import_check_targets SDL2_mixer_ext::SDL2_mixer_ext_Static )
list(APPEND _cmake_import_check_files_for_SDL2_mixer_ext::SDL2_mixer_ext_Static "${_IMPORT_PREFIX}/lib/libSDL2_mixer_ext.a" )
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)

View file

@ -0,0 +1,107 @@
# Generated by CMake
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
message(FATAL_ERROR "CMake >= 2.8.0 required")
endif()
if(CMAKE_VERSION VERSION_LESS "2.8.3")
message(FATAL_ERROR "CMake >= 2.8.3 required")
endif()
cmake_policy(PUSH)
cmake_policy(VERSION 2.8.3...3.26)
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
set(_cmake_targets_defined "")
set(_cmake_targets_not_defined "")
set(_cmake_expected_targets "")
foreach(_cmake_expected_target IN ITEMS SDL2_mixer_ext::SDL2_mixer_ext_Static)
list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
if(TARGET "${_cmake_expected_target}")
list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
else()
list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
endif()
endforeach()
unset(_cmake_expected_target)
if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
unset(_cmake_targets_defined)
unset(_cmake_targets_not_defined)
unset(_cmake_expected_targets)
unset(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)
return()
endif()
if(NOT _cmake_targets_defined STREQUAL "")
string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
endif()
unset(_cmake_targets_defined)
unset(_cmake_targets_not_defined)
unset(_cmake_expected_targets)
# Compute the installation prefix relative to this file.
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
if(_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif()
# Create imported target SDL2_mixer_ext::SDL2_mixer_ext_Static
add_library(SDL2_mixer_ext::SDL2_mixer_ext_Static STATIC IMPORTED)
set_target_properties(SDL2_mixer_ext::SDL2_mixer_ext_Static PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/SDL2"
INTERFACE_LINK_LIBRARIES "C:/msys64/home/Drayt/Github/codecbuild64/lib/libopusfile.a;C:/msys64/home/Drayt/Github/codecbuild64/lib/libopus.a;C:/msys64/home/Drayt/Github/codecbuild64/lib/libopusfile.a;C:/msys64/home/Drayt/Github/codecbuild64/lib/libopus.a;C:/msys64/home/Drayt/Github/codecbuild64/lib/libwavpack.a;C:/msys64/home/Drayt/Github/codecbuild64/lib/libwavpack.a;C:/msys64/home/Drayt/Github/codecbuild64/lib/libmodplug.a;C:/msys64/home/Drayt/Github/BittenTSoURDt3rd/libs/gme/win64/libgme.dll.a;C:/msys64/mingw64/lib/libz.dll.a;C:/msys64/home/Drayt/Github/codecbuild64/lib/libOPNMIDI.a;C:/msys64/home/Drayt/Github/codecbuild64/bin/libfluidlite.dll;C:/msys64/home/Drayt/Github/codecbuild64/lib/libvorbisfile.a;C:/msys64/home/Drayt/Github/codecbuild64/lib/libvorbis.a;winmm;C:/msys64/home/Drayt/Github/codecbuild64/lib/libogg.a;SDL2::SDL2;SDL2::SDL2main;stdc++"
)
if(CMAKE_VERSION VERSION_LESS 2.8.12)
message(FATAL_ERROR "This file relies on consumers using CMake 2.8.12 or greater.")
endif()
# Load information for each installed configuration.
file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/SDL2_mixer_ext-static-targets-*.cmake")
foreach(_cmake_config_file IN LISTS _cmake_config_files)
include("${_cmake_config_file}")
endforeach()
unset(_cmake_config_file)
unset(_cmake_config_files)
# Cleanup temporary variables.
set(_IMPORT_PREFIX)
# Loop over all imported files and verify that they actually exist
foreach(_cmake_target IN LISTS _cmake_import_check_targets)
foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
if(NOT EXISTS "${_cmake_file}")
message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
\"${_cmake_file}\"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
\"${CMAKE_CURRENT_LIST_FILE}\"
but not all the files it references.
")
endif()
endforeach()
unset(_cmake_file)
unset("_cmake_import_check_files_for_${_cmake_target}")
endforeach()
unset(_cmake_target)
unset(_cmake_import_check_targets)
# This file does not depend on other imported targets which have
# been exported from the same project but in a separate export set.
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)

View file

@ -0,0 +1,39 @@
include(FeatureSummary)
set_package_properties(SDL2_mixer_ext PROPERTIES
URL "https://wohlsoft.github.io/SDL-Mixer-X"
DESCRIPTION "SDL Mixer X, a fork of SDL_mixer, a mixer library for Simple DirectMedia Layer"
)
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
####### Any changes to this file will be overwritten by the next CMake run ####
####### The input file was SDL2_mixer_extConfig.cmake.in ########
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
macro(set_and_check _var _file)
set(${_var} "${_file}")
if(NOT EXISTS "${_file}")
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
endif()
endmacro()
macro(check_required_components _NAME)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(NOT ${_NAME}_${comp}_FOUND)
if(${_NAME}_FIND_REQUIRED_${comp})
set(${_NAME}_FOUND FALSE)
endif()
endif()
endforeach()
endmacro()
####################################################################################
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2_mixer_ext-shared-targets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/SDL2_mixer_ext-shared-targets.cmake")
endif()
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2_mixer_ext-static-targets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/SDL2_mixer_ext-static-targets.cmake")
endif()

View file

@ -0,0 +1,12 @@
prefix=C:/msys64/home/Drayt/Github/build64
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: SDL2_mixer_ext
Description: SDL Mixer X, a fork of SDL_mixer, a mixer library for Simple DirectMedia Layer
Version: 2.7.0.0
Requires: sdl2 >= 2.0.7
Libs: -L${libdir} -lSDL2_mixer_ext
Cflags: -I${includedir}/SDL2

View file

@ -209,6 +209,28 @@ if("${SRB2_CONFIG_HWRENDER}")
endif()
endif()
if("${SRB2_CONFIG_HAVE_MIXERX}")
if("${SRB2_CONFIG_USE_INTERNAL_LIBRARIES}")
set(MIXERX_FOUND ON)
if(${SRB2_SYSTEM_BITS} EQUAL 64)
set(MIXERX_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/SDLMixerX/x86_64-w64-mingw32/include/SDL2)
set(MIXERX_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/SDLMixerX/x86_64-w64-mingw32/lib -lSDL2_mixer_ext")
else() # 32-bit
set(MIXERX_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/libs/SDLMixerX/i686-w64-mingw32/include/SDL2)
set(MIXERX_LIBRARIES "-L${CMAKE_SOURCE_DIR}/libs/SDLMixerX/i686-w64-mingw32/lib -lSDL2_mixer_ext")
endif()
else()
find_package(MIXERX)
endif()
if(${MIXERX_FOUND})
set(SRB2_HAVE_MIXERX ON)
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_MIXERX)
else()
message(WARNING "You have specified that SDL Mixer X is available but it was not found.")
endif()
endif()
# Targets
# If using CCACHE, then force it.

View file

@ -90,10 +90,26 @@ boolean I_SongPaused(void)
// MUSIC EFFECTS
/// ------------------------
boolean I_SetSongSpeed(float speed)
void I_SetSongSpeed(float speed) // StarManiaKG: was originally boolean, no longer needs to be //
{
(void)speed;
return false;
return;
}
float I_GetSongSpeed(void)
{
return 0.0f;
}
void I_SetSongPitch(float pitch)
{
(void)pitch;
return;
}
float I_GetSongPitch(void)
{
return 0.0f;
}
/// ------------------------

View file

@ -89,10 +89,26 @@ boolean I_SongPaused(void)
// MUSIC EFFECTS
/// ------------------------
boolean I_SetSongSpeed(float speed)
void I_SetSongSpeed(float speed) // StarManiaKG: was originally boolean, no longer needs to be //
{
(void)speed;
return false;
return;
}
float I_GetSongSpeed(void)
{
return 0.0f;
}
void I_SetSongPitch(float pitch)
{
(void)pitch;
return;
}
float I_GetSongPitch(void)
{
return 0.0f;
}
/// ------------------------

View file

@ -89,10 +89,26 @@ boolean I_SongPaused(void)
// MUSIC EFFECTS
/// ------------------------
boolean I_SetSongSpeed(float speed)
void I_SetSongSpeed(float speed) // StarManiaKG: was originally boolean, no longer needs to be //
{
(void)speed;
return false;
return;
}
float I_GetSongSpeed(void)
{
return 0.0f;
}
void I_SetSongPitch(float pitch)
{
(void)pitch;
return;
}
float I_GetSongPitch(void)
{
return 0.0f;
}
/// ------------------------

View file

@ -143,7 +143,11 @@ boolean I_SongPaused(void);
// MUSIC EFFECTS
/// ------------------------
boolean I_SetSongSpeed(float speed);
void I_SetSongSpeed(float speed); // StarManiaKG: was originally boolean, no longer needs to be //
float I_GetSongSpeed(void);
void I_SetSongPitch(float pitch);
float I_GetSongPitch(void);
/// ------------------------
// MUSIC SEEKING

View file

@ -3387,6 +3387,57 @@ static int lib_sSpeedMusic(lua_State *L)
return 0;
}
static int lib_sGetSpeedMusic(lua_State *L)
{
player_t *player = NULL;
//NOHUD
if (!lua_isnone(L, 1) && lua_isuserdata(L, 1))
{
player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
if (!player)
return LUA_ErrInvalid(L, "player_t");
}
if (!player || P_IsLocalPlayer(player))
lua_pushinteger(L, S_GetSpeedMusic());
else
lua_pushnil(L);
return 1;
}
static int lib_sPitchMusic(lua_State *L)
{
fixed_t fixedpitch = luaL_checkfixed(L, 1);
float pitch = FIXED_TO_FLOAT(fixedpitch);
player_t *player = NULL;
//NOHUD
if (!lua_isnone(L, 2) && lua_isuserdata(L, 2))
{
player = *((player_t **)luaL_checkudata(L, 2, META_PLAYER));
if (!player)
return LUA_ErrInvalid(L, "player_t");
}
if (!player || P_IsLocalPlayer(player))
S_PitchMusic(pitch);
return 0;
}
static int lib_sGetPitchMusic(lua_State *L)
{
player_t *player = NULL;
//NOHUD
if (!lua_isnone(L, 1) && lua_isuserdata(L, 1))
{
player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
if (!player)
return LUA_ErrInvalid(L, "player_t");
}
if (!player || P_IsLocalPlayer(player))
lua_pushinteger(L, S_GetPitchMusic());
else
lua_pushnil(L);
return 1;
}
static int lib_sStopMusic(lua_State *L)
{
player_t *player = NULL;
@ -3423,6 +3474,61 @@ static int lib_sSetInternalMusicVolume(lua_State *L)
return 1;
}
static int lib_sGetInternalMusicVolume(lua_State *L)
{
player_t *player = NULL;
//NOHUD
if (!lua_isnone(L, 1) && lua_isuserdata(L, 1))
{
player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
if (!player)
return LUA_ErrInvalid(L, "player_t");
}
if (!player || P_IsLocalPlayer(player))
lua_pushinteger(L, (UINT32)S_GetInternalMusicVolume());
else
lua_pushnil(L);
return 1;
}
static int lib_sSetInternalSfxVolume(lua_State *L)
{
UINT32 sfxvolume = (UINT32)luaL_checkinteger(L, 1);
player_t *player = NULL;
//NOHUD
if (!lua_isnone(L, 2) && lua_isuserdata(L, 2))
{
player = *((player_t **)luaL_checkudata(L, 2, META_PLAYER));
if (!player)
return LUA_ErrInvalid(L, "player_t");
}
if (!player || P_IsLocalPlayer(player))
{
S_SetInternalSfxVolume(sfxvolume);
lua_pushboolean(L, true);
}
else
lua_pushnil(L);
return 1;
}
static int lib_sGetInternalSfxVolume(lua_State *L)
{
player_t *player = NULL;
//NOHUD
if (!lua_isnone(L, 1) && lua_isuserdata(L, 1))
{
player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
if (!player)
return LUA_ErrInvalid(L, "player_t");
}
if (!player || P_IsLocalPlayer(player))
lua_pushinteger(L, (UINT32)S_GetInternalSfxVolume());
else
lua_pushnil(L);
return 1;
}
static int lib_sStopFadingMusic(lua_State *L)
{
player_t *player = NULL;
@ -4602,8 +4708,14 @@ static luaL_Reg lib[] = {
{"S_StopSoundByID",lib_sStopSoundByID},
{"S_ChangeMusic",lib_sChangeMusic},
{"S_SpeedMusic",lib_sSpeedMusic},
{"S_GetSpeedMusic",lib_sGetSpeedMusic},
{"S_PitchMusic",lib_sPitchMusic},
{"S_GetPitchMusic",lib_sGetPitchMusic},
{"S_StopMusic",lib_sStopMusic},
{"S_SetInternalMusicVolume", lib_sSetInternalMusicVolume},
{"S_GetInternalMusicVolume", lib_sGetInternalMusicVolume},
{"S_SetInternalSfxVolume", lib_sSetInternalSfxVolume},
{"S_GetInternalSfxVolume", lib_sGetInternalSfxVolume},
{"S_StopFadingMusic",lib_sStopFadingMusic},
{"S_FadeMusic",lib_sFadeMusic},
{"S_FadeOutStopMusic",lib_sFadeOutStopMusic},

View file

@ -7846,7 +7846,11 @@ static void M_DrawSoundTest(void)
}
else
{
V_DrawString(x, y, (t == st_sel ? V_YELLOWMAP : 0)|V_ALLOWLOWERCASE, soundtestdefs[t]->title);
if (strlen(soundtestdefs[t]->title) < 17)
V_DrawString(x, y, (t == st_sel ? V_YELLOWMAP : 0)|V_ALLOWLOWERCASE, soundtestdefs[t]->title);
else
V_DrawThinString(x, y, (t == st_sel ? V_YELLOWMAP : 0)|V_ALLOWLOWERCASE, soundtestdefs[t]->title);
if (curplaying == soundtestdefs[t])
{
V_DrawFill(165+140-9, y-4, 8, 16, 150);

View file

@ -4257,7 +4257,7 @@ void A_SuperSneakers(mobj_t *actor)
if (P_IsLocalPlayer(player) && !player->powers[pw_super])
{
if (S_SpeedMusic(0.0f) && (mapheaderinfo[gamemap-1]->levelflags & LF_SPEEDMUSIC))
if (mapheaderinfo[gamemap-1]->levelflags & LF_SPEEDMUSIC)
S_SpeedMusic(1.4f);
else
P_PlayJingle(player, JT_SHOES);

View file

@ -585,8 +585,8 @@ static inline void P_DoSpecialStageStuff(void)
players[i].powers[pw_underwater] = players[i].powers[pw_spacetime] = 0;
}
//if (sstimer < 15*TICRATE+6 && sstimer > 7 && (mapheaderinfo[gamemap-1]->levelflags & LF_SPEEDMUSIC))
//S_SpeedMusic(1.4f);
if (sstimer < 15*TICRATE+6 && sstimer > 7 && (mapheaderinfo[gamemap-1]->levelflags & LF_SPEEDMUSIC))
S_SpeedMusic(1.4f);
if (sstimer && !objectplacing)
{

View file

@ -165,6 +165,10 @@ static INT32 numofchannels = 0;
caption_t closedcaptions[NUMCAPTIONS];
// allow the grabbing of internal volumes
INT32 internal_volume = min(max(100, 0), 100);
INT32 internal_sfx_volume = 0;
void S_ResetCaptions(void)
{
UINT8 i;
@ -1787,9 +1791,26 @@ boolean S_MusicExists(const char *mname, boolean checkMIDI, boolean checkDigi)
/// Music Effects
/// ------------------------
boolean S_SpeedMusic(float speed)
void S_SpeedMusic(float speed) // StarManiaKG: was originally boolean, no longer needs to be //
{
return I_SetSongSpeed(speed);
I_SetSongSpeed(speed);
return;
}
float S_GetSpeedMusic(void)
{
return I_GetSongSpeed();
}
void S_PitchMusic(float pitch)
{
I_SetSongPitch(pitch);
return;
}
float S_GetPitchMusic(void)
{
return I_GetSongPitch();
}
/// ------------------------
@ -2303,7 +2324,7 @@ void S_ChangeMusicEx(const char *mmusic, UINT16 mflags, boolean looping, UINT32
{
I_SetSongPosition(position);
I_FadeSong(100, fadeinms, NULL);
}
}
else // reset volume to 100 with same music
{
I_StopFadingSong();
@ -2320,6 +2341,7 @@ void S_StopMusic(void)
I_ResumeSong();
S_SpeedMusic(1.0f);
S_PitchMusic(1.0f);
I_StopSong();
S_UnloadMusic(); // for now, stopping also means you unload the song
@ -2399,7 +2421,37 @@ void S_SetMusicVolume(INT32 digvolume, INT32 seqvolume)
void S_SetInternalMusicVolume(INT32 volume)
{
I_SetInternalMusicVolume(min(max(volume, 0), 100));
internal_volume = min(max(volume, 0), 100);
I_SetInternalMusicVolume((UINT8)internal_volume);
}
INT32 S_GetInternalMusicVolume(void)
{
return internal_volume;
}
void S_SetInternalSfxVolume(INT32 volume)
{
if (volume < 0 || volume > 31)
{
CONS_Alert(CONS_WARNING, "sfxvolume should be between 0-31\n");
volume = (volume < 0 ? 0 : 31);
}
internal_sfx_volume = volume;
#ifdef HW3SOUND
hws_mode == HWS_DEFAULT_MODE ? I_SetSfxVolume(internal_sfx_volume&0x1F) : HW3S_SetSfxVolume(internal_sfx_volume&0x1F);
#else
// now hardware volume
I_SetSfxVolume(internal_sfx_volume&0x1F);
#endif
}
INT32 S_GetInternalSfxVolume(void)
{
if (!internal_sfx_volume && cv_soundvolume.value)
internal_sfx_volume = cv_soundvolume.value;
return internal_sfx_volume;
}
void S_StopFadingMusic(void)
@ -2458,7 +2510,7 @@ static void Command_Tunes_f(void)
if (argc < 2) //tunes slot ...
{
CONS_Printf("tunes <name/num> [track] [speed] [position] / <-show> / <-default> / <-none>:\n");
CONS_Printf("tunes <name/num> [track] [speed] [pitch] [position] / <-show> / <-default> / <-none>:\n");
CONS_Printf(M_GetText("Play an arbitrary music lump. If a map number is used, 'MAP##M' is played.\n"));
CONS_Printf(M_GetText("If the format supports multiple songs, you can specify which one to play.\n\n"));
CONS_Printf(M_GetText("* With \"-show\", shows the currently playing tune and track.\n"));
@ -2496,8 +2548,8 @@ static void Command_Tunes_f(void)
strncpy(mapmusname, tunearg, 7);
mapmusname[6] = 0;
if (argc > 4)
position = (UINT32)atoi(COM_Argv(4));
if (argc > 5) // StarManiaKG: shifted up by one to account for the new pitch argument
position = (UINT32)atoi(COM_Argv(5));
mapmusflags = (track & MUSIC_TRACKMASK);
mapmusposition = position;
@ -2510,6 +2562,13 @@ static void Command_Tunes_f(void)
if (speed > 0.0f)
S_SpeedMusic(speed);
}
if (argc > 4)
{
float pitch = (float)atof(COM_Argv(4));
if (pitch > 0.0f)
S_PitchMusic(pitch);
}
}
static void Command_RestartAudio_f(void)
@ -2521,7 +2580,7 @@ static void Command_RestartAudio_f(void)
I_StartupSound();
I_InitMusic();
// These must be called or no sound and music until manually set.
// These must be called or no sound and music until manually set.
I_SetSfxVolume(cv_soundvolume.value);
S_SetMusicVolume(cv_digmusicvolume.value, cv_midimusicvolume.value);
@ -2624,6 +2683,10 @@ void MusicPref_OnChange(void)
M_CheckParm("-nomidimusic") || M_CheckParm("-nodigmusic"))
return;
// StarManiaKG: i'd rather not see thousands of sound errors on startup, thanks //
if (!sound_started)
return;
if (Playing())
P_RestoreMusic(&players[consoleplayer]);
else if (S_PrefAvailable(cv_musicpref.value, "_clear"))

View file

@ -177,7 +177,14 @@ boolean S_MusicExists(const char *mname, boolean checkMIDI, boolean checkDigi);
//
// Set Speed of Music
boolean S_SpeedMusic(float speed);
void S_SpeedMusic(float speed); // StarManiaKG: was originally boolean, no longer needs to be //
// Get Speed of Music
float S_GetSpeedMusic(void);
// Set Pitch of Music
void S_PitchMusic(float pitch);
// Get Pitch of Music
float S_GetPitchMusic(void);
// Music definitions
typedef struct musicdef_s
@ -295,6 +302,9 @@ void S_ResumeAudio(void);
//
void S_SetInternalMusicVolume(INT32 volume);
INT32 S_GetInternalMusicVolume(void);
void S_SetInternalSfxVolume(INT32 volume);
INT32 S_GetInternalSfxVolume(void);
void S_StopFadingMusic(void);
boolean S_FadeMusicFromVolume(UINT8 target_volume, INT16 source_volume, UINT32 ms);
#define S_FadeMusic(a, b) S_FadeMusicFromVolume(a, -1, b)

View file

@ -94,6 +94,7 @@ UINT8 sound_started = false;
static Mix_Music *music;
static UINT8 music_volume, sfx_volume, internal_volume;
static float music_speed, music_pitch;
static float loop_point;
static float song_length; // length in seconds
static boolean songpaused;
@ -125,10 +126,71 @@ static int result;
#endif
#ifdef HAVE_MIXERX
#if defined(__WIN32__)
#define TIMIDITY_CFG "sf2/timidity"
#elif defined(__OS2__)
#define TIMIDITY_CFG "/@unixroot/etc/timidity"
#else
#define TIMIDITY_CFG "/etc/timidity"
#endif
static int I_SetTimidityCFG(const char *path)
{
#if SDL_MIXER_VERSION_ATLEAST(2,0,4)
return Mix_SetTimidityCfg(path);
#else
return Mix_Timidity_addToPathList(path);
#endif
}
static const char *I_GetTimidityCFG(void)
{
#if SDL_MIXER_VERSION_ATLEAST(2,0,4)
return Mix_GetTimidityCfg();
#else
static const char *CFGPaths[] = {
va("%s/timidity.cfg", cv_miditimiditypath.string),
TIMIDITY_CFG,
NULL
}
for (INT32 i = 0; CFGPaths[i]; i++)
{
SDL_RWops *rw = SDL_RWFromFile(CFGPaths[i], "r");
if (rw != NULL)
{
SDL_RWclose(rw);
return CFGPaths[i];
}
}
return NULL;
#endif
}
static void I_ControlTimidityCFG(void)
{
const char *path = va("%s/timidity.cfg", cv_miditimiditypath.string);
if (Mix_GetMidiPlayer() != MIDI_Timidity || (I_SongType() != MU_NONE && I_SongType() != MU_MID_EX))
return;
if (!I_SetTimidityCFG(path) && (I_GetTimidityCFG() != NULL && stricmp(I_GetTimidityCFG(), path))) // == 0 means error
CONS_Alert(CONS_ERROR, "Timdity CFG error: %s\n", Mix_GetError());
else
{
if (I_GetTimidityCFG() != NULL && stricmp(I_GetTimidityCFG(), path))
S_StartEx(true);
}
}
static void Midiplayer_Onchange(void)
{
boolean restart = false;
const char *fluidsynthsoundfonts = Mix_GetSoundFonts();
const char *timiditycfgs;
if (I_SongType() != MU_NONE && I_SongType() != MU_MID_EX && I_SongType() != MU_MID)
return;
@ -140,18 +202,18 @@ static void Midiplayer_Onchange(void)
restart = true;
}
if (!Mix_GetSoundFonts() || stricmp(Mix_GetSoundFonts(), cv_midisoundfontpath.string))
if (fluidsynthsoundfonts != NULL && stricmp(fluidsynthsoundfonts, cv_midisoundfontpath.string))
{
if (!Mix_SetSoundFonts(cv_midisoundfontpath.string)) // == 0 means error
CONS_Alert(CONS_ERROR, "Sound font error: %s\n", Mix_GetError());
else
restart = true;
}
#if SDL_MIXER_VERSION_ATLEAST(2,5,0)
Mix_SetTimidityCfg(cv_miditimiditypath.string);
#else
Mix_Timidity_addToPathList(cv_miditimiditypath.string);
#endif
I_ControlTimidityCFG();
timiditycfgs = I_GetTimidityCFG();
if (timiditycfgs != NULL && stricmp(timiditycfgs, va("%s/timidity.cfg", cv_miditimiditypath.string)))
restart = true;
if (restart)
S_StartEx(true);
@ -213,8 +275,8 @@ static CV_PossibleValue_t midiplayer_cons_t[] = {
};
consvar_t cv_midiplayer = CVAR_INIT ("midiplayer", "OPNMIDI" /*MIDI_OPNMIDI*/, CV_CALL|CV_NOINIT|CV_SAVE, midiplayer_cons_t, Midiplayer_Onchange);
consvar_t cv_midisoundfontpath = CVAR_INIT ("midisoundfont", "sf2/8bitsf.SF2", CV_CALL|CV_NOINIT|CV_SAVE, NULL, MidiSoundfontPath_Onchange);
consvar_t cv_miditimiditypath = CVAR_INIT ("midisoundbank", "./timidity", CV_SAVE, NULL, NULL);
#endif
consvar_t cv_miditimiditypath = CVAR_INIT ("midisoundbank", TIMIDITY_CFG, CV_CALL|CV_NOINIT|CV_SAVE, NULL, I_ControlTimidityCFG);
#endif // HAVE_MIXERX
static void var_cleanup(void)
{
@ -222,6 +284,8 @@ static void var_cleanup(void)
music_bytes = fading_source = fading_target =\
fading_timer = fading_duration = 0;
music_speed = music_pitch = 1.0f;
songpaused = is_looping =\
is_fading = false;
@ -300,11 +364,7 @@ void I_StartupSound(void)
#ifdef HAVE_MIXERX
Mix_SetMidiPlayer(cv_midiplayer.value);
Mix_SetSoundFonts(cv_midisoundfontpath.string);
#if SDL_MIXER_VERSION_ATLEAST(2,5,0)
Mix_SetTimidityCfg(cv_miditimiditypath.string);
#else
Mix_Timidity_addToPathList(cv_miditimiditypath.string);
#endif
I_ControlTimidityCFG();
#endif
#if SDL_MIXER_VERSION_ATLEAST(1,2,11)
Mix_Init(MIX_INIT_FLAC|MIX_INIT_MP3|MIX_INIT_OGG|MIX_INIT_MOD);
@ -658,16 +718,21 @@ void I_SetSfxVolume(UINT8 volume)
static UINT32 get_real_volume(UINT8 volume)
{
#ifdef HAVE_MIXERX
#ifdef _WIN32
#if !SDL_MIXER_VERSION_ATLEAST(2,6,0) // StarManiaKG: recent SDL_Mixer_X builds fix whatever issue was here, apparently :p //
if (I_SongType() == MU_MID)
// HACK: Until we stop using native MIDI,
// disable volume changes
return ((UINT32)31*128/31); // volume = 31
else
#endif
// convert volume to mixer's 128 scale
// then apply internal_volume as a percentage
return ((UINT32)volume*128/31) * (UINT32)internal_volume / 100;
#endif
#endif
// convert volume to mixer's 128 scale
// then apply internal_volume as a percentage
return ((UINT32)volume*128/31) * (UINT32)internal_volume / 100;
}
static UINT32 get_adjusted_position(UINT32 position)
@ -875,25 +940,28 @@ boolean I_SongPaused(void)
/// Music Effects
/// ------------------------
boolean I_SetSongSpeed(float speed)
void I_SetSongSpeed(float speed) // StarManiaKG: was originally boolean, no longer needs to be //
{
if (speed > 250.0f)
speed = 250.0f; //limit speed up to 250x
music_speed = speed;
#ifdef HAVE_GME
if (gme)
{
SDL_LockAudio();
gme_set_tempo(gme, speed);
SDL_UnlockAudio();
return true;
return;
}
else
#endif
#ifdef HAVE_OPENMPT
if (openmpt_mhandle)
{
if (speed > 4.0f)
speed = 4.0f; // Limit this to 4x to prevent crashing, stupid fix but... ~SteelT 27/9/19
music_speed = speed = 4.0f; // Limit this to 4x to prevent crashing, stupid fix but... ~SteelT 27/9/19
#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR < 5
{
// deprecated in 0.5.0
@ -904,13 +972,106 @@ boolean I_SetSongSpeed(float speed)
#else
openmpt_module_ctl_set_floatingpoint(openmpt_mhandle, "play.tempo_factor", (double)speed);
#endif
return true;
return;
}
#else
(void)speed;
return false;
#endif
return false;
// StarManiaKG: a new speed system! (tons of modding options here!) //
#ifdef HAVE_MIXERX
if (music)
{
if (speed > 20.0f) // Limit this to 20x to prevent errors
{
CONS_Alert(CONS_WARNING, "I_SetSongSpeed(): Music speed cannot be set above 20x, lowering music speed to 20x.\n");
music_speed = speed = 20.0f;
}
if (Mix_SetMusicTempo(music, speed) >= 0)
return;
#if (SDL_MIXER_VERSION_ATLEAST(2,6,0))
else if (Mix_SetMusicSpeed(music, speed) >= 0)
return;
#endif
music_speed = -1.0f;
}
#endif
}
float I_GetSongSpeed(void)
{
#ifdef HAVE_MIXERX
if (music)
#if (SDL_MIXER_VERSION_ATLEAST(2,6,0))
return Mix_GetMusicSpeed(music);
#else
return Mix_GetMusicTempo(music);
#endif
#endif
return music_speed;
}
void I_SetSongPitch(float pitch)
{
if (pitch > 250.0f)
pitch = 250.0f; // limit pitch up to 250x
music_pitch = pitch;
#ifdef HAVE_GME
if (gme)
{
SDL_LockAudio();
gme_set_stereo_depth(gme, pitch);
SDL_UnlockAudio();
return;
}
#endif
#ifdef HAVE_OPENMPT
if (openmpt_mhandle)
{
if (pitch > 4.0f)
music_pitch = pitch = 4.0f; // Limit this to 4x to prevent crashing, stupid fix but... ~StarManiaKG 20/1/24 (stolen from SteelT)
#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR < 5
// deprecated in 0.5.0
char modspd[13];
sprintf(modspd, "%g", pitch);
openmpt_module_ctl_set(openmpt_mhandle, "play.pitch_factor", modspd);
#else
openmpt_module_ctl_set_floatingpoint(openmpt_mhandle, "play.pitch_factor", (double)pitch);
#endif
return;
}
#endif
#ifdef HAVE_MIXERX
if (music)
{
if (pitch > 20.0f) // Limit this to 20x to prevent errors
{
CONS_Alert(CONS_WARNING, "I_SetSongPitch(): Music pitch cannot be set above 20x, lowering music pitch to 20x.\n");
music_pitch = pitch = 20.0f;
}
if (Mix_SetMusicPitch(music, pitch) >= 0)
return;
music_pitch = -1.0f;
}
#endif
}
float I_GetSongPitch(void)
{
#ifdef HAVE_MIXERX
if (music)
return Mix_GetMusicPitch(music);
#endif
return music_pitch;
}
/// ------------------------
@ -1223,11 +1384,7 @@ boolean I_LoadSong(char *data, size_t len)
Mix_SetMidiPlayer(cv_midiplayer.value);
if (!Mix_GetSoundFonts() || stricmp(Mix_GetSoundFonts(), cv_midisoundfontpath.string))
Mix_SetSoundFonts(cv_midisoundfontpath.string);
#if SDL_MIXER_VERSION_ATLEAST(2,5,0)
Mix_SetTimidityCfg(cv_miditimiditypath.string);
#else
Mix_Timidity_addToPathList(cv_miditimiditypath.string); // this overwrites previous custom path
#endif
I_ControlTimidityCFG(); // this overwrites previous custom path
#endif
#ifdef HAVE_OPENMPT
@ -1456,12 +1613,16 @@ void I_SetMusicVolume(UINT8 volume)
if (!I_SongPlaying())
return;
#ifdef HAVE_MIXERX
#ifdef _WIN32
#if !SDL_MIXER_VERSION_ATLEAST(2,6,0) // StarManiaKG: recent SDL_Mixer_X builds fix whatever issue was here, apparently :p //
if (I_SongType() == MU_MID)
// HACK: Until we stop using native MIDI,
// disable volume changes
music_volume = 31;
else
#endif
#endif
#endif
music_volume = volume;

View file

@ -1370,10 +1370,26 @@ boolean I_SongPaused(void)
// MUSIC EFFECTS
/// ------------------------
boolean I_SetSongSpeed(float speed)
void I_SetSongSpeed(float speed) // StarManiaKG: was originally boolean, no longer needs to be //
{
(void)speed;
return false;
return;
}
float I_GetSongSpeed(void)
{
return 0.0f;
}
void I_SetSongPitch(float pitch)
{
(void)pitch;
return;
}
float I_GetSongPitch(void)
{
return 0.0f;
}
/// ------------------------