Skip to content

Commit

Permalink
Initial sound implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyPtn authored Oct 16, 2024
1 parent 1b68a49 commit 8c95b79
Show file tree
Hide file tree
Showing 4 changed files with 748 additions and 1,587 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ include(FetchContent)
# SFML we take from master - can pin to an SFML 3 release when there is one
# We use this for window, audio and graphics
set(SFML_STATIC_LIBRARIES ON)
set(SFML_FIND_COMPONENTS Graphics)
set(SFML_FIND_COMPONENTS Graphics Audio)
FetchContent_Declare(
sfml
GIT_REPOSITORY https://github.com/sfml/sfml
Expand All @@ -47,7 +47,7 @@ FetchContent_Declare(
FetchContent_MakeAvailable(sfml spdlog)

# Link them
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE SFML::Graphics spdlog::spdlog)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE SFML::Graphics SFML::Audio spdlog::spdlog)

# Sym link the wads folder into the build output
if(APPLE)
Expand Down
6 changes: 3 additions & 3 deletions src/main.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import intermission;
import video;
import status_bar;
import hud;
import sound;

// List of wad files we populate on start up
std::vector<std::string> wadfilenames;
Expand Down Expand Up @@ -390,9 +391,6 @@ void D_DoomLoop(void) {

// Update display, next frame, with current state.
D_Display();

// Sound mixing for the buffer is snychronous.
I_UpdateSound();
}
}

Expand Down Expand Up @@ -793,6 +791,8 @@ export void D_DoomMain(void) {
printf("\nP_Init: Init Playloop state.\n");
P_Init();

I_InitSound();

printf("I_Init: Setting up machine state.\n");
I_Init();

Expand Down
Loading

0 comments on commit 8c95b79

Please sign in to comment.