Some inline + remove useless const&.

This commit is contained in:
StackZ
2020-11-06 02:10:58 +01:00
parent 689192e902
commit ddbea3ab36
35 changed files with 186 additions and 228 deletions
+3 -6
View File
@@ -45,9 +45,9 @@ static const std::vector<Structs::ButtonPos> downloadBoxes = {
const std::unique_ptr<Store> &store: Const Reference to the Store class.
const std::vector<std::string> &entries: Const Reference to the download list as a vector of strings.
const bool &fetch: Const Reference to Fetch.
bool fetch: if fetching or not.
*/
void StoreUtils::DrawDownList(const std::unique_ptr<Store> &store, const std::vector<std::string> &entries, const bool &fetch) {
void StoreUtils::DrawDownList(const std::unique_ptr<Store> &store, const std::vector<std::string> &entries, bool fetch) {
if (store && !fetch) {
Gui::Draw_Rect(48, 0, 272, 25, ENTRY_BAR_COLOR);
Gui::Draw_Rect(48, 25, 272, 1, ENTRY_BAR_OUTL_COLOR);
@@ -73,9 +73,6 @@ void StoreUtils::DrawDownList(const std::unique_ptr<Store> &store, const std::ve
- Execute an Entry of the download list.
- Return back to EntryInfo through `B`.
u32 hDown: The hidKeysDown() variable.
u32 hHeld: The hidKeysHeld() variable.
touchPosition touch: The TouchPosition variable.
const std::unique_ptr<Store> &store: Const Reference to the Store class, since we do not modify anything in it.
const std::unique_ptr<StoreEntry> &entry: Const Reference to the current StoreEntry, since we do not modify anything in it.
const std::vector<std::string> &entries: Const Reference to the download list, since we do not modify anything in it.
@@ -84,7 +81,7 @@ void StoreUtils::DrawDownList(const std::unique_ptr<Store> &store, const std::ve
const int &lastMode: Const Reference to the last mode.
int &smallDelay: Reference to the small delay. This helps to not directly press A.
*/
void StoreUtils::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 &currentMenu, std::unique_ptr<Meta> &meta, const int &lastMode, int &smallDelay) {
void StoreUtils::DownloadHandle(const std::unique_ptr<Store> &store, const std::unique_ptr<StoreEntry> &entry, const std::vector<std::string> &entries, int &currentMenu, std::unique_ptr<Meta> &meta, const int &lastMode, int &smallDelay) {
if (store && entry) { // Ensure, store & entry is not a nullptr.
if (smallDelay > 0) {
smallDelay--;
+1 -4
View File
@@ -72,12 +72,9 @@ void StoreUtils::DrawEntryInfo(const std::unique_ptr<Store> &store, const std::u
- Go to the download list, by pressing `A`.
- Show the MarkMenu with START.
u32 hDown: The hidKeysDown() variable.
u32 hHeld: The hidKeysHeld() variable.
touchPosition touch: The TouchPosition variable.
bool &showMark: Reference to showMark.. to show the mark menu.
bool &fetch: Reference to fetch, so we know, if we need to fetch, when accessing download list.
*/
void StoreUtils::EntryHandle(u32 hDown, u32 hHeld, touchPosition touch, bool &showMark, bool &fetch) {
void StoreUtils::EntryHandle(bool &showMark, bool &fetch) {
if ((hDown & KEY_START) || (hDown & KEY_TOUCH && touching(touch, btn))) showMark = true;
}
+4 -7
View File
@@ -92,9 +92,6 @@ void StoreUtils::DrawGrid(const std::unique_ptr<Store> &store, const std::vector
- Scroll through the Grid with the D-Pad.
u32 hDown: The hidKeysDown() variable.
u32 hHeld: The hidKeysHeld() variable.
touchPosition touch: The TouchPosition variable.
std::unique_ptr<Store> &store: Reference to the Store class.
std::vector<std::unique_ptr<StoreEntry>> &entries: Reference to the StoreEntries.
const int &currentMode: Reference to the current Mode.
@@ -102,14 +99,14 @@ void StoreUtils::DrawGrid(const std::unique_ptr<Store> &store, const std::vector
bool &fetch: Reference to fetch.
int &smallDelay: Reference to the small delay.
*/
void StoreUtils::GridLogic(u32 hDown, u32 hHeld, touchPosition touch, std::unique_ptr<Store> &store, std::vector<std::unique_ptr<StoreEntry>> &entries, int &currentMode, int &lastMode, bool &fetch, int &smallDelay) {
void StoreUtils::GridLogic(std::unique_ptr<Store> &store, std::vector<std::unique_ptr<StoreEntry>> &entries, int &currentMode, int &lastMode, bool &fetch, int &smallDelay) {
if (store) { // Ensure, store is not a nullptr.
if (hRepeat & KEY_DOWN) {
if (store->GetBox() > 9) {
if (store->GetEntry() + 5 < (int)entries.size()) {
store->SetEntry(store->GetEntry() + 5);
if (store->GetScreenIndx() < ((entries.size() / 5) - 2)) {
if (store->GetScreenIndx() < (((int)entries.size() / 5) - 2)) {
store->SetScreenIndx(store->GetScreenIndx() + 1);
}
@@ -118,7 +115,7 @@ void StoreUtils::GridLogic(u32 hDown, u32 hHeld, touchPosition touch, std::uniqu
store->SetEntry(entries.size() - 1);
store->SetBox(10 + (store->GetEntry() % 5));
if (store->GetScreenIndx() < ((entries.size() / 5) - 2)) {
if (store->GetScreenIndx() < (((int)entries.size() / 5) - 2)) {
store->SetScreenIndx(store->GetScreenIndx() + 1);
}
}
@@ -142,7 +139,7 @@ void StoreUtils::GridLogic(u32 hDown, u32 hHeld, touchPosition touch, std::uniqu
store->SetBox(10);
store->SetEntry(store->GetEntry() + 1);
if (store->GetScreenIndx() < ((entries.size() / 5) - 2)) {
if (store->GetScreenIndx() < (((int)entries.size() / 5) - 2)) {
store->SetScreenIndx(store->GetScreenIndx() + 1);
}
}
+1 -4
View File
@@ -82,9 +82,6 @@ void StoreUtils::DrawList(const std::unique_ptr<Store> &store, const std::vector
- Scroll through the Grid with the D-Pad Up / Down and skip 3 Entries with Left / Right.
u32 hDown: The hidKeysDown() variable.
u32 hHeld: The hidKeysHeld() variable.
touchPosition touch: The TouchPosition variable.
std::unique_ptr<Store> &store: Reference to the Store class.
std::vector<std::unique_ptr<StoreEntry>> &entries: Reference to the StoreEntries.
int &currentMode: Const Reference to the current Mode.
@@ -92,7 +89,7 @@ void StoreUtils::DrawList(const std::unique_ptr<Store> &store, const std::vector
bool &fetch: Reference to fetch.
int &smallDelay: Reference to the small delay.
*/
void StoreUtils::ListLogic(u32 hDown, u32 hHeld, touchPosition touch, std::unique_ptr<Store> &store, std::vector<std::unique_ptr<StoreEntry>> &entries, int &currentMode, int &lastMode, bool &fetch, int &smallDelay) {
void StoreUtils::ListLogic(std::unique_ptr<Store> &store, std::vector<std::unique_ptr<StoreEntry>> &entries, int &currentMode, int &lastMode, bool &fetch, int &smallDelay) {
if (store) { // Ensure, store is not a nullptr.
if (hRepeat & KEY_DOWN) {
if (store->GetEntry() < (int)entries.size() - 1) store->SetEntry(store->GetEntry() + 1);
+3 -6
View File
@@ -41,9 +41,9 @@ static const std::vector<Structs::ButtonPos> markBox = {
/*
Draw the Marking part.
const int &marks: A Reference to the active mark flags.
int marks: The active mark flags.
*/
void StoreUtils::DisplayMarkBox(const int &marks) {
void StoreUtils::DisplayMarkBox(int marks) {
Gui::Draw_Rect(0, 0, 320, 240, DIM_COLOR); // Darken.
Gui::Draw_Rect(markBox[0].x, markBox[0].y, markBox[0].w, markBox[0].h, (marks & favoriteMarks::STAR ?
@@ -78,15 +78,12 @@ void StoreUtils::DisplayMarkBox(const int &marks) {
- Mark the selected app.
- Return to EntryInfo with `B`.
u32 hDown: The hidKeysDown() variable.
u32 hHeld: The hidKeysHeld() variable.
touchPosition touch: The TouchPosition variable.
std::unique_ptr<StoreEntry> &entry: Reference to the current StoreEntry.
const std::unique_ptr<Store> &store: Const Reference to the Store, since we do not modify anything there.
bool &showMark: Reference to showMark, so we know, if we should stay here or not.
std::unique_ptr<Meta> &meta: Reference to the Meta class.
*/
void StoreUtils::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 StoreUtils::MarkHandle(std::unique_ptr<StoreEntry> &entry, const std::unique_ptr<Store> &store, bool &showMark, std::unique_ptr<Meta> &meta) {
hidScanInput();
touchPosition t;
hidTouchRead(&t);
+10 -10
View File
@@ -79,10 +79,10 @@ void Meta::ImportMetadata() {
/*
Get Last Updated.
std::string unistoreName: The UniStore name.
std::string entry: The Entry name.
const std::string &unistoreName: The UniStore name.
const std::string &entry: The Entry name.
*/
std::string Meta::GetUpdated(std::string unistoreName, std::string entry) const {
std::string Meta::GetUpdated(const std::string &unistoreName, const std::string &entry) const {
if (!this->metadataJson.contains(unistoreName)) return ""; // UniStore Name does not exist.
if (!this->metadataJson[unistoreName].contains(entry)) return ""; // Entry does not exist.
@@ -96,10 +96,10 @@ std::string Meta::GetUpdated(std::string unistoreName, std::string entry) const
/*
Get the marks.
std::string unistoreName: The UniStore name.
std::string entry: The Entry name.
const std::string &unistoreName: The UniStore name.
const std::string &entry: The Entry name.
*/
int Meta::GetMarks(std::string unistoreName, std::string entry) const {
int Meta::GetMarks(const std::string &unistoreName, const std::string &entry) const {
int temp = 0;
if (!this->metadataJson.contains(unistoreName)) return temp; // UniStore Name does not exist.
@@ -115,11 +115,11 @@ int Meta::GetMarks(std::string unistoreName, std::string entry) const {
/*
Return, if update available.
std::string unistoreName: The UniStore name.
std::string entry: The Entry name.
std::string updated: Compare for the update.
const std::string &unistoreName: The UniStore name.
const std::string &entry: The Entry name.
const std::string &updated: Compare for the update.
*/
bool Meta::UpdateAvailable(std::string unistoreName, std::string entry, std::string updated) const {
bool Meta::UpdateAvailable(const std::string &unistoreName, const std::string &entry, const std::string &updated) const {
if (this->GetUpdated(unistoreName, entry) != "" && updated != "") {
return strcasecmp(updated.c_str(), this->GetUpdated(unistoreName, entry).c_str()) > 0;
}
+4 -7
View File
@@ -52,10 +52,10 @@ static const std::vector<Structs::ButtonPos> SearchMenu = {
const std::vector<bool> &searchIncludes: Const Reference to the searchIncludes.
const std::string &searchResult: Const Reference to the searchResult.
const int &marks: Const Reference to the filter mark flags.
const bool &updateFilter: Const Reference to the update filter.
int marks: The filter mark flags.
bool updateFilter: The update filter.
*/
void StoreUtils::DrawSearchMenu(const std::vector<bool> &searchIncludes, const std::string &searchResult, const int &marks, const bool &updateFilter) {
void StoreUtils::DrawSearchMenu(const std::vector<bool> &searchIncludes, const std::string &searchResult, int marks, bool updateFilter) {
Gui::Draw_Rect(48, 0, 272, 25, ENTRY_BAR_COLOR);
Gui::Draw_Rect(48, 25, 272, 1, ENTRY_BAR_OUTL_COLOR);
Gui::DrawStringCentered(25, 2, 0.6, TEXT_COLOR, Lang::get("SEARCH_FILTERS"), 265);
@@ -115,9 +115,6 @@ void StoreUtils::DrawSearchMenu(const std::vector<bool> &searchIncludes, const s
- Search the UniStore.
- Include stuff into the search.
u32 hDown: The hidKeysDown() variable.
u32 hHeld: The hidKeysHeld() variable.
touchPosition touch: The TouchPosition variable.
std::unique_ptr<Store> &store: Reference to the Store class.
std::vector<std::unique_ptr<StoreEntry>> &entries: Reference to the Store Entries.
std::vector<bool> &searchIncludes: Reference to the searchIncludes.
@@ -126,7 +123,7 @@ void StoreUtils::DrawSearchMenu(const std::vector<bool> &searchIncludes, const s
int &marks: Reference to the mark flags.
bool &updateFilter: Reference to the update filter.
*/
void StoreUtils::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 StoreUtils::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) {
/* Checkboxes. */
if (hDown & KEY_TOUCH) {
bool didTouch = false;
+24 -42
View File
@@ -69,9 +69,9 @@ static const std::string langsTemp[] = { "br", "da", "de", "en", "es", "fr", "it
/*
Main Settings.
const int &selection: Const Reference to the Settings Selection.
int selection: The Settings Selection.
*/
static void DrawSettingsMain(const int &selection) {
static void DrawSettingsMain(int selection) {
Gui::Draw_Rect(48, 0, 272, 25, ENTRY_BAR_COLOR);
Gui::Draw_Rect(48, 25, 272, 1, ENTRY_BAR_OUTL_COLOR);
Gui::DrawStringCentered(25, 2, 0.6, TEXT_COLOR, Lang::get("SETTINGS"), 265);
@@ -85,10 +85,10 @@ static void DrawSettingsMain(const int &selection) {
/*
Draw the Language Selection.
const int &selection: Const Reference to the Language Selection.
const int &sPos: Const Reference to the Screen Position.
int selection: The Language Selection.
int sPos: The Screen Position.
*/
static void DrawLanguageSettings(const int &selection, const int &sPos) {
static void DrawLanguageSettings(int selection, int sPos) {
Gui::Draw_Rect(48, 0, 272, 25, ENTRY_BAR_COLOR);
Gui::Draw_Rect(48, 25, 272, 1, ENTRY_BAR_OUTL_COLOR);
GFX::DrawSprite(sprites_arrow_idx, back.x, back.y);
@@ -103,9 +103,9 @@ static void DrawLanguageSettings(const int &selection, const int &sPos) {
/*
Directory Change Draw.
const int &selection: Const Reference to the Settings Selection.
int selection: The Settings Selection.
*/
static void DrawSettingsDir(const int &selection) {
static void DrawSettingsDir(int selection) {
Gui::Draw_Rect(48, 0, 272, 25, ENTRY_BAR_COLOR);
Gui::Draw_Rect(48, 25, 272, 1, ENTRY_BAR_OUTL_COLOR);
GFX::DrawSprite(sprites_arrow_idx, back.x, back.y);
@@ -120,7 +120,7 @@ static void DrawSettingsDir(const int &selection) {
/*
Draw Auto-Update Settings page.
*/
static void DrawAutoUpdate(const int &selection) {
static void DrawAutoUpdate(int selection) {
Gui::Draw_Rect(48, 0, 272, 36, ENTRY_BAR_COLOR);
Gui::Draw_Rect(48, 36, 272, 1, ENTRY_BAR_OUTL_COLOR);
GFX::DrawSprite(sprites_arrow_idx, 52, 6);
@@ -142,9 +142,9 @@ static void DrawAutoUpdate(const int &selection) {
/*
Draw the GUI Settings.
const int &selection: Const Reference to the Settings Selection.
int selection: The Settings Selection.
*/
static void DrawGUISettings(const int &selection) {
static void DrawGUISettings(int selection) {
Gui::Draw_Rect(48, 0, 272, 36, ENTRY_BAR_COLOR);
Gui::Draw_Rect(48, 36, 272, 1, ENTRY_BAR_OUTL_COLOR);
GFX::DrawSprite(sprites_arrow_idx, 52, 6);
@@ -168,9 +168,6 @@ static void DrawGUISettings(const int &selection) {
- Show the Credits.
- Exit Universal-Updater.
u32 hDown: The hidKeysDown() variable.
u32 hHeld: The hidKeysHeld() variable.
touchPosition touch: The TouchPosition variable.
int &page: Reference to the page.
bool &dspSettings: Reference to the display Settings.
int &storeMode: Reference to the Store Mode.
@@ -179,7 +176,7 @@ static void DrawGUISettings(const int &selection) {
std::vector<std::unique_ptr<StoreEntry>> &entries: Reference to the StoreEntries.
std::unique_ptr<Meta> &meta: Reference to the Meta class.
*/
static void SettingsHandleMain(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) {
static void SettingsHandleMain(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) {
if (hDown & KEY_B) {
selection = 0;
storeMode = 0;
@@ -277,13 +274,10 @@ static void SettingsHandleMain(u32 hDown, u32 hHeld, touchPosition touch, int &p
- Change the Directory of...
- 3DSX, NDS & Archives.
u32 hDown: The hidKeysDown() variable.
u32 hHeld: The hidKeysHeld() variable.
touchPosition touch: The TouchPosition variable.
int &page: Reference to the page.
int &selection: Reference to the Selection.
*/
static void SettingsHandleDir(u32 hDown, u32 hHeld, touchPosition touch, int &page, int &selection, const std::unique_ptr<Store> &store) {
static void SettingsHandleDir(int &page, int &selection, const std::unique_ptr<Store> &store) {
if (hDown & KEY_B) {
page = 0;
selection = 4;
@@ -358,13 +352,10 @@ static void SettingsHandleDir(u32 hDown, u32 hHeld, touchPosition touch, int &pa
- Enable / Disable Automatically updating the UniStore on boot.
- Enable / Disable Automatically check for Universal-Updater updates on boot.
u32 hDown: The hidKeysDown() variable.
u32 hHeld: The hidKeysHeld() variable.
touchPosition touch: The TouchPosition variable.
int &page: Reference to the page.
int &selection: Reference to the Selection.
*/
static void AutoUpdateLogic(u32 hDown, u32 hHeld, touchPosition touch, int &page, int &selection) {
static void AutoUpdateLogic(int &page, int &selection) {
if (hDown & KEY_B) {
page = 0;
selection = 2;
@@ -411,13 +402,10 @@ static void AutoUpdateLogic(u32 hDown, u32 hHeld, touchPosition touch, int &page
- Enable / Disable using the SpriteSheet Background Image, if exist.
u32 hDown: The hidKeysDown() variable.
u32 hHeld: The hidKeysHeld() variable.
touchPosition touch: The TouchPosition variable.
int &page: Reference to the page.
int &selection: Reference to the Selection.
*/
static void GUISettingsLogic(u32 hDown, u32 hHeld, touchPosition touch, int &page, int &selection) {
static void GUISettingsLogic(int &page, int &selection) {
if (hDown & KEY_B) {
page = 0;
selection = 3;
@@ -449,14 +437,11 @@ static void GUISettingsLogic(u32 hDown, u32 hHeld, touchPosition touch, int &pag
- Select the language, which should be used with the app.
u32 hDown: The hidKeysDown() variable.
u32 hHeld: The hidKeysHeld() variable.
touchPosition touch: The TouchPosition variable.
int &page: Reference to the page.
int &selection: Reference to the Selection.
int &sPos: Reference to the ScreenPos variable.
*/
static void LanguageLogic(u32 hDown, u32 hHeld, touchPosition touch, int &page, int &selection, int &sPos) {
static void LanguageLogic(int &page, int &selection, int &sPos) {
if (hRepeat & KEY_DOWN) {
if (selection < (int)languages.size() - 1) selection++;
else selection = 0;
@@ -514,10 +499,10 @@ static void LanguageLogic(u32 hDown, u32 hHeld, touchPosition touch, int &page,
/*
Draw the Settings.
const int &page: Const Reference to the page.
const int &selection: Const Reference to the selection.
int page: The page.
int selection: The selection.
*/
void StoreUtils::DrawSettings(const int &page, const int &selection, const int &sPos) {
void StoreUtils::DrawSettings(int page, int selection, int sPos) {
switch(page) {
case 0:
DrawSettingsMain(selection);
@@ -544,9 +529,6 @@ void StoreUtils::DrawSettings(const int &page, const int &selection, const int &
/*
Settings Handle.
u32 hDown: The hidKeysDown() variable.
u32 hHeld: The hidKeysHeld() variable.
touchPosition touch: The TouchPosition variable.
int &page: Reference to the page.
bool &dspSettings: Reference to the display Settings.
int &storeMode: Reference to the Store Mode.
@@ -555,26 +537,26 @@ void StoreUtils::DrawSettings(const int &page, const int &selection, const int &
std::vector<std::unique_ptr<StoreEntry>> &entries: Reference to the StoreEntries.
std::unique_ptr<Meta> &meta: Reference to the Meta class.
*/
void StoreUtils::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 StoreUtils::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) {
switch(page) {
case 0:
SettingsHandleMain(hDown, hHeld, touch, page, dspSettings, storeMode, selection, store, entries, meta);
SettingsHandleMain(page, dspSettings, storeMode, selection, store, entries, meta);
break;
case 1:
SettingsHandleDir(hDown, hHeld, touch, page, selection, store);
SettingsHandleDir(page, selection, store);
break;
case 2:
AutoUpdateLogic(hDown, hHeld, touch, page, selection);
AutoUpdateLogic(page, selection);
break;
case 3:
GUISettingsLogic(hDown, hHeld, touch, page, selection);
GUISettingsLogic(page, selection);
break;
case 4:
LanguageLogic(hDown, hHeld, touch, page, selection, sPos);
LanguageLogic(page, selection, sPos);
break;
}
}
+3 -5
View File
@@ -39,9 +39,9 @@ static const std::vector<Structs::ButtonPos> sidePos = {
/*
Draw the Side Menu part.
const int &currentMenu: Const Reference to the current Store Mode / Menu.
int currentMenu: The current Store Mode / Menu.
*/
void StoreUtils::DrawSideMenu(const int &currentMenu) {
void StoreUtils::DrawSideMenu(int currentMenu) {
for (int i = 0; i < 5; i++) {
if (i == currentMenu) {
Gui::Draw_Rect(sidePos[i].x, sidePos[i].y, sidePos[i].w, sidePos[i].h, SIDEBAR_SELECTED_COLOR);
@@ -66,12 +66,10 @@ void StoreUtils::DrawSideMenu(const int &currentMenu) {
- Switch between the Menus through the sidebar.
u32 hDown: The hidKeysDown() variable.
touchPosition touch: The TouchPosition variable.
int &currentMenu: Reference to the Store Mode / Menu.
bool &fetch: Reference of the download fetch variable.. so we know, if we need to fetch the download entries.
*/
void StoreUtils::SideMenuHandle(u32 hDown, touchPosition touch, int &currentMenu, bool &fetch) {
void StoreUtils::SideMenuHandle(int &currentMenu, bool &fetch) {
if (hDown & KEY_TOUCH) {
for (int i = 0; i < 5; i++) {
if (touching(touch, sidePos[i])) {
+6 -9
View File
@@ -49,9 +49,9 @@ static void DrawCheck(int pos, bool v) {
/*
Return SortType as an uint8_t.
const SortType &st: Const Reference to the SortType variable.
SortType st: The SortType variable.
*/
static const uint8_t GetType(const SortType &st) {
static const uint8_t GetType(SortType st) {
switch(st) {
case SortType::TITLE:
return 0;
@@ -69,10 +69,10 @@ static const uint8_t GetType(const SortType &st) {
/*
Draw the Sort Menu.
const bool &asc: Const Reference to the Ascending variable.
const SortType &st: Const Reference to the SortType variable.
bool asc: The Ascending variable.
SortType st: The SortType variable.
*/
void StoreUtils::DrawSorting(const bool &asc, const SortType &st) {
void StoreUtils::DrawSorting(bool asc, SortType st) {
Gui::Draw_Rect(48, 0, 272, 25, ENTRY_BAR_COLOR);
Gui::Draw_Rect(48, 25, 272, 1, ENTRY_BAR_OUTL_COLOR);
Gui::DrawStringCentered(25, 2, 0.6, TEXT_COLOR, Lang::get("SORTING"), 265);
@@ -113,15 +113,12 @@ void StoreUtils::DrawSorting(const bool &asc, const SortType &st) {
- Change the Top Style.
u32 hDown: The hidKeysDown() variable.
u32 hHeld: The hidKeysHeld() variable.
touchPosition touch: The TouchPosition variable.
std::unique_ptr<Store> &store: Reference to the Store class.
std::vector<std::unique_ptr<StoreEntry>> &entries: Reference to the StoreEntries.
bool &asc: Reference to the Ascending variable.
SortType &st: Reference to the SortType.
*/
void StoreUtils::SortHandle(u32 hDown, u32 hHeld, touchPosition touch, std::unique_ptr<Store> &store, std::vector<std::unique_ptr<StoreEntry>> &entries, bool &asc, SortType &st) {
void StoreUtils::SortHandle(std::unique_ptr<Store> &store, std::vector<std::unique_ptr<StoreEntry>> &entries, bool &asc, SortType &st) {
if (store && store->GetValid() && entries.size() > 0) { // Ensure, this is valid and more than 0 entries exist.
if (hDown & KEY_TOUCH) {
/* SortType Part. */
+20 -20
View File
@@ -238,9 +238,9 @@ std::string Store::GetUniStoreTitle() const {
/*
Return the Title of an index.
const int &index: Const Reference to the index.
int index: The index.
*/
std::string Store::GetTitleEntry(const int &index) const {
std::string Store::GetTitleEntry(int index) const {
if (!this->valid) return "";
if (index > (int)this->storeJson["storeContent"].size() - 1) return ""; // Empty.
@@ -254,9 +254,9 @@ std::string Store::GetTitleEntry(const int &index) const {
/*
Return the Author name of an index.
const int &index: Const Reference to the index.
int index: The index.
*/
std::string Store::GetAuthorEntry(const int &index) const {
std::string Store::GetAuthorEntry(int index) const {
if (!this->valid) return "";
if (index > (int)this->storeJson["storeContent"].size() - 1) return ""; // Empty.
@@ -270,9 +270,9 @@ std::string Store::GetAuthorEntry(const int &index) const {
/*
Return the Description of an index.
const int &index: Const Reference to the index.
int index: The index.
*/
std::string Store::GetDescriptionEntry(const int &index) const {
std::string Store::GetDescriptionEntry(int index) const {
if (!this->valid) return "";
if (index > (int)this->storeJson["storeContent"].size() - 1) return ""; // Empty.
@@ -286,9 +286,9 @@ std::string Store::GetDescriptionEntry(const int &index) const {
/*
Return the Category of an index.
const int &index: Const Reference to the index.
int index: The index.
*/
std::vector<std::string> Store::GetCategoryIndex(const int &index) const {
std::vector<std::string> Store::GetCategoryIndex(int index) const {
if (!this->valid) return { "" };
if (index > (int)this->storeJson["storeContent"].size() - 1) return { "" }; // Empty.
@@ -309,9 +309,9 @@ std::vector<std::string> Store::GetCategoryIndex(const int &index) const {
/*
Return the Version of an index.
const int &index: Const Reference to the index.
int index: The index.
*/
std::string Store::GetVersionEntry(const int &index) const {
std::string Store::GetVersionEntry(int index) const {
if (!this->valid) return "";
if (index > (int)this->storeJson["storeContent"].size() - 1) return ""; // Empty.
@@ -325,9 +325,9 @@ std::string Store::GetVersionEntry(const int &index) const {
/*
Return the Console of an index.
const int &index: Const Reference to the index.
int index: The index.
*/
std::vector<std::string> Store::GetConsoleEntry(const int &index) const {
std::vector<std::string> Store::GetConsoleEntry(int index) const {
if (!this->valid) return { "" };
if (index > (int)this->storeJson["storeContent"].size() - 1) return { "" }; // Empty.
@@ -348,9 +348,9 @@ std::vector<std::string> Store::GetConsoleEntry(const int &index) const {
/*
Return the Last updated date of an index.
const int &index: Const Reference to the index.
int index: The index.
*/
std::string Store::GetLastUpdatedEntry(const int &index) const {
std::string Store::GetLastUpdatedEntry(int index) const {
if (!this->valid) return "";
if (index > (int)this->storeJson["storeContent"].size() - 1) return ""; // Empty.
@@ -364,9 +364,9 @@ std::string Store::GetLastUpdatedEntry(const int &index) const {
/*
Return the License of an index.
const int &index: Const Reference to the index.
int index: The index.
*/
std::string Store::GetLicenseEntry(const int &index) const {
std::string Store::GetLicenseEntry(int index) const {
if (!this->valid) return Lang::get("NO_LICENSE");
if (index > (int)this->storeJson["storeContent"].size() - 1) return Lang::get("NO_LICENSE"); // Empty.
@@ -382,9 +382,9 @@ std::string Store::GetLicenseEntry(const int &index) const {
/*
Return a C2D_Image of an index.
const int &index: Const Reference to the index.
int index: The index.
*/
C2D_Image Store::GetIconEntry(const int &index) const {
C2D_Image Store::GetIconEntry(int index) const {
if (!this->valid) return C2D_SpriteSheetGetImage(sprites, sprites_noIcon_idx);
if (this->sheets.empty()) return C2D_SpriteSheetGetImage(sprites, sprites_noIcon_idx);
int iconIndex = -1, sheetIndex = 0;
@@ -446,9 +446,9 @@ void Store::SetC2DBGImage() {
/*
Return the download list of an entry.
const int &index: Const Reference to the index.
int index: The index.
*/
std::vector<std::string> Store::GetDownloadList(const int &index) const {
std::vector<std::string> Store::GetDownloadList(int index) const {
if (!this->valid) return { "" };
std::vector<std::string> temp;
+2 -2
View File
@@ -31,9 +31,9 @@
const std::unique_ptr<Store> &store: Const Reference to the Store class.
const std::unique_ptr<Meta> &meta: Const Reference to the Meta class.
const int &index: Const Reference Index of the entry.
int index: Index of the entry.
*/
StoreEntry::StoreEntry(const std::unique_ptr<Store> &store, const std::unique_ptr<Meta> &meta, const int &index) {
StoreEntry::StoreEntry(const std::unique_ptr<Store> &store, const std::unique_ptr<Meta> &meta, int index) {
this->Title = store->GetTitleEntry(index);
this->Author = store->GetAuthorEntry(index);
+3 -3
View File
@@ -80,11 +80,11 @@ bool StoreUtils::compareUpdateAscending(const std::unique_ptr<StoreEntry> &a, co
/*
Sort the entries.
const bool &Ascending: Const Reference to Ascending.
const SortType &sorttype: Const Reference to the sort type.
bool Ascending: If Ascending.
SortType sorttype: The sort type.
std::vector<std::unique_ptr<StoreEntry>> &entries: Reference to the Entries, which should be sorted.
*/
void StoreUtils::SortEntries(const bool &Ascending, const SortType &sorttype, std::vector<std::unique_ptr<StoreEntry>> &entries) {
void StoreUtils::SortEntries(bool Ascending, SortType sorttype, std::vector<std::unique_ptr<StoreEntry>> &entries) {
switch(sorttype) {
case SortType::TITLE:
Ascending ? std::sort(entries.begin(), entries.end(), StoreUtils::compareTitleAscending) : std::sort(entries.begin(), entries.end(), StoreUtils::compareTitleDescending);