Display DS icons 1:1.

This commit is contained in:
Steven Smith 2016-04-12 18:44:24 -07:00
parent b384008bb1
commit 0d96c487ee
2 changed files with 27 additions and 15 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 B

After

Width:  |  Height:  |  Size: 339 B

View File

@ -240,9 +240,13 @@ void ui_draw_ext_save_data_info(ui_view* view, void* data, float x1, float y1, f
float smdhInfoBoxY = y1 + (y2 - y1) / 4 - smdhInfoBoxHeight / 2; float smdhInfoBoxY = y1 + (y2 - y1) / 4 - smdhInfoBoxHeight / 2;
screen_draw_texture(TEXTURE_SMDH_INFO_BOX, smdhInfoBoxX, smdhInfoBoxY, smdhInfoBoxWidth, smdhInfoBoxHeight); screen_draw_texture(TEXTURE_SMDH_INFO_BOX, smdhInfoBoxX, smdhInfoBoxY, smdhInfoBoxWidth, smdhInfoBoxHeight);
float smdhIconX = smdhInfoBoxX + 8; u32 smdhIconWidth;
float smdhIconY = smdhInfoBoxY + 8; u32 smdhIconHeight;
screen_draw_texture(info->smdhInfo.texture, smdhIconX, smdhIconY, 48, 48); screen_get_texture_size(&smdhIconWidth, &smdhIconHeight, info->smdhInfo.texture);
float smdhIconX = smdhInfoBoxX + (64 - smdhIconWidth) / 2;
float smdhIconY = smdhInfoBoxY + (smdhInfoBoxHeight - smdhIconHeight) / 2;
screen_draw_texture(info->smdhInfo.texture, smdhIconX, smdhIconY, smdhIconWidth, smdhIconHeight);
float shortDescriptionHeight; float shortDescriptionHeight;
screen_get_string_size(NULL, &shortDescriptionHeight, info->smdhInfo.shortDescription, 0.5f, 0.5f); screen_get_string_size(NULL, &shortDescriptionHeight, info->smdhInfo.shortDescription, 0.5f, 0.5f);
@ -253,9 +257,9 @@ void ui_draw_ext_save_data_info(ui_view* view, void* data, float x1, float y1, f
float publisherHeight; float publisherHeight;
screen_get_string_size(NULL, &publisherHeight, info->smdhInfo.publisher, 0.5f, 0.5f); screen_get_string_size(NULL, &publisherHeight, info->smdhInfo.publisher, 0.5f, 0.5f);
float smdhTextX = smdhIconX + 48 + 8; float smdhTextX = smdhInfoBoxX + 64;
float smdhShortDescriptionY = smdhIconY + (48 - shortDescriptionHeight - 2 - longDescriptionHeight - 2 - publisherHeight) / 2; float smdhShortDescriptionY = smdhInfoBoxY + (64 - shortDescriptionHeight - 2 - longDescriptionHeight - 2 - publisherHeight) / 2;
screen_draw_string(info->smdhInfo.shortDescription, smdhTextX, smdhShortDescriptionY, 0.5f, 0.5f, COLOR_TEXT, false); screen_draw_string(info->smdhInfo.shortDescription, smdhTextX, smdhShortDescriptionY, 0.5f, 0.5f, COLOR_TEXT, false);
float smdhLongDescriptionY = smdhShortDescriptionY + shortDescriptionHeight + 2; float smdhLongDescriptionY = smdhShortDescriptionY + shortDescriptionHeight + 2;
@ -334,9 +338,13 @@ void ui_draw_file_info(ui_view* view, void* data, float x1, float y1, float x2,
float smdhInfoBoxY = y1 + (y2 - y1) / 4 - smdhInfoBoxHeight / 2; float smdhInfoBoxY = y1 + (y2 - y1) / 4 - smdhInfoBoxHeight / 2;
screen_draw_texture(TEXTURE_SMDH_INFO_BOX, smdhInfoBoxX, smdhInfoBoxY, smdhInfoBoxWidth, smdhInfoBoxHeight); screen_draw_texture(TEXTURE_SMDH_INFO_BOX, smdhInfoBoxX, smdhInfoBoxY, smdhInfoBoxWidth, smdhInfoBoxHeight);
float smdhIconX = smdhInfoBoxX + 8; u32 smdhIconWidth;
float smdhIconY = smdhInfoBoxY + 8; u32 smdhIconHeight;
screen_draw_texture(info->ciaInfo.smdhInfo.texture, smdhIconX, smdhIconY, 48, 48); screen_get_texture_size(&smdhIconWidth, &smdhIconHeight, info->ciaInfo.smdhInfo.texture);
float smdhIconX = smdhInfoBoxX + (64 - smdhIconWidth) / 2;
float smdhIconY = smdhInfoBoxY + (smdhInfoBoxHeight - smdhIconHeight) / 2;
screen_draw_texture(info->ciaInfo.smdhInfo.texture, smdhIconX, smdhIconY, smdhIconWidth, smdhIconHeight);
float shortDescriptionHeight; float shortDescriptionHeight;
screen_get_string_size(NULL, &shortDescriptionHeight, info->ciaInfo.smdhInfo.shortDescription, 0.5f, 0.5f); screen_get_string_size(NULL, &shortDescriptionHeight, info->ciaInfo.smdhInfo.shortDescription, 0.5f, 0.5f);
@ -347,9 +355,9 @@ void ui_draw_file_info(ui_view* view, void* data, float x1, float y1, float x2,
float publisherHeight; float publisherHeight;
screen_get_string_size(NULL, &publisherHeight, info->ciaInfo.smdhInfo.publisher, 0.5f, 0.5f); screen_get_string_size(NULL, &publisherHeight, info->ciaInfo.smdhInfo.publisher, 0.5f, 0.5f);
float smdhTextX = smdhIconX + 48 + 8; float smdhTextX = smdhInfoBoxX + 64;
float smdhShortDescriptionY = smdhIconY + (48 - shortDescriptionHeight - 2 - longDescriptionHeight - 2 - publisherHeight) / 2; float smdhShortDescriptionY = smdhInfoBoxY + (64 - shortDescriptionHeight - 2 - longDescriptionHeight - 2 - publisherHeight) / 2;
screen_draw_string(info->ciaInfo.smdhInfo.shortDescription, smdhTextX, smdhShortDescriptionY, 0.5f, 0.5f, COLOR_TEXT, false); screen_draw_string(info->ciaInfo.smdhInfo.shortDescription, smdhTextX, smdhShortDescriptionY, 0.5f, 0.5f, COLOR_TEXT, false);
float smdhLongDescriptionY = smdhShortDescriptionY + shortDescriptionHeight + 2; float smdhLongDescriptionY = smdhShortDescriptionY + shortDescriptionHeight + 2;
@ -502,9 +510,13 @@ void ui_draw_title_info(ui_view* view, void* data, float x1, float y1, float x2,
float smdhInfoBoxY = y1 + (y2 - y1) / 4 - smdhInfoBoxHeight / 2; float smdhInfoBoxY = y1 + (y2 - y1) / 4 - smdhInfoBoxHeight / 2;
screen_draw_texture(TEXTURE_SMDH_INFO_BOX, smdhInfoBoxX, smdhInfoBoxY, smdhInfoBoxWidth, smdhInfoBoxHeight); screen_draw_texture(TEXTURE_SMDH_INFO_BOX, smdhInfoBoxX, smdhInfoBoxY, smdhInfoBoxWidth, smdhInfoBoxHeight);
float smdhIconX = smdhInfoBoxX + 8; u32 smdhIconWidth;
float smdhIconY = smdhInfoBoxY + 8; u32 smdhIconHeight;
screen_draw_texture(info->smdhInfo.texture, smdhIconX, smdhIconY, 48, 48); screen_get_texture_size(&smdhIconWidth, &smdhIconHeight, info->smdhInfo.texture);
float smdhIconX = smdhInfoBoxX + (64 - smdhIconWidth) / 2;
float smdhIconY = smdhInfoBoxY + (smdhInfoBoxHeight - smdhIconHeight) / 2;
screen_draw_texture(info->smdhInfo.texture, smdhIconX, smdhIconY, smdhIconWidth, smdhIconHeight);
float shortDescriptionHeight; float shortDescriptionHeight;
screen_get_string_size(NULL, &shortDescriptionHeight, info->smdhInfo.shortDescription, 0.5f, 0.5f); screen_get_string_size(NULL, &shortDescriptionHeight, info->smdhInfo.shortDescription, 0.5f, 0.5f);
@ -515,9 +527,9 @@ void ui_draw_title_info(ui_view* view, void* data, float x1, float y1, float x2,
float publisherHeight; float publisherHeight;
screen_get_string_size(NULL, &publisherHeight, info->smdhInfo.publisher, 0.5f, 0.5f); screen_get_string_size(NULL, &publisherHeight, info->smdhInfo.publisher, 0.5f, 0.5f);
float smdhTextX = smdhIconX + 48 + 8; float smdhTextX = smdhInfoBoxX + 64;
float smdhShortDescriptionY = smdhIconY + (48 - shortDescriptionHeight - 2 - longDescriptionHeight - 2 - publisherHeight) / 2; float smdhShortDescriptionY = smdhInfoBoxY + (64 - shortDescriptionHeight - 2 - longDescriptionHeight - 2 - publisherHeight) / 2;
screen_draw_string(info->smdhInfo.shortDescription, smdhTextX, smdhShortDescriptionY, 0.5f, 0.5f, COLOR_TEXT, false); screen_draw_string(info->smdhInfo.shortDescription, smdhTextX, smdhShortDescriptionY, 0.5f, 0.5f, COLOR_TEXT, false);
float smdhLongDescriptionY = smdhShortDescriptionY + shortDescriptionHeight + 2; float smdhLongDescriptionY = smdhShortDescriptionY + shortDescriptionHeight + 2;