Conversation
Add wood/stone/gold/iron pickaxe textures and embed them in the build; register new tool IDs and include the textures in the tool model loader. Expose the tools in the creative inventory. Implement player swing state (isSwinging, swingProgress), set swinging on mouse actions, advance swing progress each frame (with a loop mode while holding the mine button in survival), and apply a sinusoidal transform when rendering the held item to show a swing animation.
Introduce a separate block placement animation and runtime tuning UI. Added Player fields (isPlacing, placeProgress) and update logic in main loop to advance/place timing. Renderer was updated to support placing animations and configurable block transforms/tuning (g_blockTransform, g_blockSwingTuning, g_blockPlaceTuning) and to apply easing for place animation; swing logic was slightly adjusted and made use of tuning values. Debug UI now exposes controls to edit/reset block transform, swing and place tuning values. Also minor ImGui window position tweak (imgui.ini).
Introduce a new audio subsystem using miniaudio: add AudioEngine (cpp/h) and AudioTypes, plus bundled thirdparty/miniaudio.h. Add numerous .ogg sound assets under assets/sounds (footsteps, block dig, damage, liquid). Integrate audio into the app: compile AudioEngine via CMake, add extra Windows link deps (ole32, avrt), expose g_audioEngine global, initialize audio in main, update listener and engine each frame, and trigger footstep/block place/break sounds. Implementation includes spatialized one-shot playback, ambient streaming loops, and simple volume fading.
Embed stb_vorbis decoder and compile it as a separate C translation unit to avoid C/C++ header conflicts; added src/thirdparty/stb_vorbis.c and a small wrapper src/audio/stb_vorbis_impl.c, and updated src/CMakeLists.txt to include the new audio translation unit. Refactor AudioEngine::Impl ActiveOneShot to use std::unique_ptr<ma_sound> with proper zero-initialization and updated all ma_sound_* calls to use the pointer API (.get()). Include necessary headers (<cstring>, <memory>) and pull in a header-only declaration of stb_vorbis within AudioEngine.cpp to expose the API without conflicting definitions. Also updated imgui.ini to adjust several ImGui window positions/sizes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new audio engine to the project, enabling sound effects for player actions such as footsteps, block breaking, and block placing. It also adds support for multiple pickaxe types, updates the rendering logic for held items to allow for more dynamic animations, and embeds additional assets for these features. The most important changes are summarized below:
Audio Engine Integration:
AudioEngineclass with support for initializing, updating, and shutting down audio, as well as playing sounds for footsteps, block breaking, and block placing. Integrated the engine into the main game loop and player actions. (src/audio/AudioEngine.h,src/audio/AudioEngine.cpp,src/core/MainGlobals.cpp,src/core/MainGlobals.h,src/core/main.cpp, [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]SurfaceTypeand a helper function to map block IDs to surface types for context-sensitive footstep sounds. (src/audio/AudioTypes.h, src/audio/AudioTypes.hR1-R36)stb_vorbisto support audio decoding. (src/audio/stb_vorbis_impl.c, src/audio/stb_vorbis_impl.cR1-R3)src/CMakeLists.txt, [1] [2]Gameplay and Animation Enhancements:
src/gameplay/Player.h,src/gameplay/Player.cpp,src/core/main.cpp, [1] [2] [3]src/core/Renderer.cpp, [1] [2]Asset and Inventory Updates:
src/CMakeLists.txt,src/gameplay/Inventory.cpp, [1] [2] [3]src/CMakeLists.txt, [1] [2] [3]These changes collectively enhance the game's immersion with audio feedback, expand the available tools, and improve the visual and interactive experience.