|
|
12-14-2012
, 05:20 PM
|
|
Posts: 456 |
Thanked: 444 times |
Joined on Dec 2011
@ lebanon
|
#11
|
|
|
12-14-2012
, 05:42 PM
|
|
|
Posts: 124 |
Thanked: 124 times |
Joined on Sep 2010
|
#12
|
I think that wrapper-generator is only used to make wrappers for
Android built in libraries (libc, gles, pthread etc. check apkenv source/compat directory) and it has nothing to do with modules.
.|
|
12-15-2012
, 08:53 AM
|
|
Posts: 18 |
Thanked: 85 times |
Joined on Dec 2012
|
#13
|
Art-O may ask how do you compile your modules if is not to much to ask.
previous version of angry birds /seasons/space work great . only the new ones and star wars .
|
|
12-15-2012
, 09:15 AM
|
|
|
Posts: 1,316 |
Thanked: 3,758 times |
Joined on Sep 2007
@ Vienna, Austria
|
#14
|
I started this ApkEnv support module development thread so that maybe we get more devs working on this.
Glad that somebody finally created a working module 
| The Following 12 Users Say Thank You to thp For This Useful Post: | ||
Art-O, Bundyo, don_falcone, ersanpermana, Kozzi, MINKIN2, mosiomm, myname24, nonikhanna, noxl, ranbaxy, Wreck | ||
|
|
12-19-2012
, 04:46 PM
|
|
Posts: 18 |
Thanked: 85 times |
Joined on Dec 2012
|
#15
|
Have a look at the nativeMixData function - all JNI methods take an JNIEnv * as their first method, the second one is the object on which the function is called (for our purposes, this is mostly "any" object - I usually pass a pointer to the global object there, but any random pointer should work). The third parameter is a long that you can use to pass an application-specific pointer. The fourth is a pointer to the buffer which is filled with audio data, and the fifth is the length of that buffer.
Would be great if you could submit your modules as pull request to apkenv on Github
typedef void (*angrybirds_mixdata_t)(JNIEnv *env, jobject obj, jlong paramLong, jbyteArray paramArrayOfByte, jint paramInt) SOFTFP;
/* Open the audio device */
SDL_AudioSpec *desired, *obtained;
desired = malloc(sizeof(SDL_AudioSpec));
obtained = malloc(sizeof(SDL_AudioSpec));
desired->freq=44100;
desired->format=AUDIO_S16SYS;
desired->channels=2;
desired->samples=8192;
desired->callback=my_audio_callback;
desired->userdata=p0;
if( SDL_InitSubSystem(SDL_INIT_AUDIO) < 0 )
exit(-1);
if ( SDL_OpenAudio(desired, obtained) < 0 )
exit(-1);
free(desired);
SDL_PauseAudio(0);
void my_audio_callback(void *ud, Uint8 *stream, int len)
{
printf("call mixdata (%i)\n",len);
jlong tmplong = 0;
jbyte* buffer = calloc(len,1);
angrybirds_priv.native_mixdata(ENV(global), VM(global), (jlong)&tmplong, buffer, len);
memcpy(stream,buffer,len);
free(buffer);
}
| The Following User Says Thank You to Art-O For This Useful Post: | ||
|
|
12-20-2012
, 07:12 AM
|
|
|
Posts: 1,316 |
Thanked: 3,758 times |
Joined on Sep 2007
@ Vienna, Austria
|
#16
|
| The Following 6 Users Say Thank You to thp For This Useful Post: | ||
|
|
12-20-2012
, 02:42 PM
|
|
Posts: 18 |
Thanked: 85 times |
Joined on Dec 2012
|
#17
|
When the AudioOutput gets created (NewObjectV), it gives you a long handle, the sample rate int, the number of channels int, the bitrate int and the buffer size int in the variable argument list. You need to use these, and especially pass the handle that you get as first parameter to the mixing function as third parameter. Also, there's no need to calloc/memcpy/free the buffer, you can directly provide the stream pointer to the mixing function.
|
|
12-20-2012
, 04:43 PM
|
|
|
Posts: 124 |
Thanked: 124 times |
Joined on Sep 2010
|
#18
|
Thanks for help, I finally got it working![]()
I started new fork at https://github.com/Art-O/apkenv and made that pull request for this one.
Also updated attachment on front page.
Next stop Fruit Ninja audio
|
|
12-21-2012
, 05:38 PM
|
|
|
Posts: 124 |
Thanked: 124 times |
Joined on Sep 2010
|
#19
|
|
|
12-21-2012
, 07:52 PM
|
|
Posts: 18 |
Thanked: 85 times |
Joined on Dec 2012
|
#20
|
Hey Art-O how do you locate the Init input and the OpenGL update methods on the decompiled apk.
Not supported yet, but found JNI methods:
Java_com_rovio_ka3d_MyRenderer_nativeGetPossibleOrientations
Java_com_rovio_ka3d_MyRenderer_nativePause
Java_com_rovio_ka3d_MyRenderer_nativeResume
JNI_OnLoad
Java_com_rovio_ka3d_MyRenderer_nativeResize
Java_com_rovio_ka3d_MyRenderer_nativeKeyInput
Java_com_rovio_ka3d_MyRenderer_nativeInput
Java_com_rovio_ka3d_MyRenderer_nativeUpdate
...
![]() |
| Thread Tools | Search this Thread |
|