Skip to content

Commit

Permalink
Added a splash screen
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Mar 16, 2019
1 parent ae19077 commit 0219d7d
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/edizon_logo.bin

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions include/guis/gui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class Gui {
static inline u32 g_framebuffer_width = 1280;
static inline u32 g_framebuffer_height = 720;

static inline bool g_splashDisplayed = false;

static inline Snackbar *g_currSnackbar = nullptr;
static inline ListSelector *g_currListSelector = nullptr;
static inline MessageBox *g_currMessageBox = nullptr;
Expand Down
13 changes: 13 additions & 0 deletions source/guis/gui_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "account.hpp"

#include "beta_bin.h"
#include "edizon_logo_bin.h"

#include "threads.hpp"

Expand Down Expand Up @@ -51,9 +52,21 @@ void GuiMain::draw() {
s64 x = 0, y = 10, currItem = 0;
s64 selectedX = 0, selectedY = 0;
bool tmpEditableOnly = m_editableOnly;
static u32 splashCnt = 0;

Gui::beginDraw();

if (!Gui::g_splashDisplayed) {
Gui::drawRectangle(0, 0, Gui::g_framebuffer_width, Gui::g_framebuffer_height, Gui::makeColor(0x5D, 0x4F, 0x4E, 0xFF));
Gui::drawImage(Gui::g_framebuffer_width / 2 - 128, Gui::g_framebuffer_height / 2 - 128, 256, 256, edizon_logo_bin, IMAGE_MODE_BGR24);

if (splashCnt++ >= 70)
Gui::g_splashDisplayed = true;

Gui::endDraw();
return;
}

finishedDrawing = false;

Gui::drawRectangle(0, 0, Gui::g_framebuffer_width, Gui::g_framebuffer_height, currTheme.backgroundColor);
Expand Down
15 changes: 15 additions & 0 deletions source/guis/gui_ram_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ extern "C" {
#include "util.h"
}

#include "edizon_logo_bin.h"


static const std::vector<std::string> dataTypes = { "u8", "s8", "u16", "s16", "u32", "s32", "u64", "s64", "f32", "f64", "ptr", "str" };
static const std::vector<u8> dataTypeSizes = { 1, 1, 2, 2, 4, 4, 8, 8, 4, 8, 8, 0 };
static const std::vector<s128> dataTypeMaxValues = { std::numeric_limits<u8>::max(), std::numeric_limits<s8>::max(), std::numeric_limits<u16>::max(), std::numeric_limits<s16>::max(), std::numeric_limits<u32>::max(), std::numeric_limits<s32>::max(), std::numeric_limits<u64>::max(), std::numeric_limits<s64>::max(), std::numeric_limits<s32>::max(), std::numeric_limits<s64>::max(), std::numeric_limits<u64>::max() };
Expand Down Expand Up @@ -191,10 +194,22 @@ void GuiRAMEditor::update() {
}

void GuiRAMEditor::draw() {
static u32 splashCnt = 0;
std::stringstream ss;

Gui::beginDraw();

if (!Gui::g_splashDisplayed) {
Gui::drawRectangle(0, 0, Gui::g_framebuffer_width, Gui::g_framebuffer_height, Gui::makeColor(0x5D, 0x4F, 0x4E, 0xFF));
Gui::drawImage(Gui::g_framebuffer_width / 2 - 128, Gui::g_framebuffer_height / 2 - 128, 256, 256, edizon_logo_bin, IMAGE_MODE_BGR24);

if (splashCnt++ >= 70)
Gui::g_splashDisplayed = true;

Gui::endDraw();
return;
}

Gui::drawRectangle(0, 0, Gui::g_framebuffer_width, Gui::g_framebuffer_height, currTheme.backgroundColor);

Gui::drawRectangle((u32)((Gui::g_framebuffer_width - 1220) / 2), Gui::g_framebuffer_height - 73, 1220, 1, currTheme.textColor);
Expand Down

0 comments on commit 0219d7d

Please sign in to comment.