Cleanup.
This commit is contained in:
+27
-32
@@ -8,11 +8,8 @@ class XNode;
|
|||||||
|
|
||||||
struct TapNoteResult
|
struct TapNoteResult
|
||||||
{
|
{
|
||||||
TapNoteResult()
|
TapNoteResult() : tns(TNS_None), fTapNoteOffset(0.f), bHidden(false) { }
|
||||||
{
|
|
||||||
tns = TNS_None;
|
|
||||||
fTapNoteOffset = 0;
|
|
||||||
}
|
|
||||||
TapNoteScore tns;
|
TapNoteScore tns;
|
||||||
|
|
||||||
/* Offset, in seconds, for a tap grade. Negative numbers mean the note
|
/* Offset, in seconds, for a tap grade. Negative numbers mean the note
|
||||||
@@ -30,6 +27,9 @@ struct TapNoteResult
|
|||||||
|
|
||||||
struct HoldNoteResult
|
struct HoldNoteResult
|
||||||
{
|
{
|
||||||
|
HoldNoteResult() : hns(HNS_None), fLife(1.f), iLastHeldRow(0), bHeld(false), bActive(false) { }
|
||||||
|
float GetLastHeldBeat() const;
|
||||||
|
|
||||||
HoldNoteScore hns;
|
HoldNoteScore hns;
|
||||||
|
|
||||||
/* 1.0 means this HoldNote has full life.
|
/* 1.0 means this HoldNote has full life.
|
||||||
@@ -41,17 +41,6 @@ struct HoldNoteResult
|
|||||||
/* Last index where fLife was greater than 0. If the tap was missed, this will
|
/* Last index where fLife was greater than 0. If the tap was missed, this will
|
||||||
* be the first index of the hold. */
|
* be the first index of the hold. */
|
||||||
int iLastHeldRow;
|
int iLastHeldRow;
|
||||||
|
|
||||||
HoldNoteResult()
|
|
||||||
{
|
|
||||||
hns = HNS_None;
|
|
||||||
fLife = 1.0f;
|
|
||||||
iLastHeldRow = 0;
|
|
||||||
bHeld = bActive = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
float GetLastHeldBeat() const;
|
|
||||||
|
|
||||||
bool bHeld;
|
bool bHeld;
|
||||||
bool bActive;
|
bool bActive;
|
||||||
|
|
||||||
@@ -72,13 +61,13 @@ struct TapNote
|
|||||||
mine, // don't step!
|
mine, // don't step!
|
||||||
attack,
|
attack,
|
||||||
autoKeysound,
|
autoKeysound,
|
||||||
} type;
|
};
|
||||||
enum SubType
|
enum SubType
|
||||||
{
|
{
|
||||||
hold_head_hold,
|
hold_head_hold,
|
||||||
hold_head_roll,
|
hold_head_roll,
|
||||||
SubType_invalid
|
SubType_invalid
|
||||||
} subType; // only used if type == hold_head
|
};
|
||||||
enum Source
|
enum Source
|
||||||
{
|
{
|
||||||
original, // part of the original NoteData
|
original, // part of the original NoteData
|
||||||
@@ -88,37 +77,43 @@ struct TapNote
|
|||||||
// step. Also used for when we implement auto-scratch,
|
// step. Also used for when we implement auto-scratch,
|
||||||
// and for if/when we do a "reduce" modifier that cancels out
|
// and for if/when we do a "reduce" modifier that cancels out
|
||||||
// all but N keys on a line [useful for beat->dance autogen, too].
|
// all but N keys on a line [useful for beat->dance autogen, too].
|
||||||
|
|
||||||
|
/* XXX: this makes no sense. If we've replaced the hold with a tap then we
|
||||||
|
* cannot have a removed hold here. Is it supposed to be that if you have
|
||||||
|
* a positive duration then you just draw the tap? If so, a new source type
|
||||||
|
* should be created rather than overloading removed. */
|
||||||
|
|
||||||
// Removed hold body (...why?) - acts as follows:
|
// Removed hold body (...why?) - acts as follows:
|
||||||
// 1 - if we're using a sustained-sound gametype [Keyboardmania], and
|
// 1 - if we're using a sustained-sound gametype [Keyboardmania], and
|
||||||
// we've already hit the start of the sound (?? we put Holds Off on?)
|
// we've already hit the start of the sound (?? we put Holds Off on?)
|
||||||
// then this is triggered automatically to keep the sound going
|
// then this is triggered automatically to keep the sound going
|
||||||
// 2 - if we're NOT [anything else], we ignore this.
|
// 2 - if we're NOT [anything else], we ignore this.
|
||||||
// Equivalent to all 4s aside from the first one.
|
// Equivalent to all 4s aside from the first one.
|
||||||
} source;
|
};
|
||||||
|
|
||||||
// Only valid if type == attack.
|
Type type;
|
||||||
|
SubType subType; // Only used if type is hold_head.
|
||||||
|
Source source;
|
||||||
|
TapNoteResult result;
|
||||||
|
PlayerNumber pn;
|
||||||
|
|
||||||
|
// attack only
|
||||||
RString sAttackModifiers;
|
RString sAttackModifiers;
|
||||||
float fAttackDurationSeconds;
|
float fAttackDurationSeconds;
|
||||||
|
|
||||||
int iKeysoundIndex; // index into Song's vector of keysound files.
|
// Index into Song's vector of keysound files if nonnegative.
|
||||||
// Only valid if nonnegative.
|
int iKeysoundIndex;
|
||||||
|
|
||||||
/* hold_head only: */
|
// hold_head only
|
||||||
int iDuration;
|
int iDuration;
|
||||||
|
|
||||||
TapNoteResult result;
|
|
||||||
|
|
||||||
/* hold_head only: */
|
|
||||||
HoldNoteResult HoldResult;
|
HoldNoteResult HoldResult;
|
||||||
|
|
||||||
PlayerNumber pn;
|
|
||||||
|
|
||||||
// XML
|
// XML
|
||||||
XNode* CreateNode() const;
|
XNode* CreateNode() const;
|
||||||
void LoadFromNode( const XNode* pNode );
|
void LoadFromNode( const XNode* pNode );
|
||||||
|
|
||||||
TapNote() : type(empty), subType(SubType_invalid), source(original), fAttackDurationSeconds(0.f),
|
TapNote() : type(empty), subType(SubType_invalid), source(original), pn(PLAYER_INVALID),
|
||||||
iKeysoundIndex(-1), iDuration(0), pn(PLAYER_INVALID) { }
|
fAttackDurationSeconds(0.f), iKeysoundIndex(-1), iDuration(0) { }
|
||||||
TapNote(
|
TapNote(
|
||||||
Type type_,
|
Type type_,
|
||||||
SubType subType_,
|
SubType subType_,
|
||||||
@@ -138,7 +133,7 @@ struct TapNote
|
|||||||
}
|
}
|
||||||
bool operator==( const TapNote &other ) const
|
bool operator==( const TapNote &other ) const
|
||||||
{
|
{
|
||||||
#define COMPARE(x) if(x!=other.x) return false;
|
#define COMPARE(x) if(x!=other.x) return false
|
||||||
COMPARE(type);
|
COMPARE(type);
|
||||||
COMPARE(subType);
|
COMPARE(subType);
|
||||||
COMPARE(source);
|
COMPARE(source);
|
||||||
|
|||||||
Reference in New Issue
Block a user