diff --git a/project/src/common/ExternalInterface.cpp b/project/src/common/ExternalInterface.cpp index ed6880059..41d4cab39 100644 --- a/project/src/common/ExternalInterface.cpp +++ b/project/src/common/ExternalInterface.cpp @@ -3691,6 +3691,67 @@ value lime_bitmap_data_dump_bits(value inSurface) DEFINE_PRIM(lime_bitmap_data_dump_bits,1); +value lime_surface_get_base(value inSurface) +{ + Surface *surf; + if (AbstractToObject(inSurface,surf)) + { + return alloc_int((intptr_t)surf->GetBase()); + } + return alloc_null(); +} +DEFINE_PRIM(lime_surface_get_base,1); + + +value lime_surface_get_stride(value inSurface) +{ + Surface *surf; + if (AbstractToObject(inSurface,surf)) + { + return alloc_int(surf->GetStride()); + } + return alloc_null(); +} +DEFINE_PRIM(lime_surface_get_stride,1); + + +value lime_surface_begin_render(value inSurface, value inRect) +{ + Surface *surf; + if (AbstractToObject(inSurface,surf)) + { + Rect rect; + FromValue(rect,inRect); + surf->BeginRender(rect); + } + return alloc_null(); +} +DEFINE_PRIM(lime_surface_begin_render,2); + + +value lime_surface_end_render(value inSurface) +{ + Surface *surf; + if (AbstractToObject(inSurface,surf)) + { + surf->EndRender(); + } + return alloc_null(); +} +DEFINE_PRIM(lime_surface_end_render,1); + + +/*value lime_surface_get_pixel_format(value inSurface) +{ + Surface *surf; + if (AbstractToObject(inSurface,surf)) + { + return alloc_int(surf->GetStride()); + } + return alloc_null(); +}*/ + + // --- Video -------------------------------------------------- diff --git a/project/src/platform/android/JNI.cpp b/project/src/platform/android/JNI.cpp index 5e87afbfe..2b20c6a6e 100644 --- a/project/src/platform/android/JNI.cpp +++ b/project/src/platform/android/JNI.cpp @@ -1187,7 +1187,7 @@ DEFINE_PRIM(lime_jni_call_member,3); value lime_jni_get_env() { JNIEnv *env = GetEnv(); - return alloc_int((int)env); + return alloc_int((intptr_t)env); } DEFINE_PRIM(lime_jni_get_env,0);