Skip to content

Add option to show a grid of banners#49

Merged
trevor403 merged 11 commits intoOffBroadway:custom-loader-menufrom
BenHetherington:grid-of-banners
Mar 22, 2026
Merged

Add option to show a grid of banners#49
trevor403 merged 11 commits intoOffBroadway:custom-loader-menufrom
BenHetherington:grid-of-banners

Conversation

@BenHetherington
Copy link
Copy Markdown

This adds an option to show a 3x4 grid of 3:1 banners in the game selection menu, allowing game banners to be displayed without needing them to be stretched.

This can be configured using a menu_grid_layout .ini setting; set this to square_icons for the existing layout, and to banners for this new layout. The default is square_icons (the status quo).

This replaces the magic number of ‘8’ icons per row with a variable, allowing it to be modifiable.
This allows it to either be set to `square_icons` for the existing 8x4 grid of square icons, or `banners` for the new 3x4 grid of banners (which have an aspect ratio of 3:1).

If not specified, it’ll default to the square icons (the current behaviour).
This adds support for showing a 3x4 grid of banners (at 3:1 aspect ratio), when this grid type is set in the .ini file.

To show them at this aspect ratio, it just scales the cubes used for the icons by 3 on the x axis.
This replaces `ASSETS_PER_LINE` with the `columns_per_line` variable, and adds new variables to replace `ASSETS_PER_PAGE` and `ASSETS_INITIAL_COUNT`.
@BenHetherington
Copy link
Copy Markdown
Author

While tinkering with this, I had another idea for how this could be laid out – by scaling the banners by 0.75x, it's possible to fit a 4x4 grid on-screen (leaving more vertical space between rows), which might be preferable for those with a lot of games.

I'll add this as an extra commit, which can be used by setting menu_grid_layout to small_banners – let me know if you'd rather split this commit out into a separate PR!

While tinkering with grids of banners, I had another idea for how to lay it out. By shrinking the grid elements by 0.75x, it’s possible to fit an additional banner per row (leaving more vertical space between rows). This might be preferable for those with larger libraries.

This option can be used by setting the `menu_grid_type` .ini setting to `small_banners`.
# Conflicts:
#	cubeboot/source/main.c
#	patches/source/grid.c
# Conflicts:
#	cubeboot/source/main.c
Using a shared header just for settings `enum`s seems nicer than including all of `settings.h` from `patches`.
As these cubes have some padding between the plane used for the icon and the edge of the cube, and rounded corners, scaling one axis of the entire cube model by 3 will also stretch both of these.

This resolves this by instead extruding the vertices of the save cube models, such that the plane used for the icons is 3x its original width. The menu will then switch between original and extruded vertex buffers as needed.
As the banner-width icons obviously have a larger width than the original square icons, the same rotation amounts cause their corners to cover a larger area vertically than was originally the case.

To keep the icons within the grid a bit better (and to make the rotation a bit less distracting), let’s scale down the y-axis rotation by 3 while banner-width icons are in use.
@BenHetherington
Copy link
Copy Markdown
Author

I've just pushed up some extra changes that extrudes the cube model's vertices, rather than scaling the model by 3. This should make it look a fair bit nicer, as it keeps the padding between the icon and outer edges, and the rounded corners, intact. I've tested it on all IPL versions and it seems to work nicely!

@trevor403
Copy link
Copy Markdown
Member

I'll work on resolving the conflict and merge soon

# Conflicts:
#	patches/source/menu.c
@BenHetherington
Copy link
Copy Markdown
Author

Ah yeah, that is the fun of having lots of branches on the go at once 😄 I've now sorted out the conflict here, and I'll try and keep these PRs up-to-date as and when I can!

#pragma once

typedef enum {
MENU_GRID_SQUARE_ICONS,
Copy link
Copy Markdown
Member

@trevor403 trevor403 Mar 22, 2026

Choose a reason for hiding this comment

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

lets equate these so they are always the same value

nevermind!

#include "attr.h"
#include "os.h"

typedef struct vtx1_header_t {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

these should be in structs.h


void use_extruded_save_cubes(model_data *textured_model_data, model_data *untextured_model_data) {
textured_model_data->vertices = &extruded_textured_save_cube_vertices.header;
untextured_model_data->vertices = &extruded_untextured_save_cube_vertices.header;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

great approach w/ pointers

@trevor403 trevor403 merged commit 2e140ea into OffBroadway:custom-loader-menu Mar 22, 2026
@BenHetherington BenHetherington deleted the grid-of-banners branch March 23, 2026 18:35
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.

2 participants