* @brief Initialize resources for the splash window */
| 494 | * @brief Initialize resources for the splash window |
| 495 | */ |
| 496 | void WindowSplash::loadAssets() { |
| 497 | |
| 498 | // Load splash screen image from romfs |
| 499 | const auto backingScale = ImHexApi::System::getNativeScale(); |
| 500 | m_splashBackgroundTexture = ImGuiExt::Texture::fromSVG(romfs::get("splash_background.svg").span(), WindowSize.x * backingScale, WindowSize.y * backingScale, ImGuiExt::Texture::Filter::Linear); |
| 501 | |
| 502 | // If the image couldn't be loaded correctly, something went wrong during the build process |
| 503 | // Close the application since this would lead to errors later on anyway. |
| 504 | if (!m_splashBackgroundTexture.isValid()) { |
| 505 | log::error("Could not load splash screen image!"); |
| 506 | } |
| 507 | } |
| 508 | |
| 509 | void WindowSplash::addStartupTask(const std::string &taskName, const TaskFunction &function, bool async) { |
| 510 | std::scoped_lock lock(m_tasksMutex); |
no test coverage detected