mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-09-28 01:48:09 +03:00
CDDA support for emscripten
This commit is contained in:
+2
-1
@@ -31,4 +31,5 @@ LINUXOBJS := \
|
||||
src/linux/mako_linux.o
|
||||
|
||||
EMOBJS := \
|
||||
src/linux/nact_linux.o
|
||||
src/linux/nact_linux.o \
|
||||
src/emscripten/mako.o
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
+4
-5
@@ -132,11 +132,11 @@ public:
|
||||
|
||||
class MAKO {
|
||||
public:
|
||||
MAKO(NACT* parent) {}
|
||||
MAKO(NACT* parent);
|
||||
|
||||
void play_music(int page) { playing = true; }
|
||||
void stop_music() { playing = false; }
|
||||
bool check_music() { return playing; }
|
||||
void play_music(int page);
|
||||
void stop_music();
|
||||
bool check_music() { return current_music != 0; }
|
||||
void get_mark(int* mark, int* loop) {}
|
||||
void notify_mci(int status) {}
|
||||
|
||||
@@ -157,7 +157,6 @@ public:
|
||||
_TCHAR amus[16];
|
||||
_TCHAR amse[16];
|
||||
|
||||
bool playing;
|
||||
int current_music;
|
||||
int next_loop; // Y19
|
||||
int cd_track[100]; // Z
|
||||
|
||||
Reference in New Issue
Block a user