[DEBUG] correct the android port
This commit is contained in:
parent
46f30152c6
commit
5e65339d82
@ -202,7 +202,6 @@ class AndroidContext : public gale::Context {
|
||||
GALE_CRITICAL(" mission one function ==> system can not work withut it...");
|
||||
}
|
||||
}
|
||||
start2ntThreadProcessing();
|
||||
}
|
||||
|
||||
~AndroidContext() {
|
||||
@ -465,10 +464,30 @@ class AndroidContext : public gale::Context {
|
||||
}
|
||||
|
||||
void OS_Resize(const vec2& _size) {
|
||||
GALE_VERBOSE("OS_Resize [BEGIN]");
|
||||
GALE_INFO("OS_Resize [BEGIN]");
|
||||
m_currentHeight = _size.y();
|
||||
gale::Context::OS_Resize(_size);
|
||||
GALE_VERBOSE("OS_Resize [END]");
|
||||
GALE_INFO("OS_Resize [END]");
|
||||
}
|
||||
void ANDROID_start() {
|
||||
GALE_INFO("ANDROID_start [BEGIN]");
|
||||
|
||||
GALE_INFO("ANDROID_start [END]");
|
||||
}
|
||||
void ANDROID_reStart() {
|
||||
GALE_INFO("ANDROID_reStart [BEGIN]");
|
||||
|
||||
GALE_INFO("ANDROID_reStart [END]");
|
||||
}
|
||||
void ANDROID_create() {
|
||||
GALE_INFO("ANDROID_create [BEGIN]");
|
||||
start2ndThreadProcessing();
|
||||
GALE_INFO("ANDROID_create [END]");
|
||||
}
|
||||
void ANDROID_destroy() {
|
||||
GALE_INFO("ANDROID_destroy [BEGIN]");
|
||||
|
||||
GALE_INFO("ANDROID_destroy [END]");
|
||||
}
|
||||
};
|
||||
|
||||
@ -588,6 +607,7 @@ extern "C" {
|
||||
// TODO : generate error in java to stop the current instance
|
||||
return;
|
||||
}
|
||||
s_listInstance[_id]->ANDROID_create();
|
||||
//s_listInstance[_id]->init();
|
||||
}
|
||||
|
||||
@ -603,6 +623,7 @@ extern "C" {
|
||||
// TODO : generate error in java to stop the current instance
|
||||
return;
|
||||
}
|
||||
s_listInstance[_id]->ANDROID_start();
|
||||
//SendSystemMessage(" testmessages ... ");
|
||||
}
|
||||
void Java_org_gale_Gale_EWonReStart(JNIEnv* _env, jobject _thiz, jint _id) {
|
||||
@ -617,6 +638,7 @@ extern "C" {
|
||||
// TODO : generate error in java to stop the current instance
|
||||
return;
|
||||
}
|
||||
s_listInstance[_id]->ANDROID_reStart();
|
||||
}
|
||||
void Java_org_gale_Gale_EWonResume(JNIEnv* _env, jobject _thiz, jint _id) {
|
||||
std::unique_lock<std::mutex> lock(g_interfaceMutex);
|
||||
@ -674,6 +696,7 @@ extern "C" {
|
||||
// TODO : generate error in java to stop the current instance
|
||||
return;
|
||||
}
|
||||
s_listInstance[_id]->ANDROID_destroy();
|
||||
//s_listInstance[_id]->UnInit();
|
||||
}
|
||||
|
||||
|
@ -172,6 +172,7 @@ void gale::Context::processEvents() {
|
||||
}
|
||||
|
||||
void gale::Context::setArchiveDir(int _mode, const char* _str, const char* _applName) {
|
||||
GALE_INFO("Set archive DIR : " << _mode << " " << _str << " " << _applName << "[BEGIN]");
|
||||
switch(_mode) {
|
||||
case 0:
|
||||
GALE_DEBUG("Directory APK : path=" << _str);
|
||||
@ -192,6 +193,7 @@ void gale::Context::setArchiveDir(int _mode, const char* _str, const char* _appl
|
||||
GALE_DEBUG("Directory mode=???? path=" << _str);
|
||||
break;
|
||||
}
|
||||
GALE_INFO("Set archive DIR : " << _mode << " " << _str << " " << _applName << "[ END ]");
|
||||
}
|
||||
|
||||
namespace gale {
|
||||
@ -373,7 +375,7 @@ gale::Context::Context(gale::Application* _application, int32_t _argc, const cha
|
||||
GALE_INFO(" == > Gale system init (END)");
|
||||
}
|
||||
|
||||
void gale::Context::start2ntThreadProcessing() {
|
||||
void gale::Context::start2ndThreadProcessing() {
|
||||
// set the curent interface:
|
||||
lockContext();
|
||||
m_periodicThread->start();
|
||||
|
@ -57,7 +57,7 @@ namespace gale {
|
||||
* @brief StartProcessing (2nd thread).
|
||||
* @note to call when all the Context is started
|
||||
*/
|
||||
void start2ntThreadProcessing();
|
||||
void start2ndThreadProcessing();
|
||||
protected:
|
||||
/**
|
||||
* @brief set the curent interface.
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
MacOSInterface(gale::Application* _application, int32_t _argc, const char* _argv[]) :
|
||||
gale::Context(_application, _argc, _argv) {
|
||||
// nothing to do ...
|
||||
start2ntThreadProcessing();
|
||||
start2ndThreadProcessing();
|
||||
}
|
||||
|
||||
int32_t Run() {
|
||||
|
@ -38,7 +38,7 @@ class MacOSInterface : public gale::Context {
|
||||
MacOSInterface(gale::Application* _application, int _argc, const char* _argv[]) :
|
||||
gale::Context(_application, _argc, _argv) {
|
||||
mm_main(_argc, _argv);
|
||||
start2ntThreadProcessing();
|
||||
start2ndThreadProcessing();
|
||||
}
|
||||
|
||||
int32_t Run() {
|
||||
|
@ -96,7 +96,7 @@ class GLUTInterface : public gale::Context {
|
||||
GALE_INFO("monitor property : dpi=" << dpi << " px/inch");
|
||||
}
|
||||
m_run = true;
|
||||
start2ntThreadProcessing();
|
||||
start2ndThreadProcessing();
|
||||
}
|
||||
|
||||
~GLUTInterface() {
|
||||
|
@ -71,7 +71,7 @@ class WindowsContext : public gale::Context {
|
||||
m_inputIsPressed[iii] = false;
|
||||
}
|
||||
configure();
|
||||
start2ntThreadProcessing();
|
||||
start2ndThreadProcessing();
|
||||
}
|
||||
|
||||
~WindowsContext() {
|
||||
|
@ -220,7 +220,7 @@ class X11Interface : public gale::Context {
|
||||
XAtomGALE = XInternAtom(m_display, m_uniqueWindowsName.c_str(), 0);
|
||||
XAtomDeleteWindows = XInternAtom(m_display, "WM_DELETE_WINDOW", 0);
|
||||
m_run = true;
|
||||
start2ntThreadProcessing();
|
||||
start2ndThreadProcessing();
|
||||
}
|
||||
|
||||
~X11Interface() {
|
||||
|
@ -65,7 +65,7 @@ class SimulationInterface : public gale::Context {
|
||||
gale::Context(_application, _argc, _argv) {
|
||||
GALE_INFO("SIMU:INIT");
|
||||
m_run = true;
|
||||
start2ntThreadProcessing();
|
||||
start2ndThreadProcessing();
|
||||
}
|
||||
|
||||
~SimulationInterface() {
|
||||
|
@ -329,7 +329,7 @@ class WAYLANDInterface : public gale::Context {
|
||||
m_uniqueWindowsName = "GALE_" + etk::to_string(etk::tool::irand(0, 1999999999));
|
||||
m_run = true;
|
||||
GALE_WARNING("WAYLAND: INIT [STOP]");
|
||||
start2ntThreadProcessing();
|
||||
start2ndThreadProcessing();
|
||||
}
|
||||
|
||||
~WAYLANDInterface() {
|
||||
|
@ -283,8 +283,8 @@ def tool_generate_main_java_class(target, module, package_name):
|
||||
tmpFile.write( " \n")
|
||||
if module.get_pkg("ANDROID_APPL_TYPE")!="APPL":
|
||||
tmpFile.write( " public Engine onCreateEngine() {\n")
|
||||
tmpFile.write( " Engine tmpEngine = super.onCreateEngine();\n")
|
||||
tmpFile.write( " initApkPath(\"" + module.get_pkg("COMPAGNY_TYPE")+"\", \""+module.get_pkg("COMPAGNY_NAME2")+"\", \"" + application_name + "\", \"" + package_name + "\");\n")
|
||||
tmpFile.write( " Engine tmpEngine = super.onCreateEngine();\n")
|
||||
tmpFile.write( " return tmpEngine;\n")
|
||||
tmpFile.write( " }\n")
|
||||
|
||||
@ -297,12 +297,12 @@ def tool_generate_main_java_class(target, module, package_name):
|
||||
|
||||
if module.get_pkg("ANDROID_APPL_TYPE")!="APPL":
|
||||
tmpFile.write( " public void onCreate() {\n")
|
||||
tmpFile.write( " super.onCreate();\n")
|
||||
tmpFile.write( " initApkPath(\"" + module.get_pkg("COMPAGNY_TYPE")+"\", \""+module.get_pkg("COMPAGNY_NAME2")+"\", \"" + application_name + "\", \"" + package_name + "\");\n")
|
||||
tmpFile.write( " super.onCreate();\n")
|
||||
else:
|
||||
tmpFile.write( " public void onCreate(android.os.Bundle savedInstanceState) {\n")
|
||||
tmpFile.write( " super.onCreate(savedInstanceState);\n")
|
||||
tmpFile.write( " initApkPath(\"" + module.get_pkg("COMPAGNY_TYPE")+"\", \""+module.get_pkg("COMPAGNY_NAME2")+"\", \"" + application_name + "\", \"" + package_name + "\");\n")
|
||||
tmpFile.write( " super.onCreate(savedInstanceState);\n")
|
||||
|
||||
if module.get_pkg("GENERATE_SECTION__ON_CREATE") != None:
|
||||
for elem in module.get_pkg("GENERATE_SECTION__ON_CREATE"):
|
||||
|
Loading…
x
Reference in New Issue
Block a user