| 21 | Uint32 loadingticks = 0; |
| 22 | |
| 23 | static void baseCreateLoadingScreen(real_t progress, const char* background_image) { |
| 24 | std::lock_guard<std::mutex> lock(loading_mutex); |
| 25 | |
| 26 | if (!background_image) { |
| 27 | // clears any existing player UI... |
| 28 | Frame::guiDestroy(); |
| 29 | Frame::guiInit(); |
| 30 | } |
| 31 | |
| 32 | const SDL_Rect fullscreen{0, 0, |
| 33 | Frame::virtualScreenX, Frame::virtualScreenY}; |
| 34 | |
| 35 | auto loading_frame = gui->addFrame("loading_frame"); |
| 36 | loading_frame->setSize(fullscreen); |
| 37 | loading_frame->setActualSize(fullscreen); |
| 38 | loading_frame->setBorder(0); |
| 39 | loading_frame->setColor(0); |
| 40 | |
| 41 | // background image |
| 42 | if (background_image) { |
| 43 | loading_frame->addImage( |
| 44 | fullscreen, |
| 45 | makeColor(255, 255, 255, 255), |
| 46 | background_image, |
| 47 | "backdrop" |
| 48 | ); |
| 49 | |
| 50 | // loading bar |
| 51 | auto loading_bar = loading_frame->addFrame("loading_bar"); |
| 52 | loading_bar->setSize(SDL_Rect{(Frame::virtualScreenX - 1168) / 2, Frame::virtualScreenY - (720 - 474), 1168, 228}); |
| 53 | { |
| 54 | // background |
| 55 | auto background = loading_bar->addImage( |
| 56 | SDL_Rect{0, 0, 1132, 190}, |
| 57 | 0xffffffff, |
| 58 | "images/ui/LoadingScreen/LoadingBar/UI_Loading_Bar_BodyUnder_00.png", |
| 59 | "background" |
| 60 | ); |
| 61 | |
| 62 | // gas |
| 63 | auto gas = loading_bar->addImage( |
| 64 | SDL_Rect{52, 114, 0, 36}, |
| 65 | 0xffffffff, |
| 66 | "images/ui/LoadingScreen/LoadingBar/Gas/000.png", |
| 67 | "gas" |
| 68 | ); |
| 69 | gas->tiled = true; |
| 70 | |
| 71 | // bubbles |
| 72 | auto bubbles = loading_bar->addImage( |
| 73 | SDL_Rect{52, 102, 0, 60}, |
| 74 | 0xffffffff, |
| 75 | "images/ui/LoadingScreen/LoadingBar/Bubbles/000.png", |
| 76 | "bubbles" |
| 77 | ); |
| 78 | bubbles->tiled = true; |
| 79 | |
| 80 | // foreground |
no test coverage detected