Skip to content

Commit

Permalink
Audio Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-ys committed Dec 24, 2023
1 parent e8c8760 commit 5876b3e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CXX=g++
CPPFLAGS=-std=c++2a -Iinclude -Igame/include -Ilib/include
CPPFLAGS=-std=c++2a -Iinclude -Igame/include -Ilib/include -DMA_NO_PULSEAUDIO
LDLIBS=
OBJS=graphics/*.cpp logging/*.cpp models/*.cpp level/*.cpp audio/*.cpp game/*.cpp game/entities/*.cpp game/UI/*.cpp util/*.cpp main.cpp
VER=vA1
Expand All @@ -14,6 +14,7 @@ ifndef PDCURSES_BACKEND
USE_NCURSES=1
endif
PDCURSES_BACKEND=x11
LDLIBS+= -lpthread -lm -ldl
endif
endif
endif
Expand Down
5 changes: 3 additions & 2 deletions audio/audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ void MiniaudioManager::playMusic(std::string track, float volume) {
if (playing) stopMusic();
playing = true;
cMusic = new ma_sound;
const char* path = (rootPath + "music/" + track).c_str();
ma_result res = ma_sound_init_from_file(engine, path, 0, NULL, NULL, cMusic);
std::string path = rootPath + "music/" + track;
const char* path_str = path.c_str();
ma_result res = ma_sound_init_from_file(engine, path_str, 0, NULL, NULL, cMusic);
ma_sound_set_volume(cMusic, volume);
ma_sound_set_looping(cMusic, true);
ma_sound_start(cMusic);
Expand Down
1 change: 1 addition & 0 deletions log2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[?1049h(B[?7h[?1006;1000hHealth: 100~~~~~~~~~~~~~Time elapsed: 0:0~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~!~~~~$~~~~~~~~~~~~~~~~~~~~~~ ~~~~ ~~~~~~@~~~#########~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~######-------------------------------------------------------------------------------|WELCOME TO SPYLIKE!|CONTROLS:|W,A,S,D MOVEMENT|V,B,N,G ATTACK|ESC PAUSE|||||v|------------------------------||||||| Start game || Quit |||||||------------------------------||||||||||||||-------------------------------------------------------------------------------|v| || v|v| || v|v| || v|v| || v|v| || v[?1006;1000l[?1049l[?1l>
Expand Down

0 comments on commit 5876b3e

Please sign in to comment.