2

I'm trying to get game-music-emu-flash working with FlasCC. It uses the C/C++ Game_Music_Emu library and was originally compiled with Alchemy, but I want to see if there is a performance increase with FlasCC. I'd like to use SWIG with typemaps to call the library since the current project ActionScript is not compatible with FlasCC. I'm following code from the samples. I haven't coded the typemaps yet but for now I created swig.i as

#ifdef SWIG
%module libgmeLibModule
%{
#include "gme/gme.h"
%}
%include "gme/gme.h"
#else
#include "gme/gme.h"
#endif

and the Makefile follows the samples closely by replacing what's needed to match. During compilation I'm getting similar errors all in the form

libgmeLib_wrapper.cpp: In function `void _wrap_gme_ay_type_get()':
libgmeLib_wrapper.cpp:2575: error: invalid conversion from `const void*' to `void*'
libgmeLib_wrapper.cpp:2575: error:   initializing argument 1 of `void* memcpy(void*, const void*, size_t)'

Compiling with

"$(FLASCC)/usr/bin/g++" $(BASE_CFLAGS) -04 gmemain.cpp gme/*.cpp -emit-swc=sample.libgme -o libgme.swc

in the Makefile by itself under all: compiles without errors.

I don't know C++ that well so any help is appreciated. Also would using SWIG and typemaps be the way to go or would manually wrapping make sense? I thought SWIG would be better since gme is a decent sized library.

1 Answers1

1

An Adobe staffer helped me out with this. He even coded a demo. The Adobe forum thread can be found here and his demo can be found at gme-flascc

  • Hmm, so does this play one of the supported file-formats directly to the primary sound driver on your computer? Or do you need to pass it the file bytearray first, then get the output and pass that to a SampleDataEvent on a Sound object in AS3? – chamberlainpi Mar 31 '13 at 22:16
  • I'm using a ByteArray and a Sound object. gme-flascc is using vfs just to test it. – Steve Gamsey Apr 01 '13 at 05:47