prepare android project build

This commit is contained in:
artem.budarin committed 2018-08-01 13:31:24 +05:00
1 parent b726e55f94
commit fe73d7bec9
18 files changed
+580 -225

No files matched your search

+2 -142
View File
@@ -2,149 +2,9 @@
#include "main_code.h"
//#include "boost/shared_ptr.h"
const float CONST_MAXRIX_WIDTH = 800.f;
const float CONST_MAXRIX_HEIGHT = 480.f;
boost::mutex RenderMutex;
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_Init(JNIEnv * env, jobject obj, jint width, jint height)
JNIEXPORT void JNICALL Java_com_fishrungames_crystalofrhylil_JniWrapper_Init(JNIEnv * env, jobject obj, jint width, jint height)
{
try
{
if (App->Inited)
{
App->OuterDeinit(); //Clean up what is left at previous launch (if applicable)
}
App->OuterInit(width, height, CONST_MAXRIX_WIDTH, CONST_MAXRIX_HEIGHT);
App->Inited = true;
}
catch (ErrorCommon e)
{
throw;
}
}
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_StopSounds(JNIEnv * env, jobject obj)
{
JniInitApp<TMyApplication>(width, height, width, height);
}
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_Update(JNIEnv * env, jobject obj, long dt)
{
RenderMutex.lock();
try
{
if (App->Inited)
{
App->OuterDraw();
App->OuterUpdate(dt);
}
}
catch (...)
{
throw;
}
RenderMutex.unlock();
}
JNIEXPORT int JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_IsInited(JNIEnv * env, jobject obj)
{
if (App->Inited)
{
return 1;
}
else
{
return 0;
}
}
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_Destroy(JNIEnv * env, jobject obj)
{
RenderMutex.lock();
try
{
if (App->Inited)
{
App->Inited = false;
App->OuterDeinit();
}
}
catch (ErrorCommon e)
{
throw;
}
RenderMutex.unlock();
}
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnTapDown(JNIEnv * env, jobject obj, float x, float y, long time)
{
try
{
App->OuterOnTapDown(vec2(x*CONST_MAXRIX_WIDTH/HalibutRender->GetScreenWidth(), y*CONST_MAXRIX_HEIGHT/HalibutRender->GetScreenHeight()));
}
catch (ErrorCommon e)
{
throw;
}
}
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnTapUp(JNIEnv * env, jobject obj, float x, float y, long time)
{
try
{
App->OuterOnTapUp(vec2(x*CONST_MAXRIX_WIDTH/HalibutRender->GetScreenWidth(), y*CONST_MAXRIX_HEIGHT/HalibutRender->GetScreenHeight()));
}
catch (ErrorCommon e)
{
throw;
}
}
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnTapMove(JNIEnv * env, jobject obj, float x, float y, long time)
{
}
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnFling(JNIEnv * env, jobject obj, jfloat velocityX, jfloat velocityY, long time)
{
}
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnScroll(JNIEnv * env, jobject obj, jfloat distanceX, jfloat distanceY, long time)
{
try
{
App->OuterOnMove(vec2(distanceX*CONST_MAXRIX_WIDTH/HalibutRender->GetScreenWidth(), distanceY*CONST_MAXRIX_HEIGHT/HalibutRender->GetScreenHeight()));
}
catch (ErrorCommon e)
{
throw;
}
}
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnKeyPress(JNIEnv * env, jobject obj, jint keyCode)
{
try
{
App->OnKeyPress(keyCode);
}
catch (ErrorCommon e)
{
throw;
}
}
+6 -12
View File
@@ -12,19 +12,13 @@
#include "main_code.h"
#include "include/Engine.h"
extern "C" {
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_Init(JNIEnv * env, jobject obj, jint width, jint height);
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_StopSounds(JNIEnv * env, jobject obj);
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_Update(JNIEnv * env, jobject obj, long dt);
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_Destroy(JNIEnv * env, jobject obj);
JNIEXPORT int JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_IsInited(JNIEnv * env, jobject obj);
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnTapDown(JNIEnv * env, jobject obj, jfloat x, jfloat y, long time);
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnTapUp(JNIEnv * env, jobject obj, jfloat x, jfloat y, long time);
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnTapMove(JNIEnv * env, jobject obj, jfloat x, jfloat y, long time);
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnFling(JNIEnv * env, jobject obj, jfloat velocityX, jfloat velocityY, long time);
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnScroll(JNIEnv * env, jobject obj, jfloat distanceX, jfloat distanceY, long time);
JNIEXPORT void JNICALL Java_fishrungames_crystalofrhylil_JniWrapper_OnKeyPress(JNIEnv * env, jobject obj, jint keyCode);
using namespace SE;
extern "C"
{
JNIEXPORT void JNICALL Java_com_fishrungames_crystalofrhylil_JniWrapper_Init(JNIEnv * env, jobject obj, jint width, jint height);
};