Add debug logging for iOS device

This commit is contained in:
Benau 2020-01-20 14:58:03 +08:00
parent b3e76e082e
commit 50944bb8c3
3 changed files with 15 additions and 0 deletions

View File

@ -138,6 +138,7 @@ namespace irr
{
return m_right_padding * m_native_scale;
}
static void debugPrint(const char* line);
private:
void createWindow();
void createViewAndDriver();

View File

@ -957,6 +957,14 @@ namespace irr
NSURL* nsurl_val = [NSURL URLWithString:url_nsstring];
[application openURL:nsurl_val];
}
void CIrrDeviceiOS::debugPrint(const char* line)
{
#ifdef ENABLE_IOS_DEBUG_PRINT
NSString* ns = [NSString stringWithCString:line
encoding:[NSString defaultCStringEncoding]];
NSLog(@"%@", ns);
#endif
}
}
#ifdef _IRR_COMPILE_WITH_IOS_BUILTIN_MAIN_

View File

@ -30,6 +30,10 @@
# include <android/log.h>
#endif
#ifdef IOS_STK
#include "../../../lib/irrlicht/source/Irrlicht/CIrrDeviceiOS.h"
#endif
#ifdef WIN32
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
@ -243,6 +247,8 @@ void Log::writeLine(const char *line, int level)
default: alp = ANDROID_LOG_FATAL;
}
__android_log_print(alp, "SuperTuxKart", "%s", line);
#elif defined(IOS_STK)
CIrrDeviceiOS::debugPrint(line);
#else
printf("%s", line);
#endif