Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This change allows playlist icons to be replaced with Logos. #16758

Merged
merged 11 commits into from
Aug 7, 2024

Conversation

jbreitweiser
Copy link
Contributor

Guidelines

  1. Rebase before opening a pull request
  2. If you are sending several unrelated fixes or features, use a branch and a separate pull request for each
  3. If possible try squashing everything in a single commit. This is particularly beneficial in the case of feature merges since it allows easy bisecting when a problem arises

Description

This change allows playlist icons to be replaced with Logos. the art is loaded to the Thumbnail Named_Logos folder. It is treated the same as other thumbnails for naming and for automatic download. There is a settings menu option to turn it on and off. It is off by default. This only applies to the xmb menu driver.

Related Issues

[Any issues this pull request may be addressing]

Related Pull Requests

[Any other PRs from related repositories that might be needed for this pull request to work]

Reviewers

[If possible @mention all the people that should review your pull request]

…is loaded to the Thumbnail Named_Logos folder. It is treated the same as other thumbnails for naming and for automatic download. There is a settings menu option to turn it on and off. It is off by default. This only applies to the xmb menu driver.
gfx/gfx_thumbnail_path.c Outdated Show resolved Hide resolved
@hizzlekizzle
Copy link
Contributor

I think most of these CI build failures are unrelated. GLIBC stuff.

Do we want/need to supply these logos through the thumbnail server? is there a permissively-licensed source for them? Or do we assume people will have their own source?

@LibretroAdmin
Copy link
Contributor

I think most of these CI build failures are unrelated. GLIBC stuff.

Do we want/need to supply these logos through the thumbnail server? is there a permissively-licensed source for them? Or do we assume people will have their own source?

I still can't get it to build though even re-running the tasks.

@jbreitweiser
Copy link
Contributor Author

All of the errors reference GLIBC_2.28. Is there a problem with the build pipeline?

@jbreitweiser
Copy link
Contributor Author

I think most of these CI build failures are unrelated. GLIBC stuff.
Do we want/need to supply these logos through the thumbnail server? is there a permissively-licensed source for them? Or do we assume people will have their own source?

I still can't get it to build though even re-running the tasks.

I actually tried to merge this yesterday and hit the GLIBC_2.28 error. So I deleted the branch, closed the pull request. Re forked Retroarch. Pulled down a new copy. Copied over the changes and then re committed and opened a pull request with the same results. I was thinking this might be a build pipeline issue.

@jbreitweiser
Copy link
Contributor Author

I think most of these CI build failures are unrelated. GLIBC stuff.

Do we want/need to supply these logos through the thumbnail server? is there a permissively-licensed source for them? Or do we assume people will have their own source?

I was thinking this would be art added to the thumbnails download. I used the functions to pull down thumbnail art when it is not present. A user can add it themselves, that is how I tested, but i think in the long run it could be populated through the thumbnail server.

@sonninnos
Copy link
Collaborator

Nothing odd about these trivial errors.

menu/drivers/xmb.c: In function ‘xmb_unload_icon_thumbnail_textures’:
menu/drivers/xmb.c:1397:4: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
 1397 |    for(size_t i =0; i < list_size ; i++)
      |    ^~~
menu/drivers/xmb.c:1397:4: note: use option ‘-std=c99’, ‘-std=gnu99’, ‘-std=c11’ or ‘-std=gnu11’ to compile your code
menu/drivers/xmb.c: In function ‘xmb_populate_dynamic_icons’:
menu/drivers/xmb.c:2274:7: error: C++ style comments are not allowed in ISO C90
 2274 |       //  Clear current textures if they are there
      |       ^
menu/drivers/xmb.c:2274:7: note: (this will be reported only once per input file)
menu/drivers/xmb.c:2293:13: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
 2293 |             xmb_icons_t *thumbnail_icon = &node->thumbnail_icon;
      |             ^~~~~~~~~~~
menu/drivers/xmb.c: In function ‘xmb_draw_item’:
menu/drivers/xmb.c:4372:7: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
 4372 |       bool show_icon_thumbnail          =
      |       ^~~~
cc1: some warnings being treated as errors
make: *** [Makefile:209: obj-unix/release/menu/drivers/xmb.o] Error 1

@jbreitweiser
Copy link
Contributor Author

Nothing odd about these trivial errors.

menu/drivers/xmb.c: In function ‘xmb_unload_icon_thumbnail_textures’:
menu/drivers/xmb.c:1397:4: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
 1397 |    for(size_t i =0; i < list_size ; i++)
      |    ^~~
menu/drivers/xmb.c:1397:4: note: use option ‘-std=c99’, ‘-std=gnu99’, ‘-std=c11’ or ‘-std=gnu11’ to compile your code
menu/drivers/xmb.c: In function ‘xmb_populate_dynamic_icons’:
menu/drivers/xmb.c:2274:7: error: C++ style comments are not allowed in ISO C90
 2274 |       //  Clear current textures if they are there
      |       ^
menu/drivers/xmb.c:2274:7: note: (this will be reported only once per input file)
menu/drivers/xmb.c:2293:13: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
 2293 |             xmb_icons_t *thumbnail_icon = &node->thumbnail_icon;
      |             ^~~~~~~~~~~
menu/drivers/xmb.c: In function ‘xmb_draw_item’:
menu/drivers/xmb.c:4372:7: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
 4372 |       bool show_icon_thumbnail          =
      |       ^~~~
cc1: some warnings being treated as errors
make: *** [Makefile:209: obj-unix/release/menu/drivers/xmb.o] Error 1

Cleaned up and committed

@sonninnos
Copy link
Collaborator

sonninnos commented Jul 6, 2024

Could you show a screenshot of how this looks in practice?

And you still missed one: https://github.com/libretro/RetroArch/actions/runs/9819465190/job/27113026888?pr=16758

menu/drivers/xmb.c: In function ‘xmb_draw_item’:
menu/drivers/xmb.c:4390:10: error: C++ style comments are not allowed in ISO C90
 4390 |          //  Adjust icon location by recentering with half width and height
      |          ^
menu/drivers/xmb.c:4390:10: note: (this will be reported only once per input file)
make: *** [Makefile:209: obj-unix/release/menu/drivers/xmb.o] Error 1

@jbreitweiser
Copy link
Contributor Author

Could you show a screenshot of how this looks in practice?

And you still missed one: https://github.com/libretro/RetroArch/actions/runs/9819465190/job/27113026888?pr=16758

menu/drivers/xmb.c: In function ‘xmb_draw_item’:
menu/drivers/xmb.c:4390:10: error: C++ style comments are not allowed in ISO C90
 4390 |          //  Adjust icon location by recentering with half width and height
      |          ^
menu/drivers/xmb.c:4390:10: note: (this will be reported only once per input file)
make: *** [Makefile:209: obj-unix/release/menu/drivers/xmb.o] Error 1

Comment removed

Screenshot Logo Icons

@zoltanvb
Copy link
Contributor

zoltanvb commented Jul 7, 2024

Tested it a bit, works nicely, but I do not see any download attempts when using the on-demand thumbnail downloader or the playlist thumbnail downloader. (That can be added later, anyways.)

What is the optimal size for the logos? I threw in some portrait images for testing, and ofc they look off, but if this gets merged and some enthusiastic people start to fill the thumbnail repos, it would be nice to have a sort of standard.
image

@jbreitweiser
Copy link
Contributor Author

jbreitweiser commented Jul 7, 2024

Tested it a bit, works nicely, but I do not see any download attempts when using the on-demand thumbnail downloader or the playlist thumbnail downloader. (That can be added later, anyways.)

What is the optimal size for the logos? I threw in some portrait images for testing, and ofc they look off, but if this gets merged and some enthusiastic people start to fill the thumbnail repos, it would be nice to have a sort of standard.
image

So it should be resizing all images to 256 x 256 for the selected ROM. The non selected entries are 234 x 234. All the images I used were wider than taller. The resize function uses the width in proportion to the height. So if the height is greater than the width it might be causing the overlap.

@jbreitweiser
Copy link
Contributor Author

Is there a way to fix the 3DS build? The glibc seems to be fixed for the other builds but that one continues to fail.

@zoltanvb
Copy link
Contributor

Try a rebase, 3DS CI works since d05b319 .

@hizzlekizzle
Copy link
Contributor

eyy, nice. all checks have passed.

@LibretroAdmin did you have any further requests?

gfx/gfx_display.c Outdated Show resolved Hide resolved
settings_t *settings = config_get_ptr();

if (!path_data)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For single lines, the brackets are not necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code reformatted

path_data->playlist_index = 0;

if (!playlist)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For single lines, the brackets are not necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code reformatted

}

if (idx >= playlist_get_size(playlist))
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For single lines, the brackets are not necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code reformatted

char tmp_buf[PATH_MAX_LENGTH];
const char* pos = strchr(db_name, '|');

if (pos && (size_t) (pos - db_name)+1 < sizeof(tmp_buf)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opening bracket on a newline

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code reformatted

* databases mentioned separated by |, use only first one */
strlcpy(tmp_buf, db_name, (size_t) (pos - db_name)+1);
}
else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opening bracket on a newline

{
xmb_node_t *node = (xmb_node_t*)selection_buf->list[i].userdata;
if(node)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brackets not necessary for a single line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code reformatted

@jbreitweiser
Copy link
Contributor Author

Al requested changes complete and repo rebased. All checks passed.

@LibretroAdmin did you have any further requests?

@LibretroAdmin
Copy link
Contributor

Sorry for the long wait. Merged.

@LibretroAdmin LibretroAdmin merged commit 11d9a84 into libretro:master Aug 7, 2024
27 checks passed
@zach-morris zach-morris mentioned this pull request Nov 27, 2024
Sunderland93 pushed a commit to Sunderland93/RetroArch that referenced this pull request Dec 26, 2024
…o#16758)

* This change allows playlist icons to be replaced with Logos. the art is loaded to the Thumbnail Named_Logos folder. It is treated the same as other thumbnails for naming and for automatic download. There is a settings menu option to turn it on and off. It is off by default. This only applies to the xmb menu driver.

* Removed commented out code against the style guide.

* Code cleanup for C89 compatibitity

* Cleaned up errors from Automated CI.

* Cleaned up comments.

* Update gfx_display.c

change strcpy to strlcpy

* Update gfx_thumbnail_path.c

fix code formatting

* Update xmb.c

code formatting changes
@OctopusButtons
Copy link

Nice work on this. I always imagined someday setting actual game disc picture (rather than logo per se), for select favorite PS1 playlist games instead of just the generic disc icon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants