2015-08-05 19:43:31 +03:00
|
|
|
%module javaupm_lol
|
|
|
|
%include "../upm.i"
|
2015-09-14 19:30:03 +03:00
|
|
|
%include "stdint.i"
|
|
|
|
%include "arrays_java.i";
|
|
|
|
%include "typemaps.i"
|
|
|
|
|
|
|
|
%typemap(jni) unsigned char* "jbyteArray";
|
|
|
|
%typemap(jtype) unsigned char* "byte[]";
|
|
|
|
%typemap(jstype) unsigned char* "byte[]";
|
|
|
|
|
|
|
|
%typemap(javaout) unsigned char* {
|
|
|
|
return $jnicall;
|
|
|
|
}
|
|
|
|
|
|
|
|
%typemap(out) unsigned char* {
|
|
|
|
$result = JCALL1(NewByteArray, jenv, LOL_X*LOL_Y);
|
|
|
|
JCALL4(SetByteArrayRegion, jenv, $result, 0, LOL_X*LOL_Y-1, reinterpret_cast<jbyte*>($1));
|
|
|
|
delete [] $1;
|
|
|
|
}
|
2015-08-05 19:43:31 +03:00
|
|
|
|
|
|
|
%{
|
|
|
|
#include "lol.h"
|
|
|
|
%}
|
|
|
|
|
|
|
|
%include "lol.h"
|
2015-11-23 17:04:32 +02:00
|
|
|
|
|
|
|
%pragma(java) jniclasscode=%{
|
|
|
|
static {
|
|
|
|
try {
|
|
|
|
System.loadLibrary("javaupm_lol");
|
|
|
|
} catch (UnsatisfiedLinkError e) {
|
|
|
|
System.err.println("Native code library failed to load. \n" + e);
|
|
|
|
System.exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
%}
|