-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* beatmatch/tickedinfo stuff * refactor foreachobjref macro * songdata retail syms * songdata stuff * fix rangeddata class * songdata and esp rangeddata work * more rangeddata stuff * more rangeddata crap * finish up songdata rangeddata usage * songdata far enough along to document * songdata doc * link submix * link timespanvector * slotchannelmapping has linkissues * link fillinfo * try to doc fillinfo and songdata * rename rangeddata funcs * fillinfo doc * rangeddata doc * songdata context
- Loading branch information
Showing
45 changed files
with
1,918 additions
and
467 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "beatmatch/DrumMap.h" | ||
|
||
DrumMap::DrumMap() : mCurrentLanes(0) { | ||
mLanes.AddInfo(0, 0); | ||
} | ||
|
||
bool DrumMap::LaneOn(int tick, int i2){ | ||
int mask = 1 << i2; | ||
if(mCurrentLanes & mask) return false; | ||
else { | ||
UpdateLanes(tick, mCurrentLanes | mask); | ||
return true; | ||
} | ||
} | ||
|
||
bool DrumMap::LaneOff(int tick, int i2){ | ||
int mask = 1 << i2; | ||
if(!(mCurrentLanes & mask)) return false; | ||
else { | ||
UpdateLanes(tick, mCurrentLanes & ~mask); | ||
return true; | ||
} | ||
} | ||
|
||
void DrumMap::UpdateLanes(int tick, int newLaneMask){ | ||
mCurrentLanes = newLaneMask; | ||
if(!mLanes.mInfos.empty() && tick == mLanes.mInfos.back().mTick){ | ||
mLanes.mInfos.back().mInfo = newLaneMask; | ||
} | ||
else mLanes.AddInfo(tick, newLaneMask); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#pragma once | ||
#include "beatmatch/FillInfo.h" | ||
|
||
class DrumFillInfo : public FillInfo { | ||
public: | ||
DrumFillInfo(){} | ||
virtual ~DrumFillInfo(){} | ||
}; | ||
|
||
class DrumMap : public DrumFillInfo { | ||
public: | ||
DrumMap(); | ||
virtual ~DrumMap(){} | ||
|
||
void Clear(){ FillInfo::Clear(); } | ||
bool LaneOn(int, int); | ||
bool LaneOff(int, int); | ||
void UpdateLanes(int, int); | ||
|
||
int mCurrentLanes; // 0x14 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include "beatmatch/DrumMixDB.h" | ||
#include "macros.h" | ||
#include "os/Debug.h" | ||
|
||
DrumMixDB::DrumMixDB(int num_mixes){ | ||
mMixLists.reserve(num_mixes); | ||
for(int i = 0; i < num_mixes; i++){ | ||
mMixLists.push_back(new TickedInfoCollection<String>()); | ||
} | ||
} | ||
|
||
DrumMixDB::~DrumMixDB(){ | ||
for(int i = 0; i < mMixLists.size(); i++){ | ||
RELEASE(mMixLists[i]); | ||
} | ||
} | ||
|
||
void DrumMixDB::Clear(){ | ||
for(int i = 0; i < mMixLists.size(); i++){ | ||
mMixLists[i]->Clear(); | ||
} | ||
} | ||
|
||
bool DrumMixDB::AddMix(int diff, int tick, const char* str){ | ||
MILO_ASSERT_RANGE(diff, 0, mMixLists.size(), 0x2D); | ||
return mMixLists[diff]->AddInfo(tick, str); | ||
} | ||
|
||
TickedInfoCollection<String>& DrumMixDB::GetMixList(int diff){ | ||
MILO_ASSERT_RANGE(diff, 0, mMixLists.size(), 0x39); | ||
return *mMixLists[diff]; | ||
} | ||
|
||
DrumMixDB* DrumMixDB::Duplicate() const { | ||
DrumMixDB* db = new DrumMixDB(mMixLists.size()); | ||
for(int i = 0; i < mMixLists.size(); i++){ | ||
*db->mMixLists[i] = *mMixLists[i]; | ||
} | ||
return db; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#pragma once | ||
#include <vector> | ||
#include "utl/Str.h" | ||
#include "utl/TickedInfo.h" | ||
|
||
class DrumMixDB { | ||
public: | ||
DrumMixDB(int); | ||
~DrumMixDB(); | ||
void Clear(); | ||
bool AddMix(int, int, const char*); | ||
TickedInfoCollection<String>& GetMixList(int); | ||
DrumMixDB* Duplicate() const; | ||
|
||
std::vector<TickedInfoCollection<String>*> mMixLists; // 0x0 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,73 @@ | ||
#ifndef BEATMATCH_FILLINFO_H | ||
#define BEATMATCH_FILLINFO_H | ||
#pragma once | ||
#include "utl/TickedInfo.h" | ||
#include <vector> | ||
|
||
/** Info for a single fill. */ | ||
struct FillExtent { | ||
FillExtent(int s, int e, bool b) : start(s), end(e), bre(b) {} | ||
int start; | ||
int end; | ||
bool bre; | ||
bool CheckBounds(int tick) const { | ||
return tick >= start && tick <= end; | ||
} | ||
/** The starting tick. */ | ||
int start; // 0x0 | ||
/** The ending tick. */ | ||
int end; // 0x4 | ||
/** Is this fill for a BRE? */ | ||
bool bre; // 0x8 | ||
}; | ||
|
||
/** A general collection of fill information. */ | ||
class FillInfo { | ||
public: | ||
FillInfo(){} | ||
virtual ~FillInfo(){} | ||
|
||
/** Completely empty the lane and fill collections. */ | ||
void Clear(); | ||
bool AddFill(int, int, bool); | ||
bool FillAt(int, bool) const; | ||
bool AddLanes(int, int); | ||
bool NextFillExtents(int, FillExtent&) const; | ||
bool FillExtentAtOrBefore(int, FillExtent&) const; | ||
int LanesAt(int) const; | ||
/** Add a fill to our fill collection. | ||
* @param [in] start The start tick of this fill. | ||
* @param [in] duration How long in ticks this fill should last. | ||
* @param [in] bre Is this fill for a BRE? | ||
* @returns True if the fill was successfully added, false if not. | ||
*/ | ||
bool AddFill(int start, int duration, bool bre); | ||
/** Checks if a fill exists at the given tick. | ||
* @param [in] tick The tick to check. | ||
* @param [in] include_end TODO: unknown | ||
* @returns True if a fill exists at the given tick, false if not. | ||
*/ | ||
bool FillAt(int tick, bool include_end) const; | ||
/** Add a new TickedInfo entry for the supplied lanes. | ||
* @param [in] tick The tick the lanes occur at. | ||
* @param [in] lanes The lanes. | ||
* @returns True if the lanes were successfully added, false if not. | ||
*/ | ||
bool AddLanes(int tick, int lanes); | ||
/** Get the next coming FillExtent relative to the supplied tick. | ||
* @param [in] tick The tick to check. | ||
* @param [out] outExtent The next FillExtent coming after this tick. | ||
* @returns True if a FillExtent exists after the supplied tick, false if not. | ||
*/ | ||
bool NextFillExtents(int tick, FillExtent& outExtent) const; | ||
/** Get the FillExtent either at or before the supplied tick. | ||
* @param [in] tick The tick to check. | ||
* @param [out] outExtent The FillExtent at or before this tick. | ||
* @returns True if a FillExtent exists at or before the supplied tick, false if not. | ||
*/ | ||
bool FillExtentAtOrBefore(int tick, FillExtent& outExtent) const; | ||
/** Get the lanes associated with the supplied tick. | ||
* @param [in] tick The tick to check. | ||
* @returns The lanes associated with the tick. | ||
*/ | ||
int LanesAt(int tick) const; | ||
/** Checks if a fill exists at the given tick, and if so, write its tick range to outExtent. | ||
* @param [in] tick The tick to check. | ||
* @param [out] outExtent The FillExtent containing this tick. | ||
* @param [in] include_end TODO: unknown | ||
* @returns True if a fill exists at the given tick, false if not. | ||
*/ | ||
bool FillAt(int tick, FillExtent& outExtent, bool include_end) const; | ||
|
||
TickedInfoCollection<int> mLanes; // 0x4 | ||
std::vector<FillExtent> mFills; // 0xc | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.