Skip to content

Commit

Permalink
gui: Render splashscreen natively using pic0 and bump version for rel…
Browse files Browse the repository at this point in the history
…ease
  • Loading branch information
joel16 committed Jun 5, 2021
1 parent 70f965a commit f311deb
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 38 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ include("${VITASDK}/share/vita.cmake" REQUIRED)

set(VITA_APP_NAME "VITA Homebrew Sorter")
set(VITA_TITLEID "VITAHBSRT")
set(VITA_VERSION "01.22")
set(VITA_VERSION "01.23")

add_definitions(-DAPP_VERSION="${VITA_VERSION}")

Expand Down Expand Up @@ -85,11 +85,11 @@ vita_create_vpk(${PROJECT_NAME}.vpk ${VITA_TITLEID} ${PROJECT_NAME}.self
VERSION ${VITA_VERSION}
NAME ${VITA_APP_NAME}
FILE sce_sys/icon0.png sce_sys/icon0.png
FILE sce_sys/pic0.png sce_sys/pic0.png
FILE sce_sys/livearea/contents/bg.png sce_sys/livearea/contents/bg.png
FILE sce_sys/livearea/contents/startup.png sce_sys/livearea/contents/startup.png
FILE sce_sys/livearea/contents/template.xml sce_sys/livearea/contents/template.xml
FILE res/app.png res/app.png
FILE res/db.png res/db.png
FILE res/folder.png res/folder.png
FILE res/splashscreen.png res/splashscreen.png
)
1 change: 0 additions & 1 deletion include/textures.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ typedef struct {
int height = 0;
} Tex;

extern Tex splash;
extern std::vector<Tex> icons;

namespace Textures {
Expand Down
Binary file removed res/splashscreen.png
Binary file not shown.
2 changes: 1 addition & 1 deletion sce_sys/livearea/contents/template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<frame id="frame4">
<liveitem>
<text align="left" text-align="left" word-wrap="off" ellipsis="on">
<str size="18" color="#ffffff" shadow="on">v1.21</str>
<str size="18" color="#ffffff" shadow="on">v1.23</str>
</text>
</liveitem>
</frame>
Expand Down
Binary file added sce_sys/pic0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 0 additions & 27 deletions source/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,33 +77,6 @@ namespace GUI {
}
}

void RenderSplash(void) {
bool done = false;
SceRtcTick start, now;

sceRtcGetCurrentTick(&start);

while(!done) {
sceRtcGetCurrentTick(&now);

ImGui_ImplVitaGL_NewFrame();
GUI::SetupWindow();
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));

if (ImGui::Begin("splash", nullptr, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar)) {
ImGui::SetCursorPos((ImGui::GetContentRegionAvail() - ImVec2((splash.width), (splash.height))) * 0.5f);
ImGui::Image(reinterpret_cast<ImTextureID>(splash.id), ImVec2(splash.width, splash.height));
}

GUI::ExitWindow();
ImGui::PopStyleVar();
Renderer::End(true, ImVec4(0.05f, 0.07f, 0.13f, 1.00f));

if ((now.tick - start.tick) >= 6000000)
done = true;
}
}

static void Prompt(State *state, std::vector<AppInfoIcon> &entries, const char *name) {
if (*state == StateNone)
return;
Expand Down
1 change: 0 additions & 1 deletion source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ namespace Services {
int main(int argc, char *argv[]) {
Services::Init();
Services::SetDefaultTheme();
GUI::RenderSplash();
GUI::RenderLoop();
Services::Exit();
return 0;
Expand Down
7 changes: 1 addition & 6 deletions source/textures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "log.h"
#include "textures.h"

Tex splash;
std::vector<Tex> icons;

namespace Textures {
Expand Down Expand Up @@ -76,15 +75,11 @@ namespace Textures {

ret = Textures::LoadImagePNG("app0:res/folder.png", &icons[2]);
IM_ASSERT(ret);

ret = Textures::LoadImagePNG("app0:res/splashscreen.png", &splash);
IM_ASSERT(ret);


return 0;
}

void Exit(void) {
glDeleteTextures(1, &splash.id);
glDeleteTextures(1, &icons[2].id);
glDeleteTextures(1, &icons[1].id);
glDeleteTextures(1, &icons[0].id);
Expand Down

0 comments on commit f311deb

Please sign in to comment.