re-enable music debugger and fix switch to SDL2 mixer

This commit is contained in:
NepDisk 2025-11-12 12:24:41 -05:00
parent 6e1fbfbb6a
commit 1d2a4f98c6
3 changed files with 12 additions and 46 deletions

View file

@ -358,7 +358,7 @@ typedef enum
DBG_DETAILED = 0x00000002,
DBG_PLAYER = 0x00000004,
DBG_RENDER = 0x00000008,
//DBG_NIGHTSBASIC = 0x00000010, // free
DBG_MUSIC = 0x00000010,
//DBG_NIGHTS = 0x00000020, // free
DBG_POLYOBJ = 0x00000040,
DBG_GAMELOGIC = 0x00000080,

View file

@ -69,8 +69,9 @@ target_link_libraries(SRB2SDL2 PRIVATE SDL2::SDL2)
if(TARGET SDL2main)
target_link_libraries(SRB2SDL2 PRIVATE SDL2main)
endif()
target_compile_definitions(SRB2SDL2 PRIVATE -DDIRECTFULLSCREEN -DHAVE_SDL)
target_compile_definitions(SRB2SDL2 PRIVATE -DDIRECTFULLSCREEN)
target_include_directories(SRB2SDL2 PRIVATE ${SDL2_INCLUDE_DIR})
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_SDL)
find_package(OpenAL CONFIG QUIET)
find_package(OpenAL QUIET)
@ -85,52 +86,17 @@ if(${SRB2_CONFIG_USE_OPENAL})
target_link_libraries(SRB2SDL2 PRIVATE SDL2::SDL2)
endif()
else()
find_package(SDL2_mixer_ext CONFIG QUIET)
find_package(SDL2_mixer_ext QUIET)
if(TARGET SDL2_mixer_ext::SDL2_mixer_ext OR TARGET SDL2_mixer_ext::SDL2_mixer_ext_Static OR TARGET SDL2_mixer_ext OR TARGET SDL2_mixer_ext_Static)
if(NOT TARGET SDL2_mixer_ext::SDL2_mixer_ext_Static AND TARGET SDL2_mixer_ext_Static)
add_library(SDL2_mixer_ext::SDL2_mixer_ext_Static ALIAS SDL2_mixer_ext_Static)
endif()
if(NOT TARGET SDL2_mixer_ext::SDL2_mixer_ext AND TARGET SDL2_mixer_ext)
add_library(SDL2_mixer_ext::SDL2_mixer_ext ALIAS SDL2_mixer_ext)
endif()
if(TARGET SDL2_mixer_ext::SDL2_mixer_ext OR TARGET SDL2_mixer_ext::SDL2_mixer_ext_Static)
if(TARGET SDL2_mixer_ext::SDL2_mixer_ext_Static)
target_link_libraries(SRB2SDL2 PRIVATE SDL2_mixer_ext::SDL2_mixer_ext_Static)
else()
target_link_libraries(SRB2SDL2 PRIVATE SDL2_mixer_ext::SDL2_mixer_ext)
endif()
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_MIXER -DHAVE_MIXERX -DSOUND=SOUND_MIXER)
endif()
endif()
if(TARGET SDL2_mixer_ext::SDL2_mixer_ext OR TARGET SDL2_mixer_ext::SDL2_mixer_ext_Static)
message(STATUS "SDL2_mixer_ext found, skipping SDL2_mixer")
if(NOT "${SRB2_CONFIG_SYSTEM_LIBRARIES}" AND NOT "${SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES}")
target_link_libraries(SRB2SDL2 PRIVATE SDL2::SDL2-static SDL2_mixer::SDL2_mixer-static)
else()
message(STATUS "SDL2_mixer_ext not found, going to try SDL2_mixer")
find_package(SDL2_mixer CONFIG QUIET)
find_package(SDL2_mixer QUIET)
if(TARGET SDL2_mixer::SDL2_mixer OR TARGET SDL2_mixer::SDL2_mixer-static OR TARGET SDL2_mixer OR TARGET SDL2_mixer_Static)
if(NOT TARGET SDL2_mixer::SDL2_mixer-static AND TARGET SDL2_mixer_Static)
add_library(SDL2_mixer::SDL2_mixer-static ALIAS SDL2_mixer_Static)
endif()
if(NOT TARGET SDL2_mixer::SDL2_mixer AND TARGET SDL2_mixer)
add_library(SDL2_mixer::SDL2_mixer ALIAS SDL2_mixer)
endif()
if(TARGET SDL2_mixer::SDL2_mixer OR TARGET SDL2_mixer::SDL2_mixer-static)
if(TARGET SDL2_mixer::SDL2_mixer-static)
target_link_libraries(SRB2SDL2 PRIVATE SDL2_mixer::SDL2_mixer-static)
else()
target_link_libraries(SRB2SDL2 PRIVATE SDL2_mixer::SDL2_mixer)
endif()
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_MIXER -DSOUND=SOUND_MIXER)
endif()
endif()
target_link_libraries(SRB2SDL2 PRIVATE SDL2::SDL2 SDL2_mixer::SDL2_mixer)
endif()
if(TARGET SDL2_mixer_ext::SDL2_mixer_ext OR TARGET SDL2_mixer_ext::SDL2_mixer_ext_Static OR TARGET SDL2_mixer::SDL2_mixer OR TARGET SDL2_mixer::SDL2_mixer-static)
target_sources(SRB2SDL2 PRIVATE mixer_sound.c)
endif()
target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_MIXER -DSOUND=SOUND_MIXER)
endif()
if(TARGET SDL2::SDL2)

View file

@ -425,7 +425,7 @@ static void ST_pushDebugString(INT32 *height, const char *string)
*height -= 8;
}
/*static void ST_pushDebugTimeMS(INT32 *height, const char *label, UINT32 ms)
static void ST_pushDebugTimeMS(INT32 *height, const char *label, UINT32 ms)
{
ST_pushDebugString(height, va("%s%02d:%05.2f", label,
ms / 60000, ms % 60000 / 1000.f));
@ -471,7 +471,7 @@ static void ST_drawMusicDebug(INT32 *height)
}
ST_pushDebugString(height, va(" Song: %8s", mname));
}*/
}
static void ST_drawRenderDebug(INT32 *height)
{
@ -568,10 +568,10 @@ static void ST_drawDebugInfo(void)
height -= 32;
}
/*if (cht_debug & DBG_MUSIC)
if (cht_debug & DBG_MUSIC)
{
ST_drawMusicDebug(&height);
}*/
}
if (cht_debug & DBG_RENDER)
{