提交 f61a7f91 编写于 作者: S Simon Fels

Use a full screen loading image which includes some text

上级 817f80d6
......@@ -105,5 +105,5 @@ if (NOT "${HOST_CMAKE_C_COMPILER}" STREQUAL "")
message(STATUS "Host C compiler: ${HOST_CMAKE_CXX_COMPILER}")
endif()
install(FILES snap/gui/icon.png DESTINATION share/anbox/ui)
install(FILES data/ui/loading-screen.png DESTINATION share/anbox/ui)
......@@ -124,4 +124,5 @@ parts:
make test
prime:
- usr/bin/anbox
- usr/share/anbox
- usr/lib/*-linux-*/
......@@ -88,8 +88,8 @@ anbox::cmds::Launch::Launch()
const auto snap_path = utils::get_env_value("SNAP");
if (!snap_path.empty()) {
const auto resource_path = utils::string_format("%s/share/anbox", snap_path);
SystemConfiguration::instance().set_resource_path(resource_path)
const auto resource_path = utils::string_format("%s/usr/share/anbox", snap_path);
SystemConfiguration::instance().set_resource_path(resource_path);
}
std::shared_ptr<ui::SplashScreen> ss;
......
......@@ -48,18 +48,16 @@ SplashScreen::SplashScreen() {
if (!renderer)
BOOST_THROW_EXCEPTION(std::runtime_error("Could not create renderer"));
const auto icon_path = utils::string_format("%s/ui/icon.png", SystemConfiguration::instance().resource_dir());
const auto icon_path = utils::string_format("%s/ui/loading-screen.png", SystemConfiguration::instance().resource_dir());
auto img = IMG_LoadTexture(renderer, icon_path.c_str());
if (!img) {
const auto msg = utils::string_format("Failed to create texture from %s", icon_path);
BOOST_THROW_EXCEPTION(std::runtime_error(msg));
}
const auto tex_width = 128, tex_height = 128;
SDL_Rect r{(width - tex_width) / 2, (height - tex_height) / 2, 128, 128};
SDL_SetRenderDrawColor(renderer, 0xee, 0xee, 0xee, 0xff);
SDL_RenderClear(renderer);
SDL_Rect r{0, 0, 1024, 768};
SDL_RenderCopy(renderer, img, nullptr, &r);
SDL_RenderPresent(renderer);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册