Ignore:
Timestamp:
Mar 12, 2013, 4:54:36 PM (10 years ago)
Author:
sam
Message:

android: open files through the asset manager, meaning Lua works.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/platform/android/androidapp.cpp

    r2583 r2584  
    1616
    1717#include <jni.h>
     18#include <android/asset_manager_jni.h>
    1819
    1920#include <EGL/egl.h>
     
    3435JavaVM *g_vm;
    3536jobject g_activity;
     37AAssetManager *g_assets;
    3638}; /* namespace lol */
    3739
     
    4547
    4648extern "C" void
    47 Java_net_lolengine_LolActivity_nativeInit(JNIEnv* env, jobject thiz)
     49Java_net_lolengine_LolActivity_nativeInit(JNIEnv* env, jobject thiz,
     50                                          jobject assets)
    4851{
    4952    Log::Info("Java layer initialising activity 0x%08lx", (long)thiz);
    5053    env->NewGlobalRef(thiz); /* FIXME: never released! */
    5154    g_activity = thiz;
     55    env->NewGlobalRef(assets); /* FIXME: never released! */
     56    g_assets = AAssetManager_fromJava(env, assets);
    5257}
    5358
Note: See TracChangeset for help on using the changeset viewer.