Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use minetest logging facilities for irrlicht log output
- Loading branch information
1 parent
d786a27
commit a938387
Showing
1 changed file
with
12 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,10 +85,18 @@ class MyEventReceiver : public IEventReceiver | |
mouse_wheel += event.MouseInput.Wheel; | ||
} | ||
} | ||
} | ||
if (event.EventType == irr::EET_LOG_TEXT_EVENT) { | ||
dstream << std::string("Irrlicht log: ") + std::string(event.LogEvent.Text) | ||
<< std::endl; | ||
} else if (event.EventType == irr::EET_LOG_TEXT_EVENT) { | ||
static const enum LogMessageLevel irr_loglev_conv[] = { | ||
LMT_VERBOSE, // ELL_DEBUG | ||
LMT_INFO, // ELL_INFORMATION | ||
LMT_ACTION, // ELL_WARNING | ||
LMT_ERROR, // ELL_ERROR | ||
LMT_ERROR, // ELL_NONE | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
est31
Contributor
|
||
}; | ||
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; | ||
} | ||
/* always return false in order to continue processing events */ | ||
|
Copy-paste typo?