1%module javaupm_lol 2%include "../upm.i" 3%include "stdint.i" 4%include "arrays_java.i"; 5%include "typemaps.i" 6 7%typemap(jni) unsigned char* "jbyteArray"; 8%typemap(jtype) unsigned char* "byte[]"; 9%typemap(jstype) unsigned char* "byte[]"; 10 11%typemap(javaout) unsigned char* { 12 return $jnicall; 13} 14 15%typemap(out) unsigned char* { 16 $result = JCALL1(NewByteArray, jenv, LOL_X*LOL_Y); 17 JCALL4(SetByteArrayRegion, jenv, $result, 0, LOL_X*LOL_Y-1, reinterpret_cast<jbyte*>($1)); 18 delete [] $1; 19} 20 21%{ 22 #include "lol.h" 23%} 24 25%include "lol.h" 26