|
coastline 0.0.4
|
The menu screens: the generic screen that turns an item at a time, the track menu, the records of a season, and the models the screens draw. More...
#include <PR/gbi.h>#include <PR/ultratypes.h>#include "common/frontendscreens.h"#include "common/model.h"#include "common/seasons.h"#include "common/texrect.h"#include "common/trackmenuitem.h"#include "common/vehicle.h"#include "common/vehicleview.h"

Go to the source code of this file.
Macros | |
| #define | MENU_ITEM_ADJUSTABLE 0x01 |
| The flag of an item whose up and down change it in place, as the results 3 and 4. | |
| #define | MENU_ITEM_IMMEDIATE 0x02 |
| The flag of an item chosen at once, without fading the screen out. | |
| #define | MENU_ITEM_SPINNING 0x04 |
| The flag of an item drawn as its model turning on the stage. | |
| #define | MENU_ITEM_UNAVAILABLE 0x08 |
| The flag of an item that cannot be chosen, whose screen explains why. | |
| #define | MENU_ITEM_FIRST_PLAYER 0x20 |
| The flag of an item only the first player may choose. | |
| #define | MENU_ITEM_LOCKED 0x40 |
| The flag of an item that cannot be chosen, without a reason shown. | |
| #define | MENU_RESULT_CHOSEN 1 |
| #define | MENU_RESULT_CANCELLED 2 |
| #define | MENU_RESULT_UP 3 |
| #define | MENU_RESULT_DOWN 4 |
Typedefs | |
| typedef s32(* | MenuItemFilter) (s32 item) |
| A routine that tells whether a menu item may be chosen. | |
| typedef void(* | MenuPostDrawCallback) (s32 item) |
| A routine a menu screen calls after drawing, with the selected item. | |
| typedef void(* | MenuPreDrawCallback) (void) |
| A routine a menu screen calls in place of drawing its items. | |
Functions | |
| s32 | IsTrackUnlocked (s32 track) |
| Whether a track may be chosen: in the championship only the track of the next race, in time attack the loads and resets too, and otherwise an unlocked track. | |
| void | ValidateChampionshipProgress (void) |
| Reset the progress of the championship of the first player when its season, its round or its flags are out of range. | |
| void | TrackMenuPostDraw (s32 item) |
| Draw the hints of the track menu, and run the screen of the controller pak while it is shown, starting the championship or time attack once it is done. | |
| void | SeasonRecordsPreDrawCallback (void) |
| Draw the records of the season in place of the items of the track menu, and the cars of the season. | |
| void | DrawMenuSpotlight (void) |
| Draw the beam of the spotlight over the stage of a screen. | |
| void | DrawMenuChoiceMarker (void) |
| Draw the marker under the stage of a screen. | |
| void | DrawMenuFooterButtons (void) |
| Draw the buttons of the bottom of a screen: select and go back. | |
| void | DrawPauseMenuButtons (void) |
| Draw the buttons of the bottom of the pause menu: continue and exit. | |
| void | SetScreenPendingSelection (s32 item) |
| Move the cursor of the screen to an item on its next frame. | |
| s32 | ProcessScreenState (const char *title, s32 itemCount, MenuItem **items, s32 *selection, MenuItemFilter isSelectable, s32 topRed, s32 topGreen, s32 topBlue, s32 bottomRed, s32 bottomGreen, s32 bottomBlue) |
| Run one frame of a menu screen over a background gradient. | |
| void | LoadMenuItemModels (MenuItem **items, s32 *itemCount) |
| Blank the screen, count the items of a menu, and load their models, once for each cartridge range. | |
| void | ResetAndInitDisplay (MenuItem **items, s32 *itemCount) |
| Reset the heap and the callbacks of the menu screen, and load the models of its items. | |
Variables | |
| MenuPostDrawCallback | g_pfnScreenPostDrawCallback |
| The callback after the selected item is drawn, or NULL. | |
| MenuPreDrawCallback | g_pfnScreenPreDrawCallback |
| The callback that draws in place of the menu items, or NULL. | |
| s32 | g_dwMenuChoosingPlayer |
| The player whose press chose the last menu item. | |
| s32 | g_dwScreenPlayerIdx |
| The player a screen belongs to, such as the player whose car the paint shop paints or whose controller the controller screen sets up, or -1. | |
| s32 | g_dwMenuInputPlayerMask |
| A bit for each player whose input the menu screens read, or -1 for all. | |
| Texture * | g_pMenuTitleImage |
| The picture of the title of a menu screen, and its rectangle. | |
| s32 | g_dwMenuTitleImageX |
| The left edge of the menu title, in pixels. | |
| s32 | g_dwMenuTitleImageY |
| The top edge of the menu title, in pixels. | |
| s32 | g_dwMenuTitleImageWidth |
| The width of the menu title, in pixels. | |
| s32 | g_dwMenuTitleImageHeight |
| The height of the menu title, in pixels. | |
| f32 | g_fScreenIdleTimeout |
| The time without input after which a screen chooses for itself, or 0 for never, and the time without input so far. | |
| s32 | g_bScreenStateInitFlag |
| Whether ProcessScreenState() has set up its screen. | |
| s32 | g_nScreenCursor |
| The item under the cursor of the screen. | |
| s32 | g_nPrevScreenSelection |
| The item the cursor left. | |
| s32 | g_nScreenLastActiveIndex |
| The item under the cursor when the screen last ran. | |
| s32 | g_nScreenPendingSelection |
| An item to move the cursor to, or -1. | |
| f32 | g_fScreenSlideOffset |
| How far the items have still to slide, from 1 or -1 when the cursor moves to 0, and the angle of the model turning under the cursor. | |
| s32 | g_bScreenItemChosen |
| Whether the screen fades out because an item was chosen. | |
| s8 * | g_pScreenScrollSoundBuf |
| The sounds of moving the cursor and of choosing, and their lengths. | |
| Texture | g_ArrowLeftTextureDesc |
| The arrows of the buttons at the bottom of a screen. | |
| Texture | g_ArrowRightTextureDesc |
| The right arrow of the buttons at the bottom of a screen. | |
| Texture | g_BgTextureDesc |
| The gradient behind a screen. | |
| s32 | g_bMenuSpotlightBuilt |
| Whether the vertices of the beam of the spotlight over the stage are set; nothing sets it. | |
| Vtx | g_aMenuSpotlightVertices [31] |
| The vertices of the beam of the spotlight, its source first. | |
| Gfx | g_aMenuSpotlightDisplayList [] |
| The display list of the beam. | |
| Gfx | g_aMenuChoiceMarkerDisplayList [] |
| The display list of the marker drawn under the stage while there is another item to move to, and its matrix. | |
| s32 | g_dwTrackMenuItemCount |
| The number of items of the track menu. | |
| s32 | g_dwTrackMenuSelection |
| The item of the track menu under the cursor. | |
| s32 | g_bTrackMenuChampionship |
| Whether the track menu is of the championship; never read. | |
| s32 | g_dwTrackMenuInitState |
| Whether the track menu has set up, 1, has still to, 0, or has left for the next screen, -1. | |
| s32 | g_bTrackMenuPakScreen |
| Whether the track menu shows the screen of the controller pak. | |
| s32 | g_bSeasonFirstRace |
| Whether the next race of the season is its first after a load. | |
| s32 | g_dwContinueFromResults |
| Whether the track menu follows the results of a race. | |
| char | g_szTrackMenuTextBuf [] |
| The text of the track menu and of its records. | |
| VehicleModelLoad | g_aVehicleModelSlots [VEHICLE_MODEL_SLOTS] |
| The loads of the models of the cars the screens show: a slot for each player, and another for each that its next car loads into. | |
The menu screens: the generic screen that turns an item at a time, the track menu, the records of a season, and the models the screens draw.
| #define MENU_ITEM_ADJUSTABLE 0x01 |
The flag of an item whose up and down change it in place, as the results 3 and 4.
| #define MENU_ITEM_IMMEDIATE 0x02 |
The flag of an item chosen at once, without fading the screen out.
| #define MENU_ITEM_SPINNING 0x04 |
The flag of an item drawn as its model turning on the stage.
| #define MENU_ITEM_UNAVAILABLE 0x08 |
The flag of an item that cannot be chosen, whose screen explains why.
| #define MENU_ITEM_FIRST_PLAYER 0x20 |
The flag of an item only the first player may choose.
| #define MENU_ITEM_LOCKED 0x40 |
The flag of an item that cannot be chosen, without a reason shown.
| #define MENU_RESULT_CHOSEN 1 |
The player chose the item under the cursor.
| #define MENU_RESULT_CANCELLED 2 |
The player left the screen.
| #define MENU_RESULT_UP 3 |
The player moved up.
| #define MENU_RESULT_DOWN 4 |
The player moved down.
| typedef void(* MenuPostDrawCallback) (s32 item) |
A routine a menu screen calls after drawing, with the selected item.
| typedef void(* MenuPreDrawCallback) (void) |
A routine a menu screen calls in place of drawing its items.
Whether a track may be chosen: in the championship only the track of the next race, in time attack the loads and resets too, and otherwise an unlocked track.
| track | The index of the track, or of an item past the tracks. |
| void ValidateChampionshipProgress | ( | void | ) |
Reset the progress of the championship of the first player when its season, its round or its flags are out of range.
| void TrackMenuPostDraw | ( | s32 | item | ) |
Draw the hints of the track menu, and run the screen of the controller pak while it is shown, starting the championship or time attack once it is done.
| item | The item under the cursor. |
| void SeasonRecordsPreDrawCallback | ( | void | ) |
Draw the records of the season in place of the items of the track menu, and the cars of the season.
| void DrawMenuSpotlight | ( | void | ) |
Draw the beam of the spotlight over the stage of a screen.
| void DrawMenuChoiceMarker | ( | void | ) |
Draw the marker under the stage of a screen.
| void DrawMenuFooterButtons | ( | void | ) |
Draw the buttons of the bottom of a screen: select and go back.
| void DrawPauseMenuButtons | ( | void | ) |
Draw the buttons of the bottom of the pause menu: continue and exit.
| void SetScreenPendingSelection | ( | s32 | item | ) |
Move the cursor of the screen to an item on its next frame.
| item | The item. |
| s32 ProcessScreenState | ( | const char * | title, |
| s32 | itemCount, | ||
| MenuItem ** | items, | ||
| s32 * | selection, | ||
| MenuItemFilter | isSelectable, | ||
| s32 | topRed, | ||
| s32 | topGreen, | ||
| s32 | topBlue, | ||
| s32 | bottomRed, | ||
| s32 | bottomGreen, | ||
| s32 | bottomBlue ) |
Run one frame of a menu screen over a background gradient.
| title | The title of the screen. |
| itemCount | The number of items. |
| items | The items of the menu. |
| selection | The index of the item under the cursor, updated as the cursor moves. |
| isSelectable | Tells whether an item may be chosen, or NULL to allow every item. |
| topRed | The red component of the top of the gradient. |
| topGreen | The green component of the top of the gradient. |
| topBlue | The blue component of the top of the gradient. |
| bottomRed | The red component of the bottom of the gradient. |
| bottomGreen | The green component of the bottom of the gradient. |
| bottomBlue | The blue component of the bottom of the gradient. |
Blank the screen, count the items of a menu, and load their models, once for each cartridge range.
| items | The items of the menu, ended by a null pointer. |
| itemCount | Receives the number of items. |
Reset the heap and the callbacks of the menu screen, and load the models of its items.
| items | The items of the menu, ended by a null pointer. |
| itemCount | Receives the number of items. |
|
extern |
The callback after the selected item is drawn, or NULL.
|
extern |
The callback that draws in place of the menu items, or NULL.
|
extern |
The player whose press chose the last menu item.
|
extern |
The player a screen belongs to, such as the player whose car the paint shop paints or whose controller the controller screen sets up, or -1.
|
extern |
A bit for each player whose input the menu screens read, or -1 for all.
|
extern |
The picture of the title of a menu screen, and its rectangle.
|
extern |
The left edge of the menu title, in pixels.
|
extern |
The top edge of the menu title, in pixels.
|
extern |
The width of the menu title, in pixels.
|
extern |
The height of the menu title, in pixels.
|
extern |
The time without input after which a screen chooses for itself, or 0 for never, and the time without input so far.
|
extern |
Whether ProcessScreenState() has set up its screen.
|
extern |
The item under the cursor of the screen.
|
extern |
The item the cursor left.
|
extern |
The item under the cursor when the screen last ran.
|
extern |
An item to move the cursor to, or -1.
|
extern |
How far the items have still to slide, from 1 or -1 when the cursor moves to 0, and the angle of the model turning under the cursor.
|
extern |
Whether the screen fades out because an item was chosen.
|
extern |
The sounds of moving the cursor and of choosing, and their lengths.
|
extern |
The arrows of the buttons at the bottom of a screen.
|
extern |
The right arrow of the buttons at the bottom of a screen.
|
extern |
The gradient behind a screen.
|
extern |
Whether the vertices of the beam of the spotlight over the stage are set; nothing sets it.
|
extern |
The vertices of the beam of the spotlight, its source first.
|
extern |
The display list of the beam.
|
extern |
The display list of the marker drawn under the stage while there is another item to move to, and its matrix.
|
extern |
The number of items of the track menu.
|
extern |
The item of the track menu under the cursor.
|
extern |
Whether the track menu is of the championship; never read.
|
extern |
Whether the track menu has set up, 1, has still to, 0, or has left for the next screen, -1.
|
extern |
Whether the track menu shows the screen of the controller pak.
|
extern |
Whether the next race of the season is its first after a load.
|
extern |
Whether the track menu follows the results of a race.
|
extern |
The text of the track menu and of its records.
|
extern |
The loads of the models of the cars the screens show: a slot for each player, and another for each that its next car loads into.