Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to RndPostProc, MasterAudio, CustomSplash_Wii, among others #356

Merged
merged 8 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/SZBE69_B8/objects.json
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@
"system/midi/MidiReceiver.cpp": "Matching",
"system/midi/MidiVarLen.cpp": "Matching",

"system/movie/CustomSplash_Wii.cpp": "MISSING",
"system/movie/CustomSplash_Wii.cpp": "NonMatching",
"system/movie/Movie_Wii.cpp": "MISSING",
"system/movie/Movie.cpp": "MISSING",
"system/movie/Splash.cpp": "NonMatching",
Expand Down
4 changes: 3 additions & 1 deletion src/band3/bandtrack/Gem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ Gem& Gem::operator=(const Gem& g) {
mWidgets = g.mWidgets;
}

bool Gem::OnScreen(float) {
bool Gem::OnScreen(float ms) {
float bottomSeconds = mGemManager->mTrackDir->BottomSeconds();

return (ms / 1000.0f) + bottomSeconds > mEnd;
}

bool Gem::UseRGChordStyle() const {
Expand Down
10 changes: 5 additions & 5 deletions src/band3/bandtrack/GemRepTemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ GemRepTemplate::GemRepTemplate(const TrackConfig& tc) : mConfig(SystemConfig("tr
kTailMaxLength(mConfig->FindArray("tail_max_length", true)->Float(1)),
kTailFrequencyRange(mConfig->FindArray("tail_min_freq", true)->Float(1), mConfig->FindArray("tail_max_freq", true)->Float(1)),
kTailAmplitudeRange(mConfig->FindArray("tail_min_amp", true)->Float(1), mConfig->FindArray("tail_max_amp", true)->Float(1)),
mTrackCfg(tc), unk_0x3C(0), unk_0x40(1.0f), objectDir(NULL) {
mTrackCfg(tc), unk_0x3C(0), unk_0x40(1.0f), mObjectDir(NULL) {
mSlots = (RndMat**)new void*[tc.GetMaxSlots()]; // it doesn't call the ctors, so i have to do This to just alloc
}

Expand Down Expand Up @@ -69,7 +69,7 @@ int GemRepTemplate::GetRequiredFaceCount(int i) const {

RndMat* GemRepTemplate::GetMatByTag(const char* c, int slot) {
const char* s = mConfig->FindArray("mat_formats", true)->FindArray(c, true)->Str(1);
return objectDir->Find<RndMat>(MakeString("%s.mat", MakeString(s, slot < mTrackCfg.GetMaxSlots() ? mTrackCfg.GetSlotColor(slot) : "star")), true);
return mObjectDir->Find<RndMat>(MakeString("%s.mat", MakeString(s, slot < mTrackCfg.GetMaxSlots() ? mTrackCfg.GetSlotColor(slot) : "star")), true);
}

bool VertLess(const RndMesh::Vert& v1, const RndMesh::Vert& v2) {
Expand All @@ -80,13 +80,13 @@ bool VertLess(const RndMesh::Vert& v1, const RndMesh::Vert& v2) {
}

void GemRepTemplate::SetupTailVerts() {
objectDir->Find<RndMesh>("tail02.mesh", false)->Verts() = mTailVerts; // where assert
mObjectDir->Find<RndMesh>("tail02.mesh", false)->Verts() = mTailVerts; // where assert
MILO_ASSERT(!(mTailVerts.size()%2), 212);
std::sort(mTailVerts.begin(), mTailVerts.end(), VertLess);
unk_0x64 = mTailVerts;
mCapVerts = mTailVerts;
int i = 420;
mTailVerts.resize(i, true);
unk_0x64.resize(i, true);
mCapVerts.resize(i, true);
}

int GemRepTemplate::GetNumTailSections(GemRepTemplate::TailType type) const {
Expand Down
4 changes: 2 additions & 2 deletions src/band3/bandtrack/GemRepTemplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ class GemRepTemplate {
RndMat** mSlots; // 0x38
float unk_0x3C;
float unk_0x40;
ObjectDir* objectDir; // 0x44
ObjectDir* mObjectDir; // 0x44
uint mNumTailSections;
u32 pad1;
float mTailSectionLen;
u32 pad2;

RndMesh::VertVector mTailVerts; // 0x58
RndMesh::VertVector unk_0x64;
RndMesh::VertVector mCapVerts;

int pad[3];

Expand Down
4 changes: 2 additions & 2 deletions src/band3/bandtrack/TrackConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#include "decomp.h"

TrackConfig::TrackConfig(BandUser* bu) : mUser(bu), unk_0x4(true), mTrackNum(0), mMaxSlots(0), unk_0x10(0),
unk_0x14(), mLefty(false), mCymbalLanes(0), mDisableHopos(0) {}
TrackConfig::TrackConfig(BandUser* bu) : mUser(bu), kDualPerspective(true), mTrackNum(0), mMaxSlots(0), mNumSlots(0),
mName(), mLefty(false), mCymbalLanes(0), mDisableHopos(0) {}

const BandUser* TrackConfig::GetBandUser() const { return mUser; }

Expand Down
8 changes: 4 additions & 4 deletions src/band3/bandtrack/TrackConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ class TrackConfig {
public:
TrackConfig(BandUser*);
BandUser* mUser; const BandUser* GetBandUser() const; Symbol Type() const; // 0x0
u8 unk_0x4; // 0x4
u8 kDualPerspective; // 0x4
int mTrackNum; int TrackNum() const; void SetTrackNum(int); // 0x8
int mMaxSlots; int GetMaxSlots() const; void SetMaxSlots(int); // 0xC
int unk_0x10; // 0x10
Symbol unk_0x14; // 0x14
int mNumSlots; // 0x10
Symbol mName; // 0x14
bool mLefty; bool IsLefty() const; bool UseLeftyGems() const; void SetLefty(bool); // 0x18
uint mCymbalLanes; uint GetGameCymbalLanes() const; void SetGameCymbalLanes(uint); // 0x1c
bool mDisableHopos; bool GetDisableHopos() const; void SetDisableHopos(bool); // 0x20
std::vector<int> unk_0x24;
std::vector<int> mSlotSpacing;

bool IsDrumTrack() const;
bool IsKeyboardTrack() const;
Expand Down
59 changes: 32 additions & 27 deletions src/band3/meta_band/Award.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,60 @@

#include "decomp.h"

Award::Award(DataArray* configure, int index) : mName(gNullStr), mIcon(gNullStr), mIsSecret(false), mIsBonus(false), mIndex(index) {
Award::Award(DataArray *configure, int index)
: mName(gNullStr), mIcon(gNullStr), mIsSecret(false), mIsBonus(false), mIndex(index) {

}

Award::~Award() {
Award::~Award() {}

}

class AssetMgr{};
class AssetMgr {};

void Award::Configure(DataArray* i_pConfig) {
void Award::Configure(DataArray *i_pConfig) {
MILO_ASSERT(i_pConfig, 0x25);

mName = i_pConfig->Sym(0);
i_pConfig->FindData(is_secret, mIsSecret, false);
i_pConfig->FindData(is_bonus, mIsBonus, false);
i_pConfig->FindData(icon, mIcon, false);
DataArray* pAwardArray = i_pConfig->FindArray(awards, false);
DataArray *pAwardArray = i_pConfig->FindArray(awards, false);

MILO_ASSERT(pAwardArray->Size() > 1, 0x39);

int i;
for (i = 0; i < pAwardArray->Size(); i++) {
DataNode node = pAwardArray->Node(i);
DataArray* pAwardEntryArray = node.Array(0);
DataArray *pAwardEntryArray = node.Array(0);

MILO_ASSERT(pAwardEntryArray, 0x3f);
MILO_ASSERT(pAwardEntryArray->Size() >= 1, 0x40);
DataNode assetMgr = pAwardEntryArray->Node(0);
}

// TODO: Temporary to match string pool
void* pAssetMgr;
void *pAssetMgr;
MILO_ASSERT(pAssetMgr, 0);
TheDebug.Notify("Award: %s is granting unknown asset: %s\n");

if (i > 8) {
TheDebug.Notify(MakeString("AWARD: %s is awarding too many assets! count = %i\n", mName, i));
TheDebug.Notify(
MakeString("AWARD: %s is awarding too many assets! count = %i\n", mName, i)
);
}
}

Symbol Award::GetName() const{
Symbol Award::GetName() const {
return mName;
}

Symbol Award::GetDescription() const{
Symbol Award::GetDescription() const {
if (HasAssets()) {
return award_genericdesc;
}
return MakeString("%s_desc", mName);
}

Symbol Award::GetDisplayName() const{
Symbol Award::GetDisplayName() const {
if (HasAssets()) {
return award_generic;
}
Expand All @@ -77,42 +78,46 @@ bool Award::HasIconArt() const {
return !noIcon;
}

Symbol Award::GetIconArt() const{
Symbol Award::GetIconArt() const {
return mIcon;
}

bool Award::IsBonus() const{
bool Award::IsBonus() const {
return mIsBonus;
}

DECOMP_FORCEACTIVE(Award,
"%s_howto",
"%s_gray"
)
DECOMP_FORCEACTIVE(Award, "%s_howto", "%s_gray")

void Award::GrantAward(const AwardEntry& awardEntry, BandProfile* i_pProfile) {
void Award::GrantAward(const AwardEntry &awardEntry, BandProfile *i_pProfile) {
MILO_ASSERT(i_pProfile, 0xbd);

// TODO: Temporary to match string pool
// Requires BandProfile and ProfileAssets
void* pPerformer;
void *pPerformer;
MILO_ASSERT(pPerformer, 0);

if(mIndex){
TheDebug.Fail("Award Category is not currently supported: %s \n");
if (mIndex) {
TheDebug.Fail(MakeString("Award Category is not currently supported: %s \n", awardEntry.m_symAwardCategory));
}
}

void Award::InqAssets(std::vector<Symbol>& o_rAssets) {
void Award::InqAssets(std::vector<Symbol> &o_rAssets) {
MILO_ASSERT(o_rAssets.empty(), 0xe5);
}

bool Award::HasAssets() const {
return 0;
for (int i = 0; i < mAwardEntries.size(); i++) {
if (mAwardEntries[i].m_symAwardCategory == asset) {
return true;
}
}
return false;
}

void Award::GrantAwards(BandProfile* bandProfile) {
for (std::vector<AwardEntry>::iterator it = mAwardEntries.begin(); it != mAwardEntries.end(); it++) {
void Award::GrantAwards(BandProfile *bandProfile) {
for (std::vector<AwardEntry>::iterator it = mAwardEntries.begin();
it != mAwardEntries.end();
it++) {
GrantAward(*it, bandProfile);
}
}
30 changes: 17 additions & 13 deletions src/band3/meta_band/Award.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,33 @@

class BandProfile;

class AwardEntry {};
class AwardEntry {
public:
Symbol m_symAwardCategory;
Symbol m_symAward;
};

class Award {
Award(DataArray*, int);
class Award {
Award(DataArray *, int);
virtual ~Award();
void Configure(DataArray*);
void Configure(DataArray *);
Symbol GetName() const;
Symbol GetDescription() const;
Symbol GetDisplayName() const;
bool HasIconArt() const;
Symbol GetIconArt() const;
bool IsBonus() const;
void GrantAward(const AwardEntry&, BandProfile*);
void InqAssets(std::vector<Symbol>&);
void GrantAward(const AwardEntry &, BandProfile *);
void InqAssets(std::vector<Symbol> &);
bool HasAssets() const;
void GrantAwards(BandProfile*);
void GrantAwards(BandProfile *);

Symbol mName; // 0x04
Symbol mIcon; // 0x08
int mIndex; // 0x0c
bool mIsSecret; // 0x10
std::vector<AwardEntry> mAwardEntries; // 0x14
bool mIsBonus; // 0x1c
Symbol mName; // 0x04
Symbol mIcon; // 0x08
int mIndex; // 0x0c
bool mIsSecret; // 0x10
std::vector<AwardEntry> mAwardEntries; // 0x14
bool mIsBonus; // 0x1c
};

#endif // METABAND_AWARD_H
Loading
Loading