resonance 1.0.1
Loading...
Searching...
No Matches
ScrollingList Class Reference

Scrolling list of rows driven by a ListDataProvider. More...

#include <scrollinglist.h>

Public Member Functions

 ScrollingList (ListDataProvider *pProvider, int nRowPitch, int nRowCount, Rnd::View *pTemplate, Rnd::Mesh *pHighlight, Rnd::Mesh *pUpArrow, Rnd::Mesh *pDownArrow, int nContext)
 Build the rows from the template view.
virtual ~ScrollingList ()
 Delete every row clone together with every object it references.
void refresh ()
 Show the rows that have an item and fill their cells, and hide the rest.
void scrollUp ()
 Move the selection up by one item.
void scrollDown ()
 Move the selection down by one item.
void setItemCount (int nItemCount)
 Record the number of items and clamp the selection to it.
int getSelected ()
 Report the selected item.
void setSelected (int nSelected)
 Select one item and place the cursor row so the page ends at the last item where it can.
void setShowing (int nShowing)
 Record the showing flag and pass it to the highlight mesh.
void setEntriesShowing (int nShowing)
 Pass a showing flag to every Text cell.

Detailed Description

Scrolling list of rows driven by a ListDataProvider.

Its RTTI descriptor is at 0x0086f6a0. It is a leaf class with no base. The class name is the RTTI spelling verbatim. No method name and no member name is attested anywhere in the image. Every name below is inferred from the routine's behaviour.

Following the g++ 2.x layout for a class with no base, the vptr sits after the data members at +0x94, and the object is 0xa0 bytes, which the operator new argument at each call site confirms. The two-entry vtable at 0x00815a20 runs the compiler-generated GetTypeInfo at 0x00400e88 and the destructor at 0x003fd380, so the destructor is the one virtual the class declares.

The list clones a template row view once per visible row, spacing the clones mRowPitch apart along z, and names each clone v_NN_ followed by the template's name. Each clone's Text and Mesh children become its cells. refresh() hands every cell of a visible row to the provider, a highlight mesh follows the cursor row, and two arrow meshes show whether items lie above or below the visible page.

MetFreqMakerDirectionsScreen, MetJukeboxBaseScreen, MetMCFreqDelScreen, MetRemixDelScreen, and MetRemixLoadScreen all drive one.

The rest of the translation unit is library code and is not declared. 0x004009b8 is the vector insert that appends a Cell, 0x00400500 and 0x00400928 are std::list<Rnd::Object *> sort and unique (shared with Rnd::Manager), 0x004003a0 is the merge that sort uses, 0x00400060 and 0x00400c60 are unreferenced vector insert emissions, and 0x004013d0 is the allocator's out-of-memory retry loop.

Constructor & Destructor Documentation

◆ ScrollingList()

ScrollingList::ScrollingList ( ListDataProvider * pProvider,
int nRowPitch,
int nRowCount,
Rnd::View * pTemplate,
Rnd::Mesh * pHighlight,
Rnd::Mesh * pUpArrow,
Rnd::Mesh * pDownArrow,
int nContext )

Build the rows from the template view.

The body runs with no memory zone selected and restores the caller's zone at the end. It shows every child of the template, clones one row per visible row, hides the template, and records the highlight mesh's local transform as the position of the first row. The item count starts at zero.

Parameters
pProviderThe provider the cells are filled from.
nRowPitchThe distance between two rows along z.
nRowCountThe number of visible rows.
pTemplateThe row view each row is cloned from.
pHighlightThe mesh that marks the cursor row, or null.
pUpArrowThe mesh shown while items lie above the page, or null.
pDownArrowThe mesh shown while items lie below the page, or null.
nContextThe value passed through to the provider. It is the one argument on the stack.
Ghidra address:
NTSC-U/C: 0x003fcb00
Ghidra address:
PAL: 0x00435518

◆ ~ScrollingList()

virtual ScrollingList::~ScrollingList ( )
virtual

Delete every row clone together with every object it references.

The highlight first returns to the first row. For each row the body resolves the clone by name, gathers its animation, collision, draw, and transform descendants, removes duplicates, and deletes each one and then the clone itself.

Ghidra address:
NTSC-U/C: 0x003fd380
Ghidra address:
PAL: 0x00435d98

Member Function Documentation

◆ refresh()

void ScrollingList::refresh ( )

Show the rows that have an item and fill their cells, and hide the rest.

The first visible item is the selection less the cursor row. Each cell goes to ListDataProvider::ProvideMesh() when it is a Mesh and to ListDataProvider::ProvideText() otherwise. The arrows are updated last.

Ghidra address:
NTSC-U/C: 0x003fdd18
Ghidra address:
PAL: 0x004367a0

◆ scrollUp()

void ScrollingList::scrollUp ( )

Move the selection up by one item.

An empty list hides the highlight and does nothing else. Otherwise the highlight takes the low bit of mShowing, the selection and the cursor row each step up when they can, and the highlight and the rows are refreshed.

Ghidra address:
NTSC-U/C: 0x00400ec8
Ghidra address:
PAL: 0x00439998

◆ scrollDown()

void ScrollingList::scrollDown ( )

Move the selection down by one item.

The body mirrors scrollUp() with two differences. The highlight is not tested for null, and it is shown unconditionally rather than with the low bit of mShowing.

Ghidra address:
NTSC-U/C: 0x00400f78
Ghidra address:
PAL: 0x00439a48

◆ setItemCount()

void ScrollingList::setItemCount ( int nItemCount)

Record the number of items and clamp the selection to it.

A count that is not positive hides the highlight and does nothing else. Otherwise the highlight takes the low bit of mShowing, and the highlight is moved. The rows are not refreshed.

Parameters
nItemCountThe number of items.
Ghidra address:
NTSC-U/C: 0x00401088
Ghidra address:
PAL: 0x00439b58

◆ getSelected()

int ScrollingList::getSelected ( )

Report the selected item.

Returns
The index of the selected item.
Ghidra address:
NTSC-U/C: 0x00401160
Ghidra address:
PAL: 0x00439c30

◆ setSelected()

void ScrollingList::setSelected ( int nSelected)

Select one item and place the cursor row so the page ends at the last item where it can.

An empty list resets the selection and the cursor row to zero instead. The highlight is moved in both cases. The rows are not refreshed.

Parameters
nSelectedThe index of the item to select.
Ghidra address:
NTSC-U/C: 0x00401168
Ghidra address:
PAL: 0x00439c38

◆ setShowing()

void ScrollingList::setShowing ( int nShowing)

Record the showing flag and pass it to the highlight mesh.

The highlight receives zero while the list is empty, and the low bit of nShowing otherwise. A null highlight is skipped.

Parameters
nShowingNon-zero to draw the list.
Ghidra address:
NTSC-U/C: 0x00401300
Ghidra address:
PAL: 0x00439dd0

◆ setEntriesShowing()

void ScrollingList::setEntriesShowing ( int nShowing)

Pass a showing flag to every Text cell.

The flag is forwarded unchanged and, unlike setShowing(), neither masked nor tested against the item count.

Parameters
nShowingNon-zero to draw each cell.
Ghidra address:
NTSC-U/C: 0x00401360
Ghidra address:
PAL: 0x00439e30

The documentation for this class was generated from the following file: