| 214 | } |
| 215 | |
| 216 | bool Director::init() { |
| 217 | _profilerInfo.init(); |
| 218 | SharedView.reset(); |
| 219 | if (!SharedImGui.init()) { |
| 220 | Error("failed to initialize ImGui."); |
| 221 | return false; |
| 222 | } |
| 223 | if (!SharedKeyboard.init()) { |
| 224 | Error("failed to initialize Keyboard."); |
| 225 | return false; |
| 226 | } |
| 227 | if (!SharedAudio.init()) { |
| 228 | Warn("audio function is not available."); |
| 229 | } |
| 230 | #ifndef DORA_NO_RUST |
| 231 | if (!dora_rust_init()) { |
| 232 | Error("failed to initialize Rust runtime."); |
| 233 | return false; |
| 234 | } |
| 235 | #endif // DORA_NO_RUST |
| 236 | if (!SharedContent.visitDir(SharedContent.getAssetPath(), [](String file, String path) { |
| 237 | switch (Switch::hash(file.toLower())) { |
| 238 | case "init.yue"_hash: |
| 239 | case "init.tl"_hash: |
| 240 | case "init.lua"_hash: |
| 241 | case "init.wasm"_hash: |
| 242 | SharedLuaEngine.executeModule(Path::concat({path, Path::getName(file.toString())})); |
| 243 | return true; |
| 244 | } |
| 245 | return false; |
| 246 | })) { |
| 247 | Info("Dora SSR started without script entry."); |
| 248 | } |
| 249 | return true; |
| 250 | } |
| 251 | |
| 252 | void Director::handleTouchEvents() { |
| 253 | /* handle ImGui touch */ |
nothing calls this directly
no test coverage detected