Commit ed8d98a3 authored by Ilya Prokhorov's avatar Ilya Prokhorov

Emscripten test

parent 993828b6
#include <FlameSteelBattleHorn/Music.h>
#include <iostream>
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
using namespace FlameSteelBattleHorn;
Music::Music(shared_ptr<string> path) {
......@@ -28,6 +32,11 @@ void Music::play() {
else {
throw runtime_error("Can't play music - music is null");
}
#else
EM_ASM({
var audio = new Audio('data/com.demensdeum.deathmaskgame.dc113.ogg');
audio.play();
});
#endif
}
......
#include <FlameSteelBattleHorn/Sound.h>
#include <iostream>
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
using namespace FlameSteelBattleHorn;
void Sound::initializeSoundSystem() {
......@@ -39,7 +43,7 @@ Sound::Sound(shared_ptr<string> path) {
cout << "Can't load sound " << Mix_GetError() << endl;
throw runtime_error("Can't load sound");
}
#endif
}
......@@ -51,6 +55,11 @@ void Sound::play() {
printf("Mix_PlayChannel: %s\n",Mix_GetError());
}
}
#else
EM_ASM({
var audio = new Audio('data/com.demensdeum.deathmask.beep.ogg');
audio.play();
});
#endif
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment