Merge remote-tracking branch 'origin/master' into nw

This commit is contained in:
hiker 2016-12-08 13:36:36 +11:00
commit dbfaf2105b
2 changed files with 30 additions and 14 deletions

View File

@ -341,11 +341,25 @@ namespace video
delete BridgeCalls;
#if defined(EGL_VERSION_1_0)
// HACK : the following is commented because destroying the context crashes under Linux (Thibault 04-feb-10)
/*eglMakeCurrent(EGL_NO_DISPLAY, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglDestroyContext(EglDisplay, EglContext);
eglDestroySurface(EglDisplay, EglSurface);*/
eglTerminate(EglDisplay);
eglMakeCurrent(EglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (EglContext != EGL_NO_CONTEXT)
{
eglDestroyContext(EglDisplay, EglContext);
EglContext = EGL_NO_CONTEXT;
}
if (EglSurface != EGL_NO_SURFACE)
{
eglDestroySurface(EglDisplay, EglSurface);
EglSurface = EGL_NO_SURFACE;
}
if (EglDisplay != EGL_NO_DISPLAY)
{
eglTerminate(EglDisplay);
EglDisplay = EGL_NO_DISPLAY;
}
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
if (HDc)

View File

@ -140,11 +140,11 @@ void Log::printMessage(int level, const char *component, const char *format,
android_LogPriority alp;
switch (level)
{
// STK is using the levels slightly different from android
// (debug lowest, verbose above it; while android reverses
// this order. So to get the same behaviour (e.g. filter
// out debug message, but still get verbose, we swap
// the order here.
// STK is using the levels slightly different from android
// (debug lowest, verbose above it; while android reverses
// this order. So to get the same behaviour (e.g. filter
// out debug message, but still get verbose, we swap
// the order here.
case LL_VERBOSE: alp = ANDROID_LOG_DEBUG; break;
case LL_DEBUG: alp = ANDROID_LOG_VERBOSE; break;
case LL_INFO: alp = ANDROID_LOG_INFO; break;
@ -153,8 +153,8 @@ void Log::printMessage(int level, const char *component, const char *format,
case LL_FATAL: alp = ANDROID_LOG_FATAL; break;
default: alp = ANDROID_LOG_FATAL;
}
__android_log_vprint(alp, "SuperTuxKart", format, args);
#else
#endif
static const char *names[] = {"debug", "verbose ", "info ",
"warn ", "error ", "fatal "};
@ -178,8 +178,12 @@ void Log::printMessage(int level, const char *component, const char *format,
va_copy(out, args);
setTerminalColor((LogLevel)level);
#ifdef ANDROID
__android_log_vprint(alp, "SuperTuxKart", format, out);
#else
printf("[%s] %s: ", names[level], component);
vprintf(format, out);
#endif
resetTerminalColor(); // this prints a \n
va_end(out);
@ -225,8 +229,6 @@ void Log::printMessage(int level, const char *component, const char *format,
MessageBoxA(NULL, message.c_str(), "SuperTuxKart - Fatal error", MB_OK);
}
#endif
#endif
} // printMessage