| 2876 | } |
| 2877 | |
| 2878 | void SceneGraph::DumpState() { |
| 2879 | std::ofstream output; |
| 2880 | char dump_path[kPathSize]; |
| 2881 | GetScenGraphDumpPath(dump_path, kPathSize); |
| 2882 | |
| 2883 | my_ofstream_open(output, dump_path); |
| 2884 | |
| 2885 | if (output.is_open()) { |
| 2886 | LOGI << "Dumping all objects in scenegraph into " << dump_path << std::endl; |
| 2887 | for (auto& object : objects_) { |
| 2888 | if (output.good()) { |
| 2889 | output << "[" << object->GetID() << "]: \"" << CStringFromEntityType(object->GetType()) << "\" " << object->GetName() << std::endl; |
| 2890 | } |
| 2891 | } |
| 2892 | } else { |
| 2893 | LOGE << "Failed at opening " << dump_path << " for dumping. " << std::endl; |
| 2894 | } |
| 2895 | } |
| 2896 | |
| 2897 | void SceneGraph::GetParticleShaderNames(std::map<std::string, int>& preload_shaders) { |
| 2898 | Path p = FindFilePath("Data/shader_preload.xml", kDataPaths, true); |
no test coverage detected