mirror of
https://github.com/wiiu-env/launchiine.git
synced 2024-11-22 01:39:18 +01:00
Rename GameList::loadIcon to GameList::updateTitleInfo. Only call the callback when things acutally have changed.
This commit is contained in:
parent
b8226ea729
commit
c36dcb6728
@ -132,15 +132,18 @@ int32_t GameList::readGameList() {
|
||||
return cnt;
|
||||
}
|
||||
|
||||
void GameList::loadIcons() {
|
||||
void GameList::updateTitleInfo() {
|
||||
for (int i = 0; i < this->size(); i++) {
|
||||
gameInfo * newHeader = this->at(i);
|
||||
|
||||
bool hasChanged = false;
|
||||
|
||||
ACPMetaXml* meta = (ACPMetaXml*)calloc(1, 0x4000); //TODO fix wut
|
||||
if(meta) {
|
||||
auto acp = ACPGetTitleMetaXml(newHeader->titleId, meta);
|
||||
if(acp >= 0) {
|
||||
newHeader->name = meta->shortname_en;
|
||||
hasChanged = true;
|
||||
}
|
||||
free(meta);
|
||||
}
|
||||
@ -155,16 +158,19 @@ void GameList::loadIcons() {
|
||||
GuiImageData * imageData = new GuiImageData(buffer, bufferSize, GX2_TEX_CLAMP_MODE_MIRROR);
|
||||
if(imageData) {
|
||||
newHeader->imageData = imageData;
|
||||
hasChanged = true;
|
||||
}
|
||||
|
||||
//! free original image buffer which is converted to texture now and not needed anymore
|
||||
free(buffer);
|
||||
}
|
||||
}
|
||||
if(hasChanged) {
|
||||
DCFlushRange(newHeader, sizeof(gameInfo));
|
||||
titleUpdated(newHeader);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GameList::internalFilterList(std::vector<gameInfo*> &fullList) {
|
||||
for (uint32_t i = 0; i < fullList.size(); ++i) {
|
||||
@ -194,7 +200,7 @@ int32_t GameList::filterList(const char * filter) {
|
||||
|
||||
titleListChanged(this);
|
||||
|
||||
AsyncExecutor::execute([&] { loadIcons();});
|
||||
AsyncExecutor::execute([&] { updateTitleInfo();});
|
||||
|
||||
return filteredList.size();
|
||||
}
|
||||
@ -220,7 +226,7 @@ int32_t GameList::loadUnfiltered() {
|
||||
|
||||
sortList();
|
||||
|
||||
AsyncExecutor::execute([&] { loadIcons();});
|
||||
AsyncExecutor::execute([&] { updateTitleInfo();});
|
||||
|
||||
titleListChanged(this);
|
||||
|
||||
|
@ -87,7 +87,7 @@ protected:
|
||||
void internalFilterList(std::vector<gameInfo*> & fullList);
|
||||
void internalLoadUnfiltered(std::vector<gameInfo*> & fullList);
|
||||
|
||||
void loadIcons();
|
||||
void updateTitleInfo();
|
||||
|
||||
static bool nameSortCallback(const gameInfo *a, const gameInfo *b);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user