add more host apis

This commit is contained in:
Anthony Samms
2025-09-21 03:11:47 -04:00
parent b14505db32
commit 0a45792fb7
3 changed files with 36 additions and 15 deletions

View File

@@ -27,9 +27,9 @@ ifneq (,$(findstring MINGW,$(UNAME_S)))
# Core libraries with full dependency chain (order is critical!) # Core libraries with full dependency chain (order is critical!)
CORE_LIBS = CORE_LIBS =
# Check for local libportaudio.a first, then system location # Check for local Windows-specific libportaudio first, then system location
ifneq (,$(wildcard ./libportaudio.a)) ifneq (,$(wildcard ./libportaudio-win.a))
CORE_LIBS += ./libportaudio.a CORE_LIBS += ./libportaudio-win.a
else ifneq (,$(wildcard /mingw64/lib/libportaudio.a)) else ifneq (,$(wildcard /mingw64/lib/libportaudio.a))
CORE_LIBS += /mingw64/lib/libportaudio.a CORE_LIBS += /mingw64/lib/libportaudio.a
else else
@@ -95,11 +95,18 @@ else ifeq ($(UNAME_S),Darwin)
CFLAGS += -I/usr/local/include -I/opt/homebrew/include CFLAGS += -I/usr/local/include -I/opt/homebrew/include
LDFLAGS = -shared -undefined dynamic_lookup -L/usr/local/lib -L/opt/homebrew/lib LDFLAGS = -shared -undefined dynamic_lookup -L/usr/local/lib -L/opt/homebrew/lib
# Core libraries # Core libraries - check for local macOS-specific portaudio first
LIBS = -lportaudio -lsndfile -lsamplerate CORE_LIBS =
ifneq (,$(wildcard ./libportaudio-macos.a))
CORE_LIBS += ./libportaudio-macos.a
else
CORE_LIBS += -lportaudio
endif
CORE_LIBS += -lsndfile -lsamplerate
# macOS frameworks # macOS frameworks
LIBS += -framework CoreAudio -framework AudioToolbox -framework AudioUnit LIBS = $(CORE_LIBS) -framework CoreAudio -framework AudioToolbox -framework AudioUnit
LIBS += -framework CoreFoundation -framework CoreServices LIBS += -framework CoreFoundation -framework CoreServices
OBJ_EXT = .o OBJ_EXT = .o
@@ -110,8 +117,15 @@ else ifeq ($(UNAME_S),Linux)
# Check for pkg-config availability # Check for pkg-config availability
PKG_CONFIG := $(shell command -v pkg-config 2> /dev/null) PKG_CONFIG := $(shell command -v pkg-config 2> /dev/null)
# Core audio libraries (required) # Core audio libraries (required) - check for local Linux-specific portaudio first
CORE_LIBS = -lportaudio -lsndfile CORE_LIBS =
ifneq (,$(wildcard ./libportaudio-linux.a))
CORE_LIBS += ./libportaudio-linux.a
else
CORE_LIBS += -lportaudio
endif
CORE_LIBS += -lsndfile
# Check for libsamplerate # Check for libsamplerate
ifeq ($(call check_lib,samplerate),yes) ifeq ($(call check_lib,samplerate),yes)
@@ -194,9 +208,9 @@ all: check-deps $(LIBNAME)
# Build targets # Build targets
ifneq (,$(findstring Windows,$(UNAME_S))) ifneq (,$(findstring Windows,$(UNAME_S)))
$(LIBNAME): $(OBJECTS) $(LIBNAME): $(OBJECTS)
# Check if we need C++ linking (if libportaudio.a contains C++ code) # Check if we need C++ linking (if libportaudio-win.a contains C++ code)
@if nm ./libportaudio.a 2>/dev/null | grep -q "operator\|__gxx_personality"; then \ @if [ -f "./libportaudio-win.a" ] && nm ./libportaudio-win.a 2>/dev/null | grep -q "operator\|__gxx_personality"; then \
echo "Detected C++ code in libportaudio.a - using C++ linker"; \ echo "Detected C++ code in libportaudio-win.a - using C++ linker"; \
$(CXX) $(LDFLAGS) -o $@ $^ -Wl,--start-group $(LIBS) -Wl,--end-group; \ $(CXX) $(LDFLAGS) -o $@ $^ -Wl,--start-group $(LIBS) -Wl,--end-group; \
else \ else \
echo "Using C linker"; \ echo "Using C linker"; \
@@ -233,8 +247,8 @@ check-deps:
@echo "Compiler: $(CC)" @echo "Compiler: $(CC)"
ifneq (,$(findstring MINGW,$(UNAME_S))) ifneq (,$(findstring MINGW,$(UNAME_S)))
@echo "=== MinGW Libraries ===" @echo "=== MinGW Libraries ==="
@echo "Checking for local libportaudio.a:" @echo "Checking for Windows-specific libportaudio:"
@ls -la ./libportaudio.a 2>/dev/null && echo "✓ Found local libportaudio.a" || echo "✗ No local libportaudio.a" @ls -la ./libportaudio-win.a 2>/dev/null && echo "✓ Found local libportaudio-win.a" || echo "✗ No local libportaudio-win.a"
@echo "Available system static libraries:" @echo "Available system static libraries:"
@ls /mingw64/lib/lib{portaudio,sndfile,samplerate,FLAC,vorbis*,ogg}.a 2>/dev/null || echo "None found" @ls /mingw64/lib/lib{portaudio,sndfile,samplerate,FLAC,vorbis*,ogg}.a 2>/dev/null || echo "None found"
@echo "Static pthread library:" @echo "Static pthread library:"
@@ -242,6 +256,8 @@ ifneq (,$(findstring MINGW,$(UNAME_S)))
@echo "Libraries to link: $(LIBS)" @echo "Libraries to link: $(LIBS)"
else ifeq ($(UNAME_S),Linux) else ifeq ($(UNAME_S),Linux)
@echo "=== Linux Package Check ===" @echo "=== Linux Package Check ==="
@echo "Checking for Linux-specific libportaudio:"
@ls -la ./libportaudio-linux.a 2>/dev/null && echo "✓ Found local libportaudio-linux.a" || echo "✗ No local libportaudio-linux.a"
ifdef PKG_CONFIG ifdef PKG_CONFIG
@echo "pkg-config available: yes" @echo "pkg-config available: yes"
@echo -n "PortAudio: "; pkg-config --exists portaudio-2.0 && echo "✓" || echo "✗" @echo -n "PortAudio: "; pkg-config --exists portaudio-2.0 && echo "✓" || echo "✗"
@@ -254,6 +270,11 @@ else
@echo "pkg-config not available" @echo "pkg-config not available"
endif endif
@echo "Libraries to link: $(LIBS)" @echo "Libraries to link: $(LIBS)"
else ifeq ($(UNAME_S),Darwin)
@echo "=== macOS Package Check ==="
@echo "Checking for macOS-specific libportaudio:"
@ls -la ./libportaudio-macos.a 2>/dev/null && echo "✓ Found local libportaudio-macos.a" || echo "✗ No local libportaudio-macos.a"
@echo "Libraries to link: $(LIBS)"
else else
@echo "Libraries to link: $(LIBS)" @echo "Libraries to link: $(LIBS)"
endif endif

Binary file not shown.

View File

@@ -785,10 +785,10 @@ class Player:
tex.draw_texture('lane', 'lane_hit_circle') tex.draw_texture('lane', 'lane_hit_circle')
# Group 2: Judgement and hit effects # Group 2: Judgement and hit effects
for anim in self.draw_judge_list:
anim.draw()
if self.gogo_time is not None: if self.gogo_time is not None:
self.gogo_time.draw() self.gogo_time.draw()
for anim in self.draw_judge_list:
anim.draw()
# Group 3: Notes and bars (game content) # Group 3: Notes and bars (game content)
self.draw_bars(current_ms) self.draw_bars(current_ms)