Parse and maintain keysound data, but don't play the keysounds yet.

This commit is contained in:
Chris Danford
2004-09-29 07:19:44 +00:00
parent 0f6ed81faf
commit b20eaeb60b
9 changed files with 193 additions and 58 deletions
+24 -6
View File
@@ -29,24 +29,42 @@ struct TapNote
// Equivalent to all 4s aside from the first one.
};
unsigned source : 2; // only valid if type!=empty
unsigned attackIndex : 3; // attack index
// bit field sizes should add to 8 bits.
void Set( Type type_, Source source_, unsigned attackIndex_ )
bool bAttack : 1; // true if this note causes an attack when hit
bool bKeysound : 1; // true if this note plays a keysound when hit
// CAREFUL: small fields grouped together for alignment.
uint8_t attackIndex; // index into NoteData's vector of attacks
// Only valid if bAttack.
uint16_t keysoundIndex; // index into Song's vector of keysound files.
// Only valid if bKeysound.
// Some songs have > 256 keysounds.
void Set(
Type type_,
Source source_,
bool bAttack_,
unsigned attackIndex_,
bool bKeysound_,
unsigned keysoundIndex_ )
{
type = type_;
source = source_;
bAttack = bAttack_;
attackIndex = attackIndex_;
bKeysound = bKeysound_;
keysoundIndex = keysoundIndex_;
}
bool operator==( const TapNote &other )
{
#define COMPARE(x) if(x!=other.x) return false;
COMPARE(type);
COMPARE(source);
// COMPARE(bAttack);
// COMPARE(bKeysound);
COMPARE(bAttack);
COMPARE(bKeysound);
COMPARE(attackIndex);
// COMPARE(keysoundIndex);
COMPARE(keysoundIndex);
#undef COMPARE
return true;
}