Use minetest logging facilities for irrlicht log output

master
ShadowNinja 2015-07-05 00:53:38 +02:00 committed by est31
parent d786a272c0
commit a93838707a
1 changed files with 12 additions and 4 deletions

View File

@ -85,10 +85,18 @@ public:
mouse_wheel += event.MouseInput.Wheel; mouse_wheel += event.MouseInput.Wheel;
} }
} }
} } else if (event.EventType == irr::EET_LOG_TEXT_EVENT) {
if (event.EventType == irr::EET_LOG_TEXT_EVENT) { static const enum LogMessageLevel irr_loglev_conv[] = {
dstream << std::string("Irrlicht log: ") + std::string(event.LogEvent.Text) LMT_VERBOSE, // ELL_DEBUG
<< std::endl; LMT_INFO, // ELL_INFORMATION
LMT_ACTION, // ELL_WARNING
LMT_ERROR, // ELL_ERROR
LMT_ERROR, // ELL_NONE
};
assert(event.LogEvent.Level < sizeof(irr_loglev_conv));
log_printline(irr_loglev_conv[event.LogEvent.Level],
std::string("Irrlicht: ")
+ (const char*) event.LogEvent.Text);
return true; return true;
} }
/* always return false in order to continue processing events */ /* always return false in order to continue processing events */