MainLoop,Android: Log an appropriate message if scene setup isn't successful.
diff --git a/src/android.cpp b/src/android.cpp
index 7ec6565..d9678f4 100644
--- a/src/android.cpp
+++ b/src/android.cpp
@@ -49,10 +49,20 @@
virtual void log_scene_result()
{
- Log::info("%s FPS: %u FrameTime: %.3f ms\n",
- scene_->info_string().c_str(),
- scene_->average_fps(),
- 1000.0 / scene_->average_fps());
+ if (scene_setup_status_ == SceneSetupStatusSuccess) {
+ Log::info("%s FPS: %u FrameTime: %.3f ms\n",
+ scene_->info_string().c_str(),
+ scene_->average_fps(),
+ 1000.0 / scene_->average_fps());
+ }
+ else if (scene_setup_status_ == SceneSetupStatusUnsupported) {
+ Log::info("%s Unsupported\n",
+ scene_->info_string().c_str());
+ }
+ else {
+ Log::info("%s Set up failed\n",
+ scene_->info_string().c_str());
+ }
}
};
@@ -66,8 +76,20 @@
virtual void log_scene_result()
{
- Log::info("%s FPS: %u", scene_->info_string().c_str(),
- scene_->average_fps());
+ if (scene_setup_status_ == SceneSetupStatusSuccess) {
+ Log::info("%s FPS: %u FrameTime: %.3f ms\n",
+ scene_->info_string().c_str(),
+ scene_->average_fps(),
+ 1000.0 / scene_->average_fps());
+ }
+ else if (scene_setup_status_ == SceneSetupStatusUnsupported) {
+ Log::info("%s Unsupported\n",
+ scene_->info_string().c_str());
+ }
+ else {
+ Log::info("%s Set up failed\n",
+ scene_->info_string().c_str());
+ }
}
};
diff --git a/src/main-loop.cpp b/src/main-loop.cpp
index 169c936..2bbd824 100644
--- a/src/main-loop.cpp
+++ b/src/main-loop.cpp
@@ -146,11 +146,23 @@
void
MainLoop::log_scene_result()
{
- static const std::string format_fps(Log::continuation_prefix + " FPS: %u");
- static const std::string format_ms(Log::continuation_prefix + " FrameTime: %.3f ms\n");
+ static const std::string format_fps(Log::continuation_prefix +
+ " FPS: %u FrameTime: %.3f ms\n");
+ static const std::string format_unsupported(Log::continuation_prefix +
+ " Unsupported\n");
+ static const std::string format_fail(Log::continuation_prefix +
+ " Set up failed\n");
- Log::info(format_fps.c_str(), scene_->average_fps());
- Log::info(format_ms.c_str(), 1000.0 / scene_->average_fps());
+ if (scene_setup_status_ == SceneSetupStatusSuccess) {
+ Log::info(format_fps.c_str(), scene_->average_fps(),
+ 1000.0 / scene_->average_fps());
+ }
+ else if (scene_setup_status_ == SceneSetupStatusUnsupported) {
+ Log::info(format_unsupported.c_str());
+ }
+ else {
+ Log::info(format_fail.c_str());
+ }
}
void