fix some shit

This commit is contained in:
/nick haya 2022-02-14 13:58:13 +08:00
parent e79cc51581
commit 14feb83222
3 changed files with 6 additions and 4 deletions

View file

@ -29,7 +29,7 @@ You know how to place them. It's fucking common sense.
- [SoLoud fork.](https://github.com/haya3218/soloud) Follow GENie instructions and build as a static library.
- You also need to build libmodplug with it as well.
- If you are gonna be using the OpenMPT module, you'll need the libopenmpt dll in your exe directory as well.
- Prebuilt binaries (with OpenMPT) are [here.](https://cdn.discordapp.com/attachments/872338952483381258/942306540159909918/libraries.7z)
- Prebuilt binaries (with OpenMPT) are [here.](https://cdn.discordapp.com/attachments/872338952483381258/942572007705440346/SoLoudMasterBuildSDL2libmodplug.7z)
- Clone the dam repo somewhere on ur machine.
- Go to where you cloned it, and run `cmake -B build -DCMAKE_BUILD_TYPE=Release`
- After successfully making the build files, run `cmake --build --config Release` to build it without the use of VStudio.

View file

@ -39,6 +39,7 @@ SoLoud::WavStream Render::waveLoader;
SoLoud::Openmpt Render::modLoader;
SoLoud::Modplug Render::modPlugLoader;
SoLoud::Midi Render::midiLoader;
SoLoud::WavStream Render::sfxLoader;
SoLoud::SoundFont Render::current_sf;
string Render::currentMusic = "";
HWND Render::hwnd;
@ -372,12 +373,12 @@ void Render::SwitchState(State* state) {
bool Render::playSound(string path, bool override) {
log("", "Played sound from " + path, NORMAL, __FILENAME__, __LINE__);
waveLoader.setLooping(false);
sfxLoader.setLooping(false);
if (override) {
music.stop(seIndex);
}
waveLoader.load(path.c_str());
seIndex = music.play(waveLoader);
sfxLoader.load(path.c_str());
seIndex = music.play(sfxLoader);
return true;
}

View file

@ -263,6 +263,7 @@ namespace Render {
extern SoLoud::Soloud se;
extern SoLoud::Soloud music;
extern SoLoud::WavStream waveLoader;
extern SoLoud::WavStream sfxLoader;
extern SoLoud::Openmpt modLoader;
extern SoLoud::Modplug modPlugLoader;
extern SoLoud::Midi midiLoader;