Added support for Android Studio

This commit is contained in:
vladislav.khorev committed 2017-01-10 07:10:36 +03:00
1 parent e4a7822385
commit 99a6b3728d
45 files changed
+1834 -548

No files matched your search

+15 -11
View File
@@ -1,10 +1,12 @@
#ifndef SCRIPT_MANAGER_H_INCLUDED
#define SCRIPT_MANAGER_H_INCLUDED
#include "sqplus.h"
//#include "sqplus.h"
#include <iostream>
#include <string>
typedef char SQChar;
namespace SE
{
@@ -30,6 +32,7 @@ struct TScriptInfo
};
class TFunctionBinderInterface
{
public:
@@ -47,9 +50,9 @@ public:
class TScriptManager : public TSerializeInterface
{
protected:
HSQUIRRELVM virtualMachine;
std::map<std::string, TScriptInfo> FuncInfoMap;
//HSQUIRRELVM virtualMachine;
//std::map<std::string, TScriptInfo> FuncInfoMap;
/*
template<typename T1,typename T2>
void RegisterFunc(T1& object, T2 method, const std::string& funcName)
{
@@ -60,7 +63,7 @@ protected:
void RegisterFunc(T globalFunc, const std::string& funcName)
{
SqPlus::RegisterGlobal(virtualMachine, globalFunc, _SC(funcName.c_str()));
}
}*/
public:
TScriptManager();
@@ -75,20 +78,21 @@ public:
template<typename T1, typename T2>
void AddFunction(const std::string& shortName, TScriptInfo scriptInfo, T1& object, T2 method)
{
/*
AddFuncDescription(shortName, scriptInfo);
RegisterFunc(object, method, shortName);
RegisterFunc(object, method, scriptInfo.LongName);
FuncInfoMap[shortName].Registered = true;
FuncInfoMap[shortName].Registered = true;*/
}
template<typename T>
void AddFunction(const std::string& shortName, TScriptInfo scriptInfo, T globalFunc)
{
AddFuncDescription(shortName, scriptInfo);
/*AddFuncDescription(shortName, scriptInfo);
RegisterFunc(globalFunc, shortName);
RegisterFunc(globalFunc, scriptInfo.LongName);
FuncInfoMap[shortName].Registered = true;
FuncInfoMap[shortName].Registered = true;*/
}
void BindFunctionsFromObject(TFunctionBinderInterface* binderObject);
@@ -103,9 +107,9 @@ public:
void SQ_Print(const SQChar *inString);
void SQ_PrintWidgetList();
void SQ_MoveWidget(const SQChar *widgetName, float x, float y);
//void SQ_Print(const SQChar *inString);
//void SQ_PrintWidgetList();
//void SQ_MoveWidget(const SQChar *widgetName, float x, float y);
//void SQ_PrintTextureList();
//void SQ_PrintAnimationList();
+2 -2
View File
@@ -5,8 +5,8 @@
#ifdef TARGET_ANDROID
#include <asm/page.h>
#include <limits.h>
//#include <asm/page.h>
//#include <limits.h>
#endif
#include "boost/thread.hpp"
Regular → Executable
+2 -2
View File
@@ -20,8 +20,8 @@ Use global variable Console like that:
#include <fstream>
#endif
#ifdef TARGET_ANDROID
#include <asm/page.h>
#include <limits.h>
//#include <asm/page.h>
//#include <limits.h>
#include "boost/thread.hpp"
#endif
Regular → Executable
+13 -11
View File
@@ -12,6 +12,18 @@
#include <zlib.h>
#include <zconf.h>
extern "C" {
JNIEXPORT void JNICALL Java_fishrungames_salmonengineandroid_EngineWrapper_SetupEnviroment(JNIEnv* env, jobject thiz);
JNIEXPORT void JNICALL Java_fishrungames_salmonengineandroid_EngineWrapper_SetupApkFilePath(JNIEnv* env, jobject thiz, jstring s);
JNIEXPORT void JNICALL Java_fishrungames_salmonengineandroid_EngineWrapper_ConsoleOut(JNIEnv* env, jobject thiz, jstring s);
//All 2 deprecated
JNIEXPORT void JNICALL Java_fishrungames_salmonengineandroid_EngineWrapper_CreateFile(JNIEnv* env, jobject thiz, int fileSize);
JNIEXPORT void JNICALL Java_fishrungames_salmonengineandroid_EngineWrapper_WriteToFile(JNIEnv* env, jobject thiz, jbyteArray buffer, int bufferSize);
};
namespace SE
{
@@ -35,17 +47,7 @@ extern cardinal* FileArr;
extern int FileSize;
extern std::string ApkFilePath;
extern "C" {
JNIEXPORT void JNICALL Java_fishrungames_engine_EngineWrapper_SetupEnviroment(JNIEnv* env, jobject thiz);
JNIEXPORT void JNICALL Java_fishrungames_engine_EngineWrapper_SetupApkFilePath(JNIEnv* env, jobject thiz, jstring s);
JNIEXPORT void JNICALL Java_fishrungames_engine_EngineWrapper_ConsoleOut(JNIEnv* env, jobject thiz, jstring s);
//All 2 deprecated
JNIEXPORT void JNICALL Java_fishrungames_engine_EngineWrapper_CreateFile(JNIEnv* env, jobject thiz, int fileSize);
JNIEXPORT void JNICALL Java_fishrungames_engine_EngineWrapper_WriteToFile(JNIEnv* env, jobject thiz, jbyteArray buffer, int bufferSize);
};
//Deprecated
void JniCallOpenFile(const std::string& fileName);