void LogMsg( const char* traceStr, ... ) { va_list argsVA; int logSize = 4096; char buffer[logSize]; memset( (void*)buffer, 0, logSize ); va_start( argsVA, traceStr ); vsnprintf( buffer, logSize, traceStr, argsVA ); va_end( argsVA ); __android_log_write(ANDROID_LOG_INFO,GetAppName(), buffer); if (IsBaseAppInitted()) { BaseApp::GetBaseApp()->GetConsole()->AddLine(buffer); } }
int AppOSMessageGet(JNIEnv* env) { if (!IsBaseAppInitted()) { return 0; } /*while (!s_messageCache.empty()) { AndroidMessageCache *pM = &s_messageCache.front(); ConvertCoordinatesIfRequired(pM->x, pM->y); MessageManager::GetMessageManager()->SendGUIEx(pM->type, pM->x, pM->y, pM->finger); s_messageCache.pop_front(); }*/ while (!BaseApp::GetBaseApp()->GetOSMessages()->empty()) { //check for special messages that we don't want to pass on s_lastOSMessage = BaseApp::GetBaseApp()->GetOSMessages()->front(); if (s_lastOSMessage.m_type == OSMessage::MESSAGE_CHECK_CONNECTION) { //pretend we did it MessageManager::GetMessageManager()->SendGUI(MESSAGE_TYPE_OS_CONNECTION_CHECKED, (float)RT_kCFStreamEventOpenCompleted, 0.0f); BaseApp::GetBaseApp()->GetOSMessages()->pop_front(); continue; } break; } if (!BaseApp::GetBaseApp()->GetOSMessages()->empty()) { s_lastOSMessage = BaseApp::GetBaseApp()->GetOSMessages()->front(); BaseApp::GetBaseApp()->GetOSMessages()->pop_front(); return s_lastOSMessage.m_type; } return OSMessage::MESSAGE_NONE; }
Entity * GetEntityRoot() { assert(IsBaseAppInitted() && "Base app should be initted before calling this"); return GetBaseApp()->GetEntityRoot(); }
void BaseApp::AddOSMessage( OSMessage &m ) { assert(IsBaseAppInitted() && "Base app should be initted before calling AddOSMessage"); m_OSMessages.push_back(m); }