mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-09 02:07:04 +08:00
* build: add OpenAL dependency * feat(deps): add dr_libs audio library * feat(audio): integrate OpenAL audio engine with WAV/MP3/FLAC support * feat: add bgm001 * feat(audio): add audio fade in/out and fix delta time naming * fix(audio-source): improve state, volume, and const correctness * feat(audio): add 3D audio playback with source pool and auto-loading * feat: add ogg loader * feat(audio): add footstep sounds and fix audio listener orientation * feat(sound): add block place and break sounds * feat(audio): add per-channel volume control and config reload * fix(audio): set distance model, reduce max distance, fix sound pos - Set OpenAL distance model to AL_INVERSE_DISTANCE_CLAMPED in engine. - Reduced AL_MAX_DISTANCE from 100 to 48 for better falloff. - Fixed block sound position to use world coordinates instead of local block coordinates. * refactor(game_time): introduce Timer for time-based updates and rename existing to TickTimer Add a new `Timer` class that operates in seconds (using `TimeType`) alongside the existing `TickTimer` which uses `TickType`. Rename the original `Timer` to `TickTimer` throughout the codebase. Update `ClientWorld` to maintain separate maps for tick-based and time-based timers, and replace the hardcoded footstep timer in `ClientPlayer` with a time-based callback timer. Also add `play_2d` to `AudioEngine` and load an ambient bird sound to demonstrate the new timer functionality. * feat(gameplay): add ocean wave ambient sounds with random selection Add four ocean wave FLAC sound files and play one randomly when player is within 10 blocks of sea level and in an ocean biome. Include a Random member initialized from ChunkGenerator seed for consistent randomization. * feat(gameplay): detect underwater state and play transition/bubble sounds - Add is_underwater() and set_underwater() to ClientPlayer. - Change get_world() to return non-const reference for audio access. - Update Camera::update_move_camera() to detect water block changes and trigger transition sound. - Add repeating timer in ClientWorld to play random bubble ambient sounds while underwater. - Include new ambient sound assets for water transitions and bubbles. - Also add sand walk sound asset (unused in this commit). * feat(assets): add and update block break/place/walk sounds Add sounds for dirt, grass_block, leaf, log, sand, snowy_grass_block, stone. Update existing leaf/walk, sand/place, sand/walk, and stone/place sounds. * feat(gameplay): add walking sound for players and adjust underwater bubble interval - Move walk/run sound interval constants from anonymous namespace to ClientPlayer header - Add moving_time field to PlayerInfo to track continuous movement - Implement play_walk_sound callback triggered by WALK and RUN gaits - Increase underwater bubble timer from 1.0s to 1.5s * feat(asset): add grass block break and place sound effects * feat(renderer): add --no-debug flag to disable OpenGL debug output * feat(audio): add day/night-based BGM switching * feat(audio): add underwater low-pass filter effect * feat(audio): add pitch control to audio sources Implement set_pitch method that clamps pitch between 0.0 and 1.0 and applies it via AL_PITCH. Includes minor whitespace cleanup in audio_engine.cpp. * feat(audio): implement reverb effect and integrate into underwater system * asset(sound): update dirt and grass block break/place sounds * feat(network): synchronize player water sound * fix: include <numbers> * fix(audio): play ambient water bubble sound in 3D at player position
204 KiB
204 KiB