diff --git a/CMakeLists.txt b/CMakeLists.txt index 7860358ef..cf41bbb6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -383,6 +383,7 @@ else() endif() set( LZMA_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libraries/lzma/C" ) +set( ADL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libraries/adlmidi" ) if( NOT CMAKE_CROSSCOMPILING ) if( NOT CROSS_EXPORTS ) @@ -404,6 +405,7 @@ add_subdirectory( libraries/lzma ) add_subdirectory( tools ) add_subdirectory( libraries/dumb ) add_subdirectory( libraries/gdtoa ) +add_subdirectory( libraries/adlmidi ) add_subdirectory( wadsrc ) add_subdirectory( wadsrc_bm ) add_subdirectory( wadsrc_lights ) diff --git a/libraries/adlmidi/CMakeLists.txt b/libraries/adlmidi/CMakeLists.txt new file mode 100644 index 000000000..c80d4213f --- /dev/null +++ b/libraries/adlmidi/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required( VERSION 2.8.7 ) + +make_release_only() + +add_definitions(-DADLMIDI_DISABLE_MIDI_SEQUENCER) + +if( ZD_CMAKE_COMPILER_IS_GNUC_COMPATIBLE ) + set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -fomit-frame-pointer" ) +endif() + +set (CMAKE_C_FLAGS ${CMAKE_C_FLAGS} ${ZD_FASTMATH_FLAG}) + +add_library( adl STATIC + adldata.cpp + adlmidi.cpp + adlmidi_load.cpp + adlmidi_midiplay.cpp + adlmidi_opl3.cpp + adlmidi_private.cpp + chips/dosbox/dbopl.cpp + chips/dosbox_opl3.cpp + chips/nuked/nukedopl3_174.c + chips/nuked/nukedopl3.c + chips/nuked_opl3.cpp + chips/nuked_opl3_v174.cpp + wopl/wopl_file.c + ) +target_link_libraries( adl ) diff --git a/src/sound/adlmidi/adldata.cpp b/libraries/adlmidi/adldata.cpp similarity index 100% rename from src/sound/adlmidi/adldata.cpp rename to libraries/adlmidi/adldata.cpp diff --git a/src/sound/adlmidi/adldata.hh b/libraries/adlmidi/adldata.hh similarity index 100% rename from src/sound/adlmidi/adldata.hh rename to libraries/adlmidi/adldata.hh diff --git a/src/sound/adlmidi/adlmidi.cpp b/libraries/adlmidi/adlmidi.cpp similarity index 100% rename from src/sound/adlmidi/adlmidi.cpp rename to libraries/adlmidi/adlmidi.cpp diff --git a/src/sound/adlmidi/adlmidi.h b/libraries/adlmidi/adlmidi.h similarity index 100% rename from src/sound/adlmidi/adlmidi.h rename to libraries/adlmidi/adlmidi.h diff --git a/src/sound/adlmidi/adlmidi.hpp b/libraries/adlmidi/adlmidi.hpp similarity index 100% rename from src/sound/adlmidi/adlmidi.hpp rename to libraries/adlmidi/adlmidi.hpp diff --git a/src/sound/adlmidi/adlmidi_bankmap.h b/libraries/adlmidi/adlmidi_bankmap.h similarity index 100% rename from src/sound/adlmidi/adlmidi_bankmap.h rename to libraries/adlmidi/adlmidi_bankmap.h diff --git a/src/sound/adlmidi/adlmidi_bankmap.tcc b/libraries/adlmidi/adlmidi_bankmap.tcc similarity index 100% rename from src/sound/adlmidi/adlmidi_bankmap.tcc rename to libraries/adlmidi/adlmidi_bankmap.tcc diff --git a/src/sound/adlmidi/adlmidi_cvt.hpp b/libraries/adlmidi/adlmidi_cvt.hpp similarity index 100% rename from src/sound/adlmidi/adlmidi_cvt.hpp rename to libraries/adlmidi/adlmidi_cvt.hpp diff --git a/src/sound/adlmidi/adlmidi_load.cpp b/libraries/adlmidi/adlmidi_load.cpp similarity index 100% rename from src/sound/adlmidi/adlmidi_load.cpp rename to libraries/adlmidi/adlmidi_load.cpp diff --git a/src/sound/adlmidi/adlmidi_midiplay.cpp b/libraries/adlmidi/adlmidi_midiplay.cpp similarity index 100% rename from src/sound/adlmidi/adlmidi_midiplay.cpp rename to libraries/adlmidi/adlmidi_midiplay.cpp diff --git a/src/sound/adlmidi/adlmidi_opl3.cpp b/libraries/adlmidi/adlmidi_opl3.cpp similarity index 100% rename from src/sound/adlmidi/adlmidi_opl3.cpp rename to libraries/adlmidi/adlmidi_opl3.cpp diff --git a/src/sound/adlmidi/adlmidi_private.cpp b/libraries/adlmidi/adlmidi_private.cpp similarity index 100% rename from src/sound/adlmidi/adlmidi_private.cpp rename to libraries/adlmidi/adlmidi_private.cpp diff --git a/src/sound/adlmidi/adlmidi_private.hpp b/libraries/adlmidi/adlmidi_private.hpp similarity index 100% rename from src/sound/adlmidi/adlmidi_private.hpp rename to libraries/adlmidi/adlmidi_private.hpp diff --git a/src/sound/adlmidi/adlmidi_ptr.hpp b/libraries/adlmidi/adlmidi_ptr.hpp similarity index 100% rename from src/sound/adlmidi/adlmidi_ptr.hpp rename to libraries/adlmidi/adlmidi_ptr.hpp diff --git a/src/sound/adlmidi/chips/dosbox/dbopl.cpp b/libraries/adlmidi/chips/dosbox/dbopl.cpp similarity index 100% rename from src/sound/adlmidi/chips/dosbox/dbopl.cpp rename to libraries/adlmidi/chips/dosbox/dbopl.cpp diff --git a/src/sound/adlmidi/chips/dosbox/dbopl.h b/libraries/adlmidi/chips/dosbox/dbopl.h similarity index 100% rename from src/sound/adlmidi/chips/dosbox/dbopl.h rename to libraries/adlmidi/chips/dosbox/dbopl.h diff --git a/src/sound/adlmidi/chips/dosbox_opl3.cpp b/libraries/adlmidi/chips/dosbox_opl3.cpp similarity index 100% rename from src/sound/adlmidi/chips/dosbox_opl3.cpp rename to libraries/adlmidi/chips/dosbox_opl3.cpp diff --git a/src/sound/adlmidi/chips/dosbox_opl3.h b/libraries/adlmidi/chips/dosbox_opl3.h similarity index 100% rename from src/sound/adlmidi/chips/dosbox_opl3.h rename to libraries/adlmidi/chips/dosbox_opl3.h diff --git a/src/sound/adlmidi/chips/nuked/nukedopl3.c b/libraries/adlmidi/chips/nuked/nukedopl3.c similarity index 100% rename from src/sound/adlmidi/chips/nuked/nukedopl3.c rename to libraries/adlmidi/chips/nuked/nukedopl3.c diff --git a/src/sound/adlmidi/chips/nuked/nukedopl3.h b/libraries/adlmidi/chips/nuked/nukedopl3.h similarity index 100% rename from src/sound/adlmidi/chips/nuked/nukedopl3.h rename to libraries/adlmidi/chips/nuked/nukedopl3.h diff --git a/src/sound/adlmidi/chips/nuked/nukedopl3_174.c b/libraries/adlmidi/chips/nuked/nukedopl3_174.c similarity index 100% rename from src/sound/adlmidi/chips/nuked/nukedopl3_174.c rename to libraries/adlmidi/chips/nuked/nukedopl3_174.c diff --git a/src/sound/adlmidi/chips/nuked/nukedopl3_174.h b/libraries/adlmidi/chips/nuked/nukedopl3_174.h similarity index 100% rename from src/sound/adlmidi/chips/nuked/nukedopl3_174.h rename to libraries/adlmidi/chips/nuked/nukedopl3_174.h diff --git a/src/sound/adlmidi/chips/nuked_opl3.cpp b/libraries/adlmidi/chips/nuked_opl3.cpp similarity index 100% rename from src/sound/adlmidi/chips/nuked_opl3.cpp rename to libraries/adlmidi/chips/nuked_opl3.cpp diff --git a/src/sound/adlmidi/chips/nuked_opl3.h b/libraries/adlmidi/chips/nuked_opl3.h similarity index 100% rename from src/sound/adlmidi/chips/nuked_opl3.h rename to libraries/adlmidi/chips/nuked_opl3.h diff --git a/src/sound/adlmidi/chips/nuked_opl3_v174.cpp b/libraries/adlmidi/chips/nuked_opl3_v174.cpp similarity index 100% rename from src/sound/adlmidi/chips/nuked_opl3_v174.cpp rename to libraries/adlmidi/chips/nuked_opl3_v174.cpp diff --git a/src/sound/adlmidi/chips/nuked_opl3_v174.h b/libraries/adlmidi/chips/nuked_opl3_v174.h similarity index 100% rename from src/sound/adlmidi/chips/nuked_opl3_v174.h rename to libraries/adlmidi/chips/nuked_opl3_v174.h diff --git a/src/sound/adlmidi/chips/opl_chip_base.h b/libraries/adlmidi/chips/opl_chip_base.h similarity index 100% rename from src/sound/adlmidi/chips/opl_chip_base.h rename to libraries/adlmidi/chips/opl_chip_base.h diff --git a/src/sound/adlmidi/chips/opl_chip_base.tcc b/libraries/adlmidi/chips/opl_chip_base.tcc similarity index 100% rename from src/sound/adlmidi/chips/opl_chip_base.tcc rename to libraries/adlmidi/chips/opl_chip_base.tcc diff --git a/src/sound/adlmidi/file_reader.hpp b/libraries/adlmidi/file_reader.hpp similarity index 100% rename from src/sound/adlmidi/file_reader.hpp rename to libraries/adlmidi/file_reader.hpp diff --git a/src/sound/adlmidi/wopl/wopl_file.c b/libraries/adlmidi/wopl/wopl_file.c similarity index 100% rename from src/sound/adlmidi/wopl/wopl_file.c rename to libraries/adlmidi/wopl/wopl_file.c diff --git a/src/sound/adlmidi/wopl/wopl_file.h b/libraries/adlmidi/wopl/wopl_file.h similarity index 100% rename from src/sound/adlmidi/wopl/wopl_file.h rename to libraries/adlmidi/wopl/wopl_file.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fda0c0007..33d7d55ba 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -468,7 +468,7 @@ set( ZDOOM_LIBS ${ZDOOM_LIBS} "${ZLIB_LIBRARIES}" "${JPEG_LIBRARIES}" "${BZIP2_L if (HAVE_VULKAN) set( ZDOOM_LIBS ${ZDOOM_LIBS} "glslang" "SPIRV" "OGLCompiler") endif() -include_directories( "${ZLIB_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${GME_INCLUDE_DIR}" ) +include_directories( "${ZLIB_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${GME_INCLUDE_DIR}" "${ADL_INCLUDE_DIR}" ) if( ${HAVE_VM_JIT} ) add_definitions( -DHAVE_VM_JIT ) @@ -677,7 +677,6 @@ file( GLOB HEADER_FILES maploader/*.h menu/*.h sound/*.h - sound/adlmidi/*.h* sound/backend/*.h* sound/music/*.h* sound/opnmidi/*.h* @@ -885,19 +884,6 @@ set( FASTMATH_SOURCES rendering/hwrenderer/scene/hw_weapon.cpp r_data/models/models.cpp utility/matrix.cpp - sound/adlmidi/adldata.cpp - sound/adlmidi/adlmidi.cpp - sound/adlmidi/adlmidi_load.cpp - sound/adlmidi/adlmidi_midiplay.cpp - sound/adlmidi/adlmidi_opl3.cpp - sound/adlmidi/adlmidi_private.cpp - sound/adlmidi/chips/dosbox/dbopl.cpp - sound/adlmidi/chips/dosbox_opl3.cpp - sound/adlmidi/chips/nuked/nukedopl3_174.c - sound/adlmidi/chips/nuked/nukedopl3.c - sound/adlmidi/chips/nuked_opl3.cpp - sound/adlmidi/chips/nuked_opl3_v174.cpp - sound/adlmidi/wopl/wopl_file.c sound/opnmidi/chips/gens_opn2.cpp sound/opnmidi/chips/gens/Ym2612_Emu.cpp sound/opnmidi/chips/mame/mame_ym2612fm.c @@ -1385,7 +1371,7 @@ if( UNIX ) endif() endif() -target_link_libraries( zdoom ${ZDOOM_LIBS} gdtoa dumb lzma ) +target_link_libraries( zdoom ${ZDOOM_LIBS} gdtoa dumb lzma adl ) include_directories( . g_statusbar diff --git a/src/sound/mididevices/music_adlmidi_mididevice.cpp b/src/sound/mididevices/music_adlmidi_mididevice.cpp index 29a098a59..b1889f390 100644 --- a/src/sound/mididevices/music_adlmidi_mididevice.cpp +++ b/src/sound/mididevices/music_adlmidi_mididevice.cpp @@ -35,7 +35,7 @@ // HEADER FILES ------------------------------------------------------------ #include "i_musicinterns.h" -#include "adlmidi/adlmidi.h" +#include "adlmidi.h" #include "i_soundfont.h" class ADLMIDIDevice : public SoftSynthMIDIDevice