Add support for 32x32 images.

This commit is contained in:
StackZ
2020-06-19 11:30:24 +02:00
parent e8421ae69f
commit eed89ca54a
+14 -2
View File
@@ -133,7 +133,13 @@ void UniStoreV2::DrawGrid(void) const {
if (this->sheetLoaded) {
if (this->sortedStore->returnIconIndex(i + (this->storePage * STORE_ENTRIES)) != -1) {
if (this->sortedStore->returnIconIndex(i + (this->storePage * STORE_ENTRIES)) < this->iconAmount) {
Gui::DrawSprite(this->sheet, this->sortedStore->returnIconIndex(i + (this->storePage * STORE_ENTRIES)), this->StoreBoxesGrid[i].x+26, this->StoreBoxesGrid[i].y+1);
C2D_Image temp = C2D_SpriteSheetGetImage(this->sheet, this->sortedStore->returnIconIndex(i + (this->storePage * STORE_ENTRIES)));
if (temp.subtex->width == 32) {
Gui::DrawSprite(this->sheet, this->sortedStore->returnIconIndex(i + (this->storePage * STORE_ENTRIES)), this->StoreBoxesGrid[i].x+34, this->StoreBoxesGrid[i].y+9);
} else {
Gui::DrawSprite(this->sheet, this->sortedStore->returnIconIndex(i + (this->storePage * STORE_ENTRIES)), this->StoreBoxesGrid[i].x+26, this->StoreBoxesGrid[i].y+1);
}
temp = {nullptr, nullptr};
} else {
GFX::DrawSprite(sprites_noIcon_idx, this->StoreBoxesGrid[i].x+26, this->StoreBoxesGrid[i].y+1);
}
@@ -157,7 +163,13 @@ void UniStoreV2::DrawList(void) const {
if (this->sheetLoaded) {
if (this->sortedStore->returnIconIndex(i + (this->storePageList * STORE_ENTRIES_LIST)) != -1) {
if (this->sortedStore->returnIconIndex(i + (this->storePageList * STORE_ENTRIES_LIST)) < this->iconAmount) {
Gui::DrawSprite(this->sheet, this->sortedStore->returnIconIndex(i + (this->storePageList * STORE_ENTRIES_LIST)), this->StoreBoxesList[i].x+1, this->StoreBoxesList[i].y+1);
C2D_Image temp = C2D_SpriteSheetGetImage(this->sheet, this->sortedStore->returnIconIndex(i + (this->storePageList * STORE_ENTRIES_LIST)));
if (temp.subtex->width == 32) {
Gui::DrawSprite(this->sheet, this->sortedStore->returnIconIndex(i + (this->storePageList * STORE_ENTRIES_LIST)), this->StoreBoxesList[i].x+9, this->StoreBoxesList[i].y+9);
} else {
Gui::DrawSprite(this->sheet, this->sortedStore->returnIconIndex(i + (this->storePageList * STORE_ENTRIES_LIST)), this->StoreBoxesList[i].x+1, this->StoreBoxesList[i].y+1);
}
temp = {nullptr, nullptr};
} else {
GFX::DrawSprite(sprites_noIcon_idx, this->StoreBoxesList[i].x+1, this->StoreBoxesList[i].y+1);
}