Skip to content

Commit 60cb3a0

Browse files
authored
Merge pull request #374 from winterheart/sndlib
Unify and cleanup sound related code into single sndlib module
2 parents cdec632 + dd309d2 commit 60cb3a0

40 files changed

+313
-418
lines changed

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,9 @@ add_subdirectory(ddebug)
176176
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
177177
add_subdirectory(dd_grwin32)
178178
add_subdirectory(win32)
179-
add_subdirectory(dd_sndlib)
180179
add_subdirectory(ddio_win)
181180
else()
182181
add_subdirectory(linux)
183-
add_subdirectory(dd_lnxsound)
184182
add_subdirectory(ddio_lnx)
185183
endif()
186184

Descent3/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,19 +273,19 @@ set(CPPS
273273
weather.cpp)
274274

275275
if(WIN32)
276-
set(PLATFORM_LIBS dd_sndlib dd_grwin32 ddio_win win32 wsock32.lib winmm.lib
276+
set(PLATFORM_LIBS dd_grwin32 ddio_win win32 wsock32.lib winmm.lib
277277
${DSOUND_LIBRARY} ${DINPUT_LIBRARY} ${DXGUID_LIBRARY} ${DDRAW_LIBRARY})
278278
set(PLATFORM_CPPS winmain.cpp)
279279
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO /NODEFAULTLIB:LIBC")
280280
endif()
281281

282282
if(UNIX AND NOT APPLE)
283-
set(PLATFORM_LIBS linux dd_lnxsound ddio_lnx SDL2::SDL2 m ${CMAKE_DL_LIBS} ${CURSES_LIBRARIES})
283+
set(PLATFORM_LIBS linux ddio_lnx SDL2::SDL2 m ${CMAKE_DL_LIBS} ${CURSES_LIBRARIES})
284284
set(PLATFORM_CPPS loki_utils.c lnxmain.cpp)
285285
endif()
286286

287287
if(APPLE)
288-
set(PLATFORM_LIBS linux dd_lnxsound ddio_lnx SDL2::SDL2 ${CURSES_LIBRARIES})
288+
set(PLATFORM_LIBS linux ddio_lnx SDL2::SDL2 ${CURSES_LIBRARIES})
289289
set(PLATFORM_CPPS loki_utils.c lnxmain.cpp)
290290
set(CMAKE_EXE_LINKER_FLAGS "-framework IOKit -framework Cocoa -framework OpenGL -framework Carbon")
291291
endif()

Descent3/lnxmain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ int main(int argc, char *argv[]) {
470470
setenv("SDL_VIDEODRIVER", "dummy", 1);
471471
#endif
472472

473-
int rc = SDL_Init(SDL_INIT_VIDEO);
473+
int rc = SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO);
474474
if (rc != 0) {
475475
fprintf(stderr, "SDL: SDL_Init() failed! rc == (%d).\n", rc);
476476
fprintf(stderr, "SDL_GetError() reports \"%s\".\n", SDL_GetError());

Descent3/spew.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@
7676
#ifndef __SPEW_H_
7777
#define __SPEW_H_
7878

79+
#include "vecmat.h"
80+
7981
#define SF_FORCEUPDATE 0x01 // this spew needs to do an update no matter what next time it spews (gunpoint)
8082
#define SF_UPDATEDFORFRAME 0x02 // thie spew has already updated it's position for this frame, no need to do it again
8183
#define SF_UPDATEEVERYFRAME 0x04

d3music/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ set(CPPS
33
musicapi.cpp)
44

55
add_library(d3music STATIC ${HEADERS} ${CPPS})
6+
target_link_libraries(d3music PRIVATE
7+
music
8+
)

dd_lnxsound/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

dd_lnxsound/ddlnxsound.h

Lines changed: 0 additions & 72 deletions
This file was deleted.

dd_sndlib/CMakeLists.txt

Lines changed: 0 additions & 18 deletions
This file was deleted.

manage/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ set(CPPS
2424
add_library(manage STATIC ${HEADERS} ${CPPS})
2525
target_link_libraries(manage PRIVATE
2626
cfile
27+
sndlib
28+
stream_audio
2729
)

music/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,10 @@ set(CPPS
88
add_library(music STATIC ${HEADERS} ${CPPS})
99
target_link_libraries(music
1010
cfile
11+
stream_audio
12+
)
13+
target_include_directories(music PUBLIC
14+
$<BUILD_INTERFACE:
15+
${PROJECT_SOURCE_DIR}/music
16+
>
1117
)

0 commit comments

Comments
 (0)