mirror of
https://github.com/DarkStore-3DS/DarkStore.git
synced 2026-07-02 16:49:05 +00:00
Some inline + remove useless const&.
This commit is contained in:
+3
-1
@@ -27,6 +27,7 @@
|
||||
#ifndef _UNIVERSAL_UPDATER_COMMON_HPP
|
||||
#define _UNIVERSAL_UPDATER_COMMON_HPP
|
||||
|
||||
#include <3ds.h>
|
||||
#include "config.hpp"
|
||||
#include "gfx.hpp"
|
||||
#include "lang.hpp"
|
||||
@@ -37,6 +38,7 @@ inline std::unique_ptr<Config> config;
|
||||
|
||||
#define _STORE_PATH "sdmc:/3ds/Universal-Updater/stores/"
|
||||
#define _META_PATH "sdmc:/3ds/Universal-Updater/MetaData.json"
|
||||
inline uint32_t hRepeat;
|
||||
inline uint32_t hRepeat, hDown, hHeld;
|
||||
inline touchPosition touch;
|
||||
|
||||
#endif
|
||||
+3
-4
@@ -72,10 +72,9 @@
|
||||
namespace GFX {
|
||||
void DrawTop(void);
|
||||
void DrawBottom();
|
||||
void DrawSprite(const int &img, const int &x, const int &y, const float &ScaleX = 1, const float &ScaleY = 1);
|
||||
void DrawBox(const float &xPos, const float &yPos, const float &width = 50, const float &height = 50, const bool &selected = false, const uint32_t &clr = BOX_INSIDE_COLOR);
|
||||
void DrawButton(const float &xPos, const float &yPos, const float &width, const float &height, const bool &selected, const std::string &Text = "");
|
||||
void DrawCheckbox(const float &xPos, const float &yPos, const bool &selected);
|
||||
void DrawSprite(int img, int x, int y, float ScaleX = 1, float ScaleY = 1);
|
||||
void DrawBox(float xPos, float yPos, float width = 50, float height = 50, bool selected = false, uint32_t clr = BOX_INSIDE_COLOR);
|
||||
void DrawCheckbox(float xPos, float yPos, bool selected);
|
||||
void DrawToggle(float xPos, float yPos, bool toggled);
|
||||
};
|
||||
|
||||
|
||||
@@ -43,15 +43,15 @@ public:
|
||||
Meta();
|
||||
~Meta() { this->SaveCall(); };
|
||||
|
||||
std::string GetUpdated(std::string unistoreName, std::string entry) const;
|
||||
int GetMarks(std::string unistoreName, std::string entry) const;
|
||||
bool UpdateAvailable(std::string unistoreName, std::string entry, std::string updated) const;
|
||||
std::string GetUpdated(const std::string &unistoreName, const std::string &entry) const;
|
||||
int GetMarks(const std::string &unistoreName, const std::string &entry) const;
|
||||
bool UpdateAvailable(const std::string &unistoreName, const std::string &entry, const std::string &updated) const;
|
||||
|
||||
void SetUpdated(std::string unistoreName, std::string entry, std::string updated) {
|
||||
void SetUpdated(const std::string &unistoreName, const std::string &entry, const std::string &updated) {
|
||||
this->metadataJson[unistoreName][entry]["updated"] = updated;
|
||||
};
|
||||
|
||||
void SetMarks(std::string unistoreName, std::string entry, int marks) {
|
||||
void SetMarks(const std::string &unistoreName, const std::string &entry, int marks) {
|
||||
this->metadataJson[unistoreName][entry]["marks"] = marks;
|
||||
};
|
||||
|
||||
|
||||
+10
-10
@@ -45,17 +45,17 @@ public:
|
||||
std::string GetUniStoreAuthor() const;
|
||||
|
||||
/* Get Information of the UniStore Entries. */
|
||||
std::string GetTitleEntry(const int &index) const;
|
||||
std::string GetAuthorEntry(const int &index) const;
|
||||
std::string GetDescriptionEntry(const int &index) const;
|
||||
std::vector<std::string> GetCategoryIndex(const int &index) const;
|
||||
std::string GetVersionEntry(const int &index) const;
|
||||
std::vector<std::string> GetConsoleEntry(const int &index) const;
|
||||
std::string GetLastUpdatedEntry(const int &index) const;
|
||||
std::string GetLicenseEntry(const int &index) const;
|
||||
C2D_Image GetIconEntry(const int &index) const;
|
||||
std::string GetTitleEntry(int index) const;
|
||||
std::string GetAuthorEntry(int index) const;
|
||||
std::string GetDescriptionEntry(int index) const;
|
||||
std::vector<std::string> GetCategoryIndex(int index) const;
|
||||
std::string GetVersionEntry(int index) const;
|
||||
std::vector<std::string> GetConsoleEntry(int index) const;
|
||||
std::string GetLastUpdatedEntry(int index) const;
|
||||
std::string GetLicenseEntry(int index) const;
|
||||
C2D_Image GetIconEntry(int index) const;
|
||||
|
||||
std::vector<std::string> GetDownloadList(const int &index) const;
|
||||
std::vector<std::string> GetDownloadList(int index) const;
|
||||
|
||||
int GetStoreSize() const { return (int)this->storeJson["storeContent"].size(); };
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
class StoreEntry {
|
||||
public:
|
||||
StoreEntry(const std::unique_ptr<Store> &store, const std::unique_ptr<Meta> &meta, const int &index);
|
||||
StoreEntry(const std::unique_ptr<Store> &store, const std::unique_ptr<Meta> &meta, int index);
|
||||
|
||||
std::string GetTitle() const { return this->Title; };
|
||||
std::string GetAuthor() const { return this->Author; };
|
||||
@@ -54,9 +54,9 @@ public:
|
||||
std::vector<std::string> GetConsoleFull() const { return this->FullConsole; };
|
||||
|
||||
bool GetUpdateAvl() const { return this->UpdateAvailable; };
|
||||
void SetUpdateAvl(const bool &v) { this->UpdateAvailable = v; };
|
||||
void SetUpdateAvl(bool v) { this->UpdateAvailable = v; };
|
||||
|
||||
void SetMark(const int &marks) {
|
||||
void SetMark(int marks) {
|
||||
this->Marks = marks;
|
||||
this->MarkString = StringUtils::GetMarkString(this->Marks);
|
||||
};
|
||||
|
||||
@@ -41,42 +41,42 @@ enum class SortType : uint8_t {
|
||||
namespace StoreUtils {
|
||||
/* Grid. */
|
||||
void DrawGrid(const std::unique_ptr<Store> &store, const std::vector<std::unique_ptr<StoreEntry>> &entries);
|
||||
void GridLogic(u32 hDown, u32 hHeld, touchPosition touch, std::unique_ptr<Store> &store, std::vector<std::unique_ptr<StoreEntry>> &entries, int ¤tMode, int &lastMode, bool &fetch, int &smallDelay);
|
||||
void GridLogic(std::unique_ptr<Store> &store, std::vector<std::unique_ptr<StoreEntry>> &entries, int ¤tMode, int &lastMode, bool &fetch, int &smallDelay);
|
||||
|
||||
/* Top List. */
|
||||
void DrawList(const std::unique_ptr<Store> &store, const std::vector<std::unique_ptr<StoreEntry>> &entries);
|
||||
void ListLogic(u32 hDown, u32 hHeld, touchPosition touch, std::unique_ptr<Store> &store, std::vector<std::unique_ptr<StoreEntry>> &entries, int ¤tMode, int &lastMode, bool &fetch, int &smallDelay);
|
||||
void ListLogic(std::unique_ptr<Store> &store, std::vector<std::unique_ptr<StoreEntry>> &entries, int ¤tMode, int &lastMode, bool &fetch, int &smallDelay);
|
||||
|
||||
/* Entry Info. */
|
||||
void DrawEntryInfo(const std::unique_ptr<Store> &store, const std::unique_ptr<StoreEntry> &entry);
|
||||
void EntryHandle(u32 hDown, u32 hHeld, touchPosition touch, bool &showMark, bool &fetch);
|
||||
void EntryHandle(bool &showMark, bool &fetch);
|
||||
|
||||
/* Side Menu. */
|
||||
void DrawSideMenu(const int ¤tMenu);
|
||||
void SideMenuHandle(u32 hDown, touchPosition touch, int ¤tMenu, bool &fetch);
|
||||
void DrawSideMenu(int currentMenu);
|
||||
void SideMenuHandle(int ¤tMenu, bool &fetch);
|
||||
|
||||
/* Download Entries. */
|
||||
void DrawDownList(const std::unique_ptr<Store> &store, const std::vector<std::string> &entries, const bool &fetch);
|
||||
void DownloadHandle(u32 hDown, u32 hHeld, touchPosition touch, const std::unique_ptr<Store> &store, const std::unique_ptr<StoreEntry> &entry, const std::vector<std::string> &entries, int ¤tMenu, std::unique_ptr<Meta> &meta, const int &lastMode, int &smallDelay);
|
||||
void DrawDownList(const std::unique_ptr<Store> &store, const std::vector<std::string> &entries, bool fetch);
|
||||
void DownloadHandle(const std::unique_ptr<Store> &store, const std::unique_ptr<StoreEntry> &entry, const std::vector<std::string> &entries, int ¤tMenu, std::unique_ptr<Meta> &meta, const int &lastMode, int &smallDelay);
|
||||
|
||||
/* Search + Favorite Menu. */
|
||||
void DrawSearchMenu(const std::vector<bool> &searchIncludes, const std::string &searchResult, const int &marks, const bool &updateFilter);
|
||||
void SearchHandle(u32 hDown, u32 hHeld, touchPosition touch, std::unique_ptr<Store> &store, std::vector<std::unique_ptr<StoreEntry>> &entries, std::vector<bool> &searchIncludes, std::unique_ptr<Meta> &meta, std::string &searchResult, int &marks, bool &updateFilter, bool ascending, SortType sorttype);
|
||||
void DrawSearchMenu(const std::vector<bool> &searchIncludes, const std::string &searchResult, int marks, bool updateFilter);
|
||||
void SearchHandle(std::unique_ptr<Store> &store, std::vector<std::unique_ptr<StoreEntry>> &entries, std::vector<bool> &searchIncludes, std::unique_ptr<Meta> &meta, std::string &searchResult, int &marks, bool &updateFilter, bool ascending, SortType sorttype);
|
||||
|
||||
/* Mark Menu. */
|
||||
void DisplayMarkBox(const int &marks);
|
||||
void MarkHandle(u32 hDown, u32 hHeld, touchPosition touch, std::unique_ptr<StoreEntry> &entry, const std::unique_ptr<Store> &store, bool &showMark, std::unique_ptr<Meta> &meta);
|
||||
void DisplayMarkBox(int marks);
|
||||
void MarkHandle(std::unique_ptr<StoreEntry> &entry, const std::unique_ptr<Store> &store, bool &showMark, std::unique_ptr<Meta> &meta);
|
||||
|
||||
/* Credits. */
|
||||
void DrawCredits();
|
||||
|
||||
/* Settings. */
|
||||
void DrawSettings(const int &page, const int &selection, const int &sPos);
|
||||
void SettingsHandle(u32 hDown, u32 hHeld, touchPosition touch, int &page, bool &dspSettings, int &storeMode, int &selection, std::unique_ptr<Store> &store, std::vector<std::unique_ptr<StoreEntry>> &entries, std::unique_ptr<Meta> &meta, int &sPos);
|
||||
void DrawSettings(int page, int selection, int sPos);
|
||||
void SettingsHandle(int &page, bool &dspSettings, int &storeMode, int &selection, std::unique_ptr<Store> &store, std::vector<std::unique_ptr<StoreEntry>> &entries, std::unique_ptr<Meta> &meta, int &sPos);
|
||||
|
||||
/* Sorting. */
|
||||
void DrawSorting(const bool &asc, const SortType &st);
|
||||
void SortHandle(u32 hDown, u32 hHeld, touchPosition touch, std::unique_ptr<Store> &store, std::vector<std::unique_ptr<StoreEntry>> &entries, bool &asc, SortType &st);
|
||||
void DrawSorting(bool asc, SortType st);
|
||||
void SortHandle(std::unique_ptr<Store> &store, std::vector<std::unique_ptr<StoreEntry>> &entries, bool &asc, SortType &st);
|
||||
|
||||
bool compareTitleDescending(const std::unique_ptr<StoreEntry> &a, const std::unique_ptr<StoreEntry> &b);
|
||||
bool compareTitleAscending(const std::unique_ptr<StoreEntry> &a, const std::unique_ptr<StoreEntry> &b);
|
||||
@@ -87,7 +87,7 @@ namespace StoreUtils {
|
||||
bool compareUpdateDescending(const std::unique_ptr<StoreEntry> &a, const std::unique_ptr<StoreEntry> &b);
|
||||
bool compareUpdateAscending(const std::unique_ptr<StoreEntry> &a, const std::unique_ptr<StoreEntry> &b);
|
||||
|
||||
void SortEntries(const bool &Ascending, const SortType &sorttype, std::vector<std::unique_ptr<StoreEntry>> &entries);
|
||||
void SortEntries(bool Ascending, SortType sorttype, std::vector<std::unique_ptr<StoreEntry>> &entries);
|
||||
|
||||
void search(std::vector<std::unique_ptr<StoreEntry>> &entries, const std::string &query, bool title, bool author, bool category, bool console, int selectedMarks, bool updateAvl);
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ enum class ProgressBar {
|
||||
};
|
||||
|
||||
namespace Animation {
|
||||
void DrawProgressBar(const u64 ¤tProgress, const u64 &totalProgress);
|
||||
void DrawProgressBar(u64 currentProgress, u64 totalProgress);
|
||||
void displayProgressBar();
|
||||
};
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
|
||||
#include <3ds.h>
|
||||
|
||||
Result CIA_LaunchTitle(const u64 &titleId, const FS_MediaType &mediaType);
|
||||
Result deletePrevious(const u64 &titleid, const FS_MediaType &media);
|
||||
Result installCia(const char *ciaPath, const bool &updateSelf);
|
||||
Result CIA_LaunchTitle(u64 titleId, FS_MediaType mediaType);
|
||||
Result deletePrevious(u64 titleid, FS_MediaType media);
|
||||
Result installCia(const char *ciaPath, bool updateSelf);
|
||||
|
||||
#endif
|
||||
@@ -42,7 +42,7 @@ enum DownloadError {
|
||||
};
|
||||
|
||||
Result downloadToFile(const std::string &url, const std::string &path);
|
||||
Result downloadFromRelease(const std::string &url, const std::string &asset, const std::string &path, const bool &includePrereleases);
|
||||
Result downloadFromRelease(const std::string &url, const std::string &asset, const std::string &path, bool includePrereleases);
|
||||
|
||||
/*
|
||||
Check Wi-Fi status.
|
||||
@@ -65,8 +65,8 @@ void notImplemented(void);
|
||||
*/
|
||||
void doneMsg(void);
|
||||
|
||||
bool IsUpdateAvailable(const std::string &URL, const int &revCurrent);
|
||||
bool DownloadUniStore(const std::string &URL, const int ¤tRev, std::string &fl, const bool &isDownload = false, const bool &isUDB = false);
|
||||
bool IsUpdateAvailable(const std::string &URL, int revCurrent);
|
||||
bool DownloadUniStore(const std::string &URL, int currentRev, std::string &fl, bool isDownload = false, bool isUDB = false);
|
||||
bool DownloadSpriteSheet(const std::string &URL, const std::string &file);
|
||||
bool IsUUUpdateAvailable();
|
||||
void UpdateAction();
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "common.hpp"
|
||||
|
||||
Result makeDirs(const char *path);
|
||||
Result openFile(Handle *fileHandle, const char *path, const bool &write);
|
||||
Result openFile(Handle *fileHandle, const char *path, bool write);
|
||||
Result deleteFile(const char *path);
|
||||
Result removeDir(const char *path);
|
||||
Result removeDirRecursive(const char *path);
|
||||
|
||||
@@ -45,16 +45,16 @@ namespace ScriptUtils {
|
||||
bool matchPattern(const std::string &pattern, const std::string &tested);
|
||||
|
||||
Result removeFile(const std::string &file, const std::string &message);
|
||||
void bootTitle(const std::string &TitleID, const bool &isNAND, const std::string &message);
|
||||
void bootTitle(const std::string &TitleID, bool isNAND, const std::string &message);
|
||||
Result prompt(const std::string &message);
|
||||
Result copyFile(const std::string &source, const std::string &destination, const std::string &message);
|
||||
Result renameFile(const std::string &oldName, const std::string &newName, const std::string &message);
|
||||
Result downloadRelease(const std::string &repo, const std::string &file, const std::string &output, const bool &includePrereleases, const std::string &message);
|
||||
Result downloadRelease(const std::string &repo, const std::string &file, const std::string &output, bool includePrereleases, const std::string &message);
|
||||
Result downloadFile(const std::string &file, const std::string &output, const std::string &message);
|
||||
void installFile(const std::string &file, const bool &updatingSelf, const std::string &message);
|
||||
void installFile(const std::string &file, bool pdatingSelf, const std::string &message);
|
||||
void extractFile(const std::string &file, const std::string &input, const std::string &output, const std::string &message);
|
||||
|
||||
Result runFunctions(const nlohmann::json &storeJson, const int &selection, const std::string &entry);
|
||||
Result runFunctions(nlohmann::json storeJson, int selection, const std::string &entry);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -34,7 +34,7 @@
|
||||
namespace StringUtils {
|
||||
std::string lower_case(const std::string &str);
|
||||
std::string FetchStringsFromVector(const std::vector<std::string> &fetch);
|
||||
std::string formatBytes(const int bytes);
|
||||
std::string formatBytes(int bytes);
|
||||
std::string GetMarkString(int marks);
|
||||
std::vector<std::string> GetMarks(int marks);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user