|
resonance 1.0.1
|
Traversal order over one playable sequence. More...
#include <playmap.h>

Public Member Functions | |
| void * | operator new (size_t nSize) |
| Allocate a map from the tagged heap under the tag PlayMap. | |
| void | operator delete (void *pBlock) |
| Release a map to the tagged heap under the tag PlayMap. | |
| PlayMap () | |
| Construct an empty map whose first step is at zero. | |
| virtual | ~PlayMap () |
| Inline. | |
| virtual void | AddStep (int nPosition, HxStr strLabel) |
| Slot 2. | |
| virtual void | SetBarCount (int nBarCount) |
| Slot 3. | |
| virtual void | ResetSpans () |
| Slot 4. | |
| virtual int | MapBar (int nBar)=0 |
| Slot 5. | |
| virtual std::vector< int > & | FindBarsPlaying (int nStart, int nMin, int nEnd)=0 |
| Slot 6. | |
| virtual int | MapToLinkedStep (int nPosition, int nSet) |
| Slot 7. | |
| virtual int | GetLength () const |
| Slot 8. | |
| virtual int | GetEndBar () |
| Slot 9. | |
| virtual int | GetNumSections () const |
| Slot 10. | |
| virtual int | GetPatternSection (int nIndex) |
| Slot 11. | |
| virtual int | GetPatternIndex (int nBar) |
| Slot 12. | |
| virtual int | GetAbsoluteSectionIndex (int nBar) |
| Slot 13. | |
| virtual int | IsLooping (int nBar) |
| Slot 14. | |
| virtual void | CloseSpan (int nRepeats) |
| Slot 15. | |
| virtual int | EndLoop (int nBar) |
| Slot 16. | |
| virtual int | StartLoop (int nBar) |
| Slot 17. | |
| virtual int | ToggleLoop (int nBar) |
| Slot 18. | |
| int | FindStepIndex (int nPosition) |
| Report the index of the step at or before a position that has already been mapped. | |
| int | IsStepStart (int nBar) |
| Report whether a bar maps exactly onto a step. | |
| int | StepStartBar (int nBar) |
| Report the bar at which the step containing a bar began. | |
| int | NextStepBar (int nBar) |
| Report the bar at which the first step at or after a bar begins. | |
| int | FollowingStepBar (int nBar) |
| Report the bar at which the first step strictly after a bar begins. | |
Public Attributes | |
| int | mBarCount |
| The number of bars SetBarCount() stores. | |
| std::vector< int > | mSteps |
| Ascending sequence of positions. | |
| std::vector< int > | mSectionLengths |
| Length of each section, the gap between one step and the previous one. | |
| std::vector< HxStr > | mSectionNames |
| Label of each section, the one AddStep() receives with the step. | |
Protected Attributes | |
| int | mUnusedValue |
| std::vector< int > | mFoundBars |
Traversal order over one playable sequence.
PlayMap in the RTTI descriptor at 0x0086f5b0, a leaf with no base list. The class is abstract: no data reference to its type function exists anywhere in the image, so no vtable carries it at slot 0 and the class is never instantiated. Three subclasses derive from it, PlayMapLinear, PlayMapRing, and PlayMapRepeatRing, which is what the two pure slots below are for.
The table runs to nineteen entries, slots 0 through 18, and terminates on the all-zero entry after them. This class implements every slot except 5 and 6, which are the only two pointing at the shared pure-virtual stub. Most of what it does implement is inert, one slot being a bare return and four returning zero, so the base reads as an interface with defaults rather than as shared behaviour.
The subclasses fill those two and then extend the table rather than overriding past its end: PlayMapRing adds nothing and keeps nineteen entries, PlayMapRepeatRing adds one for twenty, and PlayMapLinear adds two for twenty-one. None of the three retains a slot pointing at the pure-virtual stub. All three are concrete.
The object is 0x3c bytes with the vptr at +0x38. A leaf class with no base places its vptr after its data members under this toolchain, which is why the pointer is last rather than first. Its four vectors are recovered from the destructor at 0x00127158, which tears them down at +0x2c, +0x1c, +0x10, and +0x04 and so fixes their declaration order as the reverse. Element widths come from the shift each teardown uses to divide the byte span.
The destructor body is empty. Everything the compiled destructor performs is the implicit teardown of those four members, and the release of the object itself sits behind the deleting flag this toolchain passes as a second argument. The declaration is real rather than implicit, because a leaf class with no base acquires a virtual destructor only when one is declared virtual.
The class declares its own allocation pair. The release path of the destructor calls the tagged free with the literal PlayMap at 0x007d0dd0, and a tag names the class that declares the operator.
Each slot below records its table index. The index is part of the class layout, and the method titles are inferred from the bodies of the base and the three subclasses and from their callers.
| PlayMap::PlayMap | ( | ) |
Construct an empty map whose first step is at zero.
Reserves eight elements in mSteps and appends the zero step, then reserves eight in mSectionLengths. Every subclass constructor runs it first.
|
inlinevirtual |
Inline.
PlayMapLinear's destructor expands it, and the address is the out-of-line copy the unit emits for the table.
| void * PlayMap::operator new | ( | size_t | nSize | ) |
Allocate a map from the tagged heap under the tag PlayMap.
Unlike most classes in this tree the operator has an out-of-line body, which forwards the size the compiler supplies and the tag literal to the tagged allocator.
| nSize | The object size the compiler supplies. |
| void PlayMap::operator delete | ( | void * | pBlock | ) |
Release a map to the tagged heap under the tag PlayMap.
| pBlock | The block. |
|
virtual |
Slot 2.
Appends one step, its distance from the previous step, and a label.
The body appends nPosition - mSteps.back() to mSectionLengths, then nPosition to mSteps, then the label to mSectionNames. mSectionLengths therefore stores the gap between consecutive steps and is one element behind mSteps until this call completes. Reading mSteps.back() is unconditional, and the first call requires a step to already be present.
The second parameter is passed by value. The body copy-constructs it into mSectionNames through HxStr::HxStr(const HxStr &) at 0x004b7b50 and then releases the parameter's own buffer, which is this toolchain destroying a by-value class parameter in the callee.
| nPosition | The step position. |
| strLabel | The label, passed by value. |
|
virtual |
Slot 3.
Stores its argument in mBarCount and does nothing else.
| nBarCount | The value to store. |
Reimplemented in PlayMapRepeatRing.
|
virtual |
Slot 4.
Empty in this class. PlayMapRepeatRing resets its spans here.
Reimplemented in PlayMapRepeatRing.
|
pure virtual |
Slot 5.
Maps a bar to its position in the sequence, pure here and overridden by every subclass.
The signature is recovered from both sides. GetPatternIndex() and GetAbsoluteSectionIndex() forward their own argument without touching a1 and then consume the result in v0, and each override reads that argument and returns a value. PlayMapRing at 0x0012e408 returns (nBar + mBarCount) % mSteps.back(), the wrap its name implies.
GetPatternIndex() and GetAbsoluteSectionIndex() take the delta for this dispatch into a0 rather than a1. Using a0 preserves the forwarded argument and is the reason the argument is recoverable at all.
| nBar | The bar to map. |
Implemented in PlayMapLinear, PlayMapRepeatRing, and PlayMapRing.
|
pure virtual |
Slot 6.
Collects the bars that play one position into mFoundBars, pure here.
The signature comes from PlayMapRing at 0x0012dad8. The override clears mFoundBars, walks a value from the first argument upward in steps of mSteps.back() while it remains below the third, appends every value not below the second, and returns the vector itself. The return is the address of the member, which is a reference in the original.
| nStart | The first position. |
| nMin | The lowest position to collect. |
| nEnd | The position to stop below. |
Implemented in PlayMapLinear, PlayMapRepeatRing, and PlayMapRing.
|
virtual |
Slot 7.
Returns its first argument unchanged.
PlayMapLinear moves the position to the step linked with its own in a step ring. The second parameter is proven by PlayMapLinear::MapToLinkedStep() indexing its per-set table with it, and by PhraseMgr's routine at 0x001c0298 passing its track there.
| nPosition | The position to map. |
| nSet | The set PlayMapLinear selects its table with. Not read here. |
Reimplemented in PlayMapLinear.
|
virtual |
Slot 8.
Returns the last element of mSteps, the end of the positions the map has set out.
Reimplemented in PlayMapLinear, and PlayMapRing.
|
virtual |
Slot 9.
Forwards to GetLength() through the table rather than calling it directly.
Callers read the result as the last bar of the level.
Reimplemented in PlayMapLinear.
|
virtual |
Slot 10.
Returns the number of sections, one less than the number of elements in mSteps.
Reimplemented in PlayMapLinear.
|
virtual |
Slot 11.
Returns its argument unchanged.
PlayMapLinear returns the section its recorded pattern plays at the index.
| nIndex | The index into the pattern. |
Reimplemented in PlayMapLinear.
|
virtual |
Slot 12.
Reports the index of the step at or before the position MapBar() returns.
The body forwards its argument to MapBar() through the table, searches mSteps for the value that returns with an upper bound, and reports the distance from the start to the element before the result. MapBar() is pure here. The search key comes from whichever subclass is running.
| nBar | The bar to map through MapBar(). |
Reimplemented in PlayMapLinear.
|
virtual |
Slot 13.
Reports the same step index with a multiple of the last step folded in.
The body performs the search GetPatternIndex() performs, forwarding the same argument to MapBar(), and then adds nTotal * (nBar - nBar % nTotal) to the index, where nTotal is mSteps.back(). Multiplying by nTotal after rounding nBar down to a multiple of nTotal scales the term by nTotal twice. The doubling reads as an error, but the binary computes it.
| nBar | The bar to map through MapBar() and to fold in. |
Reimplemented in PlayMapLinear.
|
virtual |
Slot 14.
Returns zero, ignoring its argument.
The parameter is proven by HudPosition's update at 0x0041b060, which passes the current bar in a1, and by PlayMapLinear::IsLooping, an override that reads it.
| nBar | The bar. |
Reimplemented in PlayMapLinear.
|
virtual |
Slot 15.
Empty in this class, and it takes an argument the empty body cannot reveal.
The body is jr ra and reads no argument register, which is no evidence about the parameter list. PlayMapRepeatRing's override at 0x0012bc48 multiplies a1 by a step gap before storing the result, so the member takes an int.
| nRepeats | The multiplier the override applies to a step gap. |
Reimplemented in PlayMapRepeatRing.
|
virtual |
Slot 16.
Returns zero, ignoring its argument.
PlayMapLinear's override at 0x00128ed8 passes a1 to the routine at 0x00129150, which is what proves the bar parameter. Gamer calls it with the current bar.
| nBar | The bar. |
Reimplemented in PlayMapLinear, and PlayMapRepeatRing.
|
virtual |
Slot 17.
Returns zero, ignoring its argument.
PlayMapRepeatRing's override at 0x0012bdd8 stores a1 as the search key it passes to the routine at 0x00105de8.
| nBar | The bar. |
Reimplemented in PlayMapLinear, and PlayMapRepeatRing.
|
virtual |
Slot 18.
Returns zero, ignoring its argument.
Both overrides forward a1 to EndLoop() and StartLoop().
| nBar | The bar. |
Reimplemented in PlayMapLinear, and PlayMapRepeatRing.
| int PlayMap::FindStepIndex | ( | int | nPosition | ) |
Report the index of the step at or before a position that has already been mapped.
GetPatternIndex() performs the same search on the result of MapBar(). This routine receives the mapped position directly. PhraseDatabase::GetStepValue() is the recovered caller.
| nPosition | The mapped position. |
| int PlayMap::IsStepStart | ( | int | nBar | ) |
Report whether a bar maps exactly onto a step.
| nBar | The bar. |
| int PlayMap::StepStartBar | ( | int | nBar | ) |
Report the bar at which the step containing a bar began.
| nBar | The bar. |
| int PlayMap::NextStepBar | ( | int | nBar | ) |
Report the bar at which the first step at or after a bar begins.
| nBar | The bar. |
| int PlayMap::FollowingStepBar | ( | int | nBar | ) |
Report the bar at which the first step strictly after a bar begins.
| nBar | The bar. |
| int PlayMap::mBarCount |
The number of bars SetBarCount() stores.
Public because BGTrackGraph::BuildSequencer() reads it directly at 0x0013fc7c as the bound of its walk over the track's bars, and the image has no accessor. PlayMapRing adds it to a position as the offset its ring starts at. +0x00
| std::vector<int> PlayMap::mSteps |
Ascending sequence of positions.
GetLength(), GetNumSections(), GetPatternIndex(), and GetAbsoluteSectionIndex() read the last element, the count, and an upper bound over this vector, and AddStep() appends to it. The element type is int, from the four-byte stride of every access. Public because the PhraseDatabase constructor at 0x001b72d8 reads its last element and its count directly and the image exposes no accessor. A friend declaration fits the image equally well. +0x04
| std::vector<int> PlayMap::mSectionLengths |
Length of each section, the gap between one step and the previous one.
+0x10
AddStep() appends to it. Public because HudPosition's constructor at 0x00419f88 reads it directly, indexed by GetPatternSection(), to size each section of the position display, and the image has no accessor for it.
| std::vector<HxStr> PlayMap::mSectionNames |
Label of each section, the one AddStep() receives with the step.
+0x1c
Public because HudPosition's constructor reads it directly, indexed by GetPatternSection(), for the section labels of the position display, and the image has no accessor for it.
|
protected |
|
protected |