From 731248ab7594bbd19a8634d848434c08b1cd2f8c Mon Sep 17 00:00:00 2001 From: XargonWan Date: Tue, 15 Mar 2022 03:08:01 +0100 Subject: [PATCH] Added loading logo. --- install-retrodeck.sh | 13 ++++++++---- patches/Splash.h | 48 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 patches/Splash.h diff --git a/install-retrodeck.sh b/install-retrodeck.sh index 9982b7a6..d1faddbb 100755 --- a/install-retrodeck.sh +++ b/install-retrodeck.sh @@ -174,6 +174,10 @@ mv $INSTALL_DIR/emulators/RetroArch-Linux-x86_64/RetroArch-Linux-x86_64.AppImage # Installing 351elec-emulationstation cd $INSTALL_DIR git clone --recursive https://github.com/351ELEC/351elec-emulationstation emulationstation +# TODO: one day I will have to fork this emustation... +# applying patches +cp $INSTALL_DIR/patches/Splash.h $INSTALL_DIR/emulationstation/es-core/src/Splash.h +# pathes applied cd emulationstation sudo pacman -S base-devel cmake freeimage sdl2_mixer sdl2 rapidjson boost cmake -DENABLE_EMUELEC=1 -DGLES2=0 -DDISABLE_KODI=1 -DENABLE_FILEMANAGER=0 -DCEC=0 -DRG552=1 @@ -235,12 +239,13 @@ chmod 777 $INSTALL_DIR/retrodeck.sh chmod 777 $INSTALL_DIR/export_func.sh # Cleaning up -# TODO: these removal must be made when I am sure tghis file is safe on github +# TODO: these removal must be made when I am sure this files are safe on github #rm -rf $INSTALL_DIR/emulators/RetroArch-Linux-x86_64 #rm -rf $INSTALL_DIR/emulators/RetroArch_cores.7z -#rm $INSTALL_DIR/es_systems.cfg $INSTALL_DIR/emulationstation/ -#rm $INSTALL_DIR/es_settings.cfg $INSTALL_DIR/emulationstation/ -#rm $INSTALL_DIR/es_input.cfg $INSTALL_DIR/emulationstation/ +#rm $INSTALL_DIR/es_systems.cfg +#rm $INSTALL_DIR/es_settings.cfg +#rm $INSTALL_DIR/es_input.cfg +#rm -rf $INSTALL_DIR/patches echo "Installation terminated, you can run RetroDECK from the desktop link or add it on your Steam Library." # TODO: maybe I can add it to the steam library directly, I think I have to close steam and design a banner diff --git a/patches/Splash.h b/patches/Splash.h new file mode 100644 index 00000000..801d9084 --- /dev/null +++ b/patches/Splash.h @@ -0,0 +1,48 @@ +#pragma once + +#include +#include "components/ImageComponent.h" +#include "components/TextComponent.h" + +// Getting the user's home dir +#include +#include +#include + +class Window; +class TextureResource; + +// TODO: this is hardcoded path is shit, needs to be fixed + +#if WIN32 +#define DEFAULT_SPLASH_IMAGE ":/splash.svg" +#define OLD_SPLASH_LAYOUT true +#else +#define DEFAULT_SPLASH_IMAGE "/home/deck/retrodeck/res/logo.png" +#define OLD_SPLASH_LAYOUT false +#endif + +class Splash +{ +public: + Splash(Window* window, const std::string image = DEFAULT_SPLASH_IMAGE, bool fullScreenBackGround = true); + ~Splash(); + + void update(std::string text, float percent = -1); + void render(float opacity, bool swapBuffers = true); + +private: + ImageComponent mBackground; + TextComponent mText; + float mPercent; + + ImageComponent mInactiveProgressbar; + ImageComponent mActiveProgressbar; + + unsigned int mBackgroundColor; + float mRoundCorners; + + std::shared_ptr mTexture; + + std::vector mExtras; +} ; \ No newline at end of file