- made the OPL synth backend a separate library.

# Conflicts:
#	src/CMakeLists.txt
#	src/sound/mididevices/music_opl_mididevice.cpp

# Conflicts:
#	libraries/oplsynth/OPL3.cpp
#	libraries/oplsynth/dosbox/opl.cpp
This commit is contained in:
Christoph Oelckers 2019-09-26 20:06:39 +02:00 committed by drfrag
parent a63d90034b
commit f2840d4942
20 changed files with 53 additions and 22 deletions

View file

@ -388,6 +388,7 @@ set( OPN_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libraries/opnmidi" )
set( TIMIDITYPP_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libraries/timidityplus" )
set( TIMIDITY_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libraries/timidity" )
set( WILDMIDI_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libraries/wildmidi" )
set( OPLSYNTH_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libraries/oplsynth" )
if( NOT CMAKE_CROSSCOMPILING )
if( NOT CROSS_EXPORTS )
@ -414,6 +415,7 @@ add_subdirectory( libraries/opnmidi )
add_subdirectory( libraries/timidity )
add_subdirectory( libraries/timidityplus )
add_subdirectory( libraries/wildmidi )
add_subdirectory( libraries/oplsynth )
add_subdirectory( wadsrc )
add_subdirectory( wadsrc_bm )
add_subdirectory( wadsrc_lights )

View file

@ -0,0 +1,38 @@
cmake_minimum_required( VERSION 2.8.7 )
make_release_only()
if( ZD_CMAKE_COMPILER_IS_GNUC_COMPATIBLE )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -fomit-frame-pointer" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
endif()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ZD_FASTMATH_FLAG}")
include( CheckFunctionExists )
CHECK_FUNCTION_EXISTS( stricmp STRICMP_EXISTS )
if( NOT STRICMP_EXISTS )
add_definitions( -Dstricmp=strcasecmp )
endif()
CHECK_FUNCTION_EXISTS( strnicmp STRNICMP_EXISTS )
if( NOT STRNICMP_EXISTS )
add_definitions( -Dstrnicmp=strncasecmp )
endif()
include_directories( oplsynth )
file( GLOB HEADER_FILES
oplsynth/*.h
)
add_library( oplsynth STATIC
fmopl.cpp
musicblock.cpp
nukedopl3.cpp
opl_mus_player.cpp
OPL3.cpp
oplio.cpp
dosbox/opl.cpp
)
target_link_libraries( oplsynth )

View file

@ -44,6 +44,7 @@
*/
#include <math.h>
#include <stdlib.h>
#include <limits>
#include "opl.h"

View file

@ -24,8 +24,10 @@
* Ken Silverman's official web site: "http://www.advsys.net/ken"
*/
#include "../opl.h"
#include "../musicblock.h"
#include "../oplsynth/opl.h"
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <math.h>
typedef uintptr_t Bitu;

View file

@ -84,6 +84,8 @@ Revision History:
#include <string.h>
#include <stdarg.h>
#include <math.h>
#include <stdint.h>
#include <string>
//#include "driver.h" /* use M.A.M.E. */
#include "opl.h"
@ -1616,7 +1618,7 @@ public:
}
}
FString GetVoiceString(void *chip)
std::string GetVoiceString(void *chip)
{
FM_OPL *OPL = (FM_OPL *)chip;
char out[9*3];
@ -1637,7 +1639,7 @@ public:
out[i*3+1] = color;
out[i*3+2] = '*';
}
return FString (out, 9*3);
return std::string (out, 9*3);
}
};

View file

@ -488,7 +488,7 @@ add_custom_target( revision_check ALL
message( STATUS "Fluid synth libs: ${FLUIDSYNTH_LIBRARIES}" )
set( ZDOOM_LIBS ${ZDOOM_LIBS} "${ZLIB_LIBRARIES}" "${JPEG_LIBRARIES}" "${BZIP2_LIBRARIES}" "${GME_LIBRARIES}" "${CMAKE_DL_LIBS}" )
include_directories( "${ZLIB_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${GME_INCLUDE_DIR}" "${ADL_INCLUDE_DIR}" "${OPN_INCLUDE_DIR}" "${TIMIDITYPP_INCLUDE_DIR}" "${TIMIDITY_INCLUDE_DIR}" "${WILDMIDI_INCLUDE_DIR}" )
include_directories( "${ZLIB_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${GME_INCLUDE_DIR}" "${ADL_INCLUDE_DIR}" "${OPN_INCLUDE_DIR}" "${TIMIDITYPP_INCLUDE_DIR}" "${TIMIDITY_INCLUDE_DIR}" "${WILDMIDI_INCLUDE_DIR}" "${OPLSYNTH_INCLUDE_DIR}" )
if( ${HAVE_VM_JIT} )
add_definitions( -DHAVE_VM_JIT )
@ -678,8 +678,6 @@ file( GLOB HEADER_FILES
sound/*.h
sound/backend/*.h*
sound/music/*.h*
sound/oplsynth/*.h
sound/oplsynth/dosbox/*.h
posix/*.h
posix/cocoa/*.h
posix/sdl/*.h
@ -696,8 +694,6 @@ file( GLOB HEADER_FILES
scripting/zscript/*.h
scripting/vm/*.h
sound/midisources/*.h
sound/oplsynth/*.h
sound/oplsynth/dosbox/*.h
sound/thirdparty/*.h
xlat/*.h
swrenderer/*.h
@ -838,7 +834,6 @@ set( VM_JIT_SOURCES
set( FASTMATH_SOURCES
swrenderer/r_all.cpp
polyrenderer/poly_all.cpp
sound/oplsynth/opl_mus_player.cpp
sound/backend/mpg123_decoder.cpp
sound/music/music_midi_base.cpp
sound/backend/oalsound.cpp
@ -1210,12 +1205,6 @@ set (PCH_SOURCES
sound/musicformats/music_opl.cpp
sound/musicformats/music_stream.cpp
sound/musicformats/music_xa.cpp
sound/oplsynth/fmopl.cpp
sound/oplsynth/musicblock.cpp
sound/oplsynth/oplio.cpp
sound/oplsynth/dosbox/opl.cpp
sound/oplsynth/OPL3.cpp
sound/oplsynth/nukedopl3.cpp
events.cpp
atterm.cpp
GuillotineBinPack.cpp
@ -1282,7 +1271,7 @@ if( UNIX )
endif()
endif()
target_link_libraries( zdoom ${ZDOOM_LIBS} gdtoa dumb lzma adl opn timidity timidityplus wildmidi )
target_link_libraries( zdoom ${ZDOOM_LIBS} gdtoa dumb lzma adl opn timidity timidityplus wildmidi oplsynth )
include_directories( .
g_statusbar
@ -1291,7 +1280,6 @@ include_directories( .
sound
sound/music
sound/backend
sound/oplsynth
textures
xlat
scripting
@ -1391,8 +1379,6 @@ install(TARGETS zdoom
source_group("Audio Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sound/.+")
source_group("Audio Files\\Backend" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sound/backend/.+")
source_group("Audio Files\\OPL Synth" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sound/oplsynth/.+")
source_group("Audio Files\\OPL Synth\\DOSBox" FILES sound/oplsynth/dosbox/opl.cpp sound/oplsynth/dosbox/opl.h)
source_group("Audio Files\\MIDI Devices" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sound/mididevices/.+")
source_group("Audio Files\\MIDI Sources" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sound/midisources/.+")
source_group("Audio Files\\Music formats" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sound/musicformats/.+")

View file

@ -41,8 +41,8 @@
#include "m_swap.h"
#include "w_wad.h"
#include "v_text.h"
#include "i_system.h"
#include "opl.h"
#include "doomerrors.h"
#include "oplsynth/opl.h"
// MACROS ------------------------------------------------------------------