Skip to content

Commit 356b65c

Browse files
robsdedudedevnoname120
authored andcommitted
Auto update (#61)
* WIP: auto update * Using sce mutex insted of std mutex * Make network thread safe * Fix re-entrant mutex usage in activity * Reworked font - Added methods to draw fonts and clip to rectangle. - vita2d draws fonts relative to their baseline => added methods to compensate * Improved mutex logging * Update check + dialog * Version creation tool fixed to use little endian * Fix broken log function name format Didn't handle functions correctly that returned std::* * Fixed nan progress when downloading things * Adding updater app * Rename src/updater.* -> src/update.* * DialogView: refactor macros to cpp + focus on up/down * Lock PS and power buttons in updater app * Update thread opens dialog on error (instead of crashing) * Rename update thread Updater->Update * Fix "have to close vhbb" popup when staring updater app * Show plain background while updating * Minor improvments in CMakeList * adding compiled release files * Fix version comparison only woriking on big endian * Remove debug logging * Start working threads (icon fetch etc) after update check is done * Refactor std::string in macros to c-style strings * Use shared_ptr for DialogViewResult + code style * Only link debugnet in updater if enabled * Add missing newlines * Using YAML to store latest version + download url * Make updater log to file * Copy updater from resources instead of embedding it * Improve misc code style * Add fixme about merging the duplicate debug log sources together * updater: fix style issues * Remove unused Font::Draw() * Rename Font::DrawFromBaseline to Font::Draw * Update version YAML URL
1 parent e88ee5a commit 356b65c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2067
-464
lines changed

CMakeLists.txt

Lines changed: 225 additions & 177 deletions
Large diffs are not rendered by default.

assets/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/updater/

assets/spr/img_dialog_msg_bg.png

1.28 MB
Loading

assets/spr/img_dialog_msg_btn.png

70.5 KB
Loading
70.5 KB
Loading
70.5 KB
Loading

assets/spr/img_updater_icon.png

2.7 KB
Loading

release/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!*

release/version.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version: "00.83"
2+
url: "https://github.com/devnoname120/vhbb/releases/download/0.83/VitaHBBrowser.vpk"

src/Views/HomebrewView/homebrewView.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,21 @@ HomebrewView::HomebrewView(Homebrew hb) :
3939
img_preview_btn_download(Texture(&_binary_assets_spr_img_preview_btn_download_png_start)),
4040
img_preview_btn_open(Texture(&_binary_assets_spr_img_preview_btn_open_png_start)),
4141
hb_(hb),
42-
img_icon(Texture(ICONS_FOLDER + "/" + hb.icon))
42+
img_icon(Texture(std::string(ICONS_FOLDER "/") + hb.icon))
4343
{
4444
// FIXME Support more than 1 screenshot
4545
if (!hb_.screenshots.empty()) {
4646
std::string path = hb_.screenshots.at(0);
4747
std::size_t found = path.find_last_of('/');
4848
std::string filename = path.substr(found+1);
4949

50-
sceIoMkdir(SCREENSHOTS_FOLDER.c_str(), 0777);
50+
sceIoMkdir(SCREENSHOTS_FOLDER, 0777);
5151

5252
try {
53-
Network::get_instance()->Download(SERVER_BASE_URL + path, SCREENSHOTS_FOLDER + "/" + filename);
53+
Network::get_instance()->Download(std::string(SERVER_BASE_URL) + path, std::string(SCREENSHOTS_FOLDER "/") + filename);
5454
// FIXME Should give false to Texture() so as not to cache but for some reason the destructor is called and so the vita2d resource is freed (cf ~Texture())
55-
screenshots.emplace_back(SCREENSHOTS_FOLDER + "/" + filename, false);
56-
sceIoRemove((SCREENSHOTS_FOLDER + "/" + filename).c_str());
55+
screenshots.emplace_back(std::string(SCREENSHOTS_FOLDER "/") + filename, false);
56+
sceIoRemove((std::string(SCREENSHOTS_FOLDER "/") + filename).c_str());
5757
} catch (const std::exception &ex) {
5858
log_printf(DBG_ERROR, "Cannot download screenshot %s", path.c_str());
5959
}
@@ -138,7 +138,7 @@ int HomebrewView::Display()
138138
sb.Display();
139139

140140
img_preview_infobg.Draw(Point(HB_X, HB_Y + 300));
141-
141+
142142
font_40.Draw(Point(HB_X + 225, HB_Y + 88), hb_.name, COLOR_WHITE);
143143
font_25.Draw(Point(HB_X + 225, HB_Y + 115), hb_.author, COLOR_AQUA);
144144
font_25.Draw(Point(HB_X + 225, HB_Y + 144), hb_.version, COLOR_WHITE);

0 commit comments

Comments
 (0)