Use a full screen loading image which includes some text

This commit is contained in:
Simon Fels 2017-05-03 20:47:40 +02:00
commit f61a7f91d6
5 changed files with 7 additions and 8 deletions

View file

@ -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)

BIN
data/ui/loading-screen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -124,4 +124,5 @@ parts:
make test
prime:
- usr/bin/anbox
- usr/share/anbox
- usr/lib/*-linux-*/

View file

@ -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;

View file

@ -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);