mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-09-30 19:07:59 +03:00
CDDA support for emscripten
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
ALICE SOFT SYSTEM 3 for Emscripten
|
||||
[ MAKO ]
|
||||
*/
|
||||
|
||||
#include <emscripten.h>
|
||||
#include "mako.h"
|
||||
|
||||
MAKO::MAKO(NACT* parent)
|
||||
: current_music(0)
|
||||
, next_loop(0)
|
||||
{
|
||||
for (int i = 1; i <= 99; i++)
|
||||
cd_track[i] = i;
|
||||
}
|
||||
|
||||
void MAKO::play_music(int page)
|
||||
{
|
||||
if (current_music == page)
|
||||
return;
|
||||
|
||||
current_music = page;
|
||||
int loop_count = next_loop;
|
||||
next_loop = 0;
|
||||
|
||||
EM_ASM_ARGS({ xsystem35.cdPlayer.play($0, $1); },
|
||||
cd_track[page] + 1, loop_count);
|
||||
}
|
||||
|
||||
void MAKO::stop_music()
|
||||
{
|
||||
if (current_music)
|
||||
EM_ASM( xsystem35.cdPlayer.stop(); );
|
||||
|
||||
current_music = 0;
|
||||
}
|
||||
Reference in New Issue
Block a user