Skip to content

Commit

Permalink
Use OpenAL instead of Miles Sound System (#3842)
Browse files Browse the repository at this point in the history
- People are now free to delete MSS32.DLL and WSND7R.DLL
- Removes dependency on the last remaining closed source DLLs
  • Loading branch information
xtremeqg authored Jan 30, 2025
1 parent 2779eac commit 37fc04b
Show file tree
Hide file tree
Showing 17 changed files with 838 additions and 876 deletions.
18 changes: 14 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ obj/bflib_vidraw_spr_norm.o \
obj/bflib_vidraw_spr_onec.o \
obj/bflib_vidraw_spr_remp.o \
obj/bflib_vidsurface.o \
obj/cdrom.o \
obj/config.o \
obj/config_campaigns.o \
obj/config_creature.o \
Expand Down Expand Up @@ -346,12 +347,13 @@ LINKLIB = -mwindows \
-L"deps/ffmpeg/libavcodec" -lavcodec \
-L"deps/ffmpeg/libswresample" -lswresample \
-L"deps/ffmpeg/libavutil" -lavutil \
-L"deps/openal" -lOpenAL32 \
-L"deps/astronomy" -lastronomy \
-L"deps/enet" -lenet \
-L"deps/spng" -lspng \
-L"deps/centijson" -ljson \
-L"deps/zlib" -lminizip -lz \
-lwinmm -lmingw32 -limagehlp -lws2_32 -ldbghelp -lbcrypt
-lwinmm -lmingw32 -limagehlp -lws2_32 -ldbghelp -lbcrypt -lole32 -luuid
INCS = \
-I"deps/zlib/include" \
-I"deps/spng/include" \
Expand All @@ -362,6 +364,7 @@ INCS = \
-I"deps/centitoml" \
-I"deps/astronomy/include" \
-I"deps/ffmpeg" \
-I"deps/openal/include" \
-I"obj" # To find ver_defs.h
CXXINCS = $(INCS)

Expand All @@ -375,7 +378,7 @@ HVLOG_MAIN_OBJ = $(subst obj/,obj/hvlog/,$(MAIN_OBJ))
ENABLE_EXTRACT ?= 1

# flags to generate dependency files
DEPFLAGS = -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -DSPNG_STATIC=1
DEPFLAGS = -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -DSPNG_STATIC=1 -DAL_LIBTYPE_STATIC
# other flags to include while compiling
INCFLAGS =
# code optimization and debugging flags
Expand Down Expand Up @@ -523,7 +526,7 @@ ifdef CV2PDB
$(CV2PDB) -C "$@"
endif

obj/std/centitoml/toml_api.o obj/hvlog/centitoml/toml_api.o: deps/centitoml/toml_api.c build-before
obj/std/centitoml/toml_api.o obj/hvlog/centitoml/toml_api.o: deps/centitoml/toml_api.c
-$(ECHO) 'Building file: $<'
$(CC) $(CFLAGS) -o"$@" "$<"
-$(ECHO) ' '
Expand Down Expand Up @@ -585,7 +588,7 @@ clean-libexterns: libexterns.mk
-$(RM) -rf deps/enet deps/zlib deps/spng deps/astronomy deps/centijson
-$(RM) libexterns

deps/enet deps/zlib deps/spng deps/astronomy deps/centijson deps/ffmpeg:
deps/enet deps/zlib deps/spng deps/astronomy deps/centijson deps/ffmpeg deps/openal:
$(MKDIR) $@

src/api.c: deps/centijson/include/json.h
Expand All @@ -596,6 +599,7 @@ deps/centitoml/toml_api.c: deps/centijson/include/json.h
deps/centitoml/toml_conv.c: deps/centijson/include/json.h
src/bflib_fmvids.cpp: deps/ffmpeg/libavformat/avformat.h
obj/std/bflib_fmvids.o obj/hvlog/bflib_fmvids.o: CXXFLAGS += -Wno-error=deprecated-declarations
src/bflib_sndlib.cpp: deps/openal/AL/al.h

deps/enet-mingw32.tar.gz:
curl -Lso $@ "https://github.com/dkfans/kfx-deps/releases/download/initial/enet-mingw32.tar.gz"
Expand Down Expand Up @@ -633,6 +637,12 @@ deps/ffmpeg-mingw32.tar.gz:
deps/ffmpeg/libavformat/avformat.h: deps/ffmpeg-mingw32.tar.gz | deps/ffmpeg
tar xzmf $< -C deps/ffmpeg

deps/openal-mingw32.tar.gz:
curl -Lso $@ "https://github.com/dkfans/kfx-deps/releases/download/2024-11-14/openal-mingw32.tar.gz"

deps/openal/AL/al.h: deps/openal-mingw32.tar.gz | deps/openal
tar xzmf $< -C deps/openal

include tool_png2ico.mk
include tool_pngpal2raw.mk
include tool_png2bestpal.mk
Expand Down
1 change: 1 addition & 0 deletions deps/openal
Submodule openal added at d3875f
9 changes: 9 additions & 0 deletions mingw32.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX i686-w64-mingw32)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc-posix)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++-posix)
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
Loading

0 comments on commit 37fc04b

Please sign in to comment.