Adobe Alchemy compiled SWC - not sure how to compile library for FlasCC

829 Views Asked by At

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

There are 1 best solutions below

2
On

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