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

oops! 0.04% more #232

Merged
merged 1 commit into from
May 31, 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
7 changes: 5 additions & 2 deletions config/SZBE69_B8/objects.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"objects": {
"band3/bandtrack/GemSmasher.cpp": "LinkIssues",
"band3/bandtrack/GraphicsUtl.cpp": "Matching",
"band3/bandtrack/TrackConfig.cpp": { "status": "LinkIssues", "extra_cflags": ["-ipa file"] },

"band3/game/BandUser.cpp": "NonMatching",
"band3/game/FretHand.cpp": "NonMatching",
Expand All @@ -36,14 +37,16 @@
"band3/meta_band/Award.cpp": "NonMatching",
"band3/meta_band/BandProfile.cpp": "NonMatching",
"band3/meta_band/CampaignKey.cpp": "Matching",
"band3/meta_band/GameplayOptions.cpp": "NonMatching",
"band3/meta_band/GameplayOptions.cpp": "Matching",
"band3/meta_band/NameGenerator.cpp": "NonMatching",
"band3/meta_band/SongStatusMgr.cpp": "NonMatching",

"band3/tour/FixedSetlist.cpp": "NonMatching",
"band3/tour/GigFilter.cpp": "NonMatching",
"band3/tour/Quest.cpp": "Matching",
"band3/tour/TourProgress.cpp": "NonMatching"
"band3/tour/TourGameRules.cpp": "Matching",
"band3/tour/TourProgress.cpp": "NonMatching",
"band3/tour/TourQuestGameRules.cpp": "Matching"
}
},
"network": {
Expand Down
56 changes: 56 additions & 0 deletions src/band3/bandtrack/TrackConfig.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#include "TrackConfig.h"
#include "game/Defines.h"
#include "utl/Symbol.h"

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

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

int TrackConfig::TrackNum() const { return mTrackNum; }

#pragma push
#pragma force_active on
inline int TrackConfig::GetMaxSlots() const { return mMaxSlots; }
#pragma pop

Symbol TrackConfig::Type() const { return mUser->GetTrackSym(); }
bool TrackConfig::IsLefty() const { return mLefty; }
uint TrackConfig::GetGameCymbalLanes() const { return mCymbalLanes; }
bool TrackConfig::GetDisableHopos() const { return mDisableHopos; }
bool TrackConfig::UseLeftyGems() const { return mLefty; }

bool TrackConfig::IsDrumTrack() const { return mUser->GetTrackType() == kTrackDrum; }
bool TrackConfig::IsKeyboardTrack() const { return mUser->GetTrackType() == kTrackKeyboard; }

bool TrackConfig::AllowsOverlappingGems() const {
bool b = 0;
if (mUser->GetTrackType() == kTrackKeyboard || mUser->GetTrackType() == 4) b = true;
return b;
}

bool TrackConfig::AllowsPartialHits() const { return mUser->GetControllerType() == kControllerNone; }

bool TrackConfig::IsRealGuitarTrack() const {
TrackType t = mUser->GetTrackType();
bool b = 0;
if (t == kTrackProGuitar || t == kTrackProBass) b = true;
return b;
}

const char* TrackConfig::GetSlotColor(int slot) const {
MILO_ASSERT(slot >= 0 && slot <= GetMaxSlots(), 156);
DataArray* syscfg = SystemConfig("track_graphics", "slot_colors", TrackTypeToSym(mUser->GetTrackType()));
int i = slot;
bool b = (mUser->GetTrackType() == kTrackDrum);
if (b && mLefty && i != 0) i = mMaxSlots - i;
return syscfg->Str(i + 1);
}

void TrackConfig::SetMaxSlots(int i) { mMaxSlots = i; }
void TrackConfig::SetLefty(bool b) { mLefty = b; }
void TrackConfig::SetGameCymbalLanes(uint ui) { mCymbalLanes = ui; }
void TrackConfig::SetDisableHopos(bool b) { mDisableHopos = b; }
void TrackConfig::SetTrackNum(int i) { mTrackNum = i; }

const char* unused = "slot >= 0 && slot <= mMaxSlots\0\0R\0L\0numSlots <= mMaxSlots\0left\0right"; // fun fact: this is broken under -ipa file!
29 changes: 29 additions & 0 deletions src/band3/bandtrack/TrackConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#ifndef BANDTRACK_TRACKCONFIG_H
#define BANDTRACK_TRACKCONFIG_H

#include "game/BandUser.h"
#include "types.h"

class TrackConfig {
public:
TrackConfig(BandUser*);
BandUser* mUser; const BandUser* GetBandUser() const; Symbol Type() const; // 0x0
u8 unk_0x4; // 0x4
int mTrackNum; int TrackNum() const; void SetTrackNum(int); // 0x8
int mMaxSlots; int GetMaxSlots() const; void SetMaxSlots(int); // 0xC
int unk_0x10; // 0x10
const char* unk_0x14; // 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;

bool IsDrumTrack() const;
bool IsKeyboardTrack() const;
bool IsRealGuitarTrack() const;
bool AllowsOverlappingGems() const;
bool AllowsPartialHits() const;
const char* GetSlotColor(int) const;
};

#endif // BANDTRACK_TRACKCONFIG_H
6 changes: 4 additions & 2 deletions src/band3/game/BandUser.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ class BandUser : public virtual User {
virtual ~BandUser();

public:
ControllerType GetControllerType();
ControllerType GetControllerType() const;
TrackType GetTrackType() const;
Symbol GetTrackSym() const;

private:
Difficulty unk_0x8;
u8 unk_0xC;
int unk_0x10, unk_0x14;
u8 unk_0x18, unk_0x19;
int unk_0x1C, unk_0x20;
String unk_0x24;
class String unk_0x24;
int unk_0x30;
GameplayOptions unk_0x34;
u8 unk_0x70;
Expand Down
9 changes: 9 additions & 0 deletions src/band3/game/Defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,19 @@ enum ScoreType {
};

enum TrackType {
kTrackDrum = 0,
kTrackGuitar = 1, // guess
kTrackBass = 2, // guess

kTrack4 = 4,
kTrackKeyboard = 5,
kTrackProGuitar = 6,

kTrackProBass = 8
};

TrackType ScoreTypeToTrackType(ScoreType scoreType);
ControllerType TrackTypeToControllerType(TrackType trackType);
Symbol TrackTypeToSym(TrackType);

#endif // GAME_DEFINES_H
13 changes: 6 additions & 7 deletions src/band3/meta_band/GameplayOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,27 @@
#include "obj/Object.h"
#include "utl/Symbols.h"

GameplayOptions::GameplayOptions() : mVocalVolume(11), mLefty(false), mVocalStyle(kVocStyle1), unk_0x18(false) { mSaveSizeMethod = SaveSize; }
GameplayOptions::GameplayOptions() : mVocalVolume(11), mLefty(false), mVocalStyle(kVocStyle1), mDirty(false) { mSaveSizeMethod = SaveSize; }

int GameplayOptions::GetVocalVolume(int) const { return mVocalVolume; }

void GameplayOptions::SetVocalVolume(int, int i) {
if (i < 0 || TheProfileMgr.GetSliderStepCount() <= i) return;
if (mVocalVolume == i) return;
unk_0x18 = true;
mDirty = true;
mVocalVolume = i;

}

void GameplayOptions::SetLefty(bool b) { if (mLefty == b) return; unk_0x18 = true; mLefty = b; }
void GameplayOptions::SetLefty(bool b) { if (mLefty == b) return; mDirty = true; mLefty = b; }

void GameplayOptions::SetVocalStyle(VocalStyle v) { if (mVocalStyle == v) return; unk_0x18 = true; mVocalStyle = v; }
void GameplayOptions::SetVocalStyle(VocalStyle v) { if (mVocalStyle == v) return; mDirty = true; mVocalStyle = v; }

void GameplayOptions::SaveFixed(FixedSizeSaveableStream& fsss) const {
GameplayOptions* why = const_cast<GameplayOptions*>(this);
fsss << mLefty;
fsss << mVocalVolume;
fsss << mVocalStyle;
why->unk_0x18 = false;
mDirty = false;
}

void GameplayOptions::LoadFixed(FixedSizeSaveableStream& fsss, int) {
Expand All @@ -34,7 +33,7 @@ void GameplayOptions::LoadFixed(FixedSizeSaveableStream& fsss, int) {
int x;
fsss >> x;
mVocalStyle = (VocalStyle)x;
unk_0x18 = false;
mDirty = false;
}

int GameplayOptions::SaveSize(int) {
Expand Down
2 changes: 1 addition & 1 deletion src/band3/meta_band/GameplayOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class GameplayOptions : public virtual Hmx::Object, public FixedSizeSaveable {
int mVocalVolume;
bool mLefty;
VocalStyle mVocalStyle;
u8 unk_0x18;
mutable u8 mDirty;
};

#endif // METABAND_GAMEPLAYOPTIONS_H
7 changes: 6 additions & 1 deletion src/band3/tour/TourGameModifier.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#ifndef TOUR_TOURGAMEMODIFIER_H
#define TOUR_TOURGAMEMODIFIER_H

class TourGameModifier {
#include "obj/Data.h"

class TourGameModifier {
public:
TourGameModifier();
~TourGameModifier();
void Init(const DataArray*);
};

#endif // TOUR_TOURGAMEMODIFIER_H
33 changes: 33 additions & 0 deletions src/band3/tour/TourGameRules.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include "TourGameRules.h"
#include "obj/Data.h"
#include "os/Debug.h"
#include "utl/Symbols.h"

TourGameRules::TourGameRules() : mGameType(), mChallengeData(NULL) {}
TourGameRules::~TourGameRules() {}

void TourGameRules::Init(const DataArray* i_pConfig) {
MILO_ASSERT(i_pConfig, 28);
int x = 0 ;
i_pConfig->FindData(type, x, true);
mGameType = (TourGameType)x;
DataArray* pTargetArray = i_pConfig->FindArray(target, true);
MILO_ASSERT(pTargetArray, 37);
MILO_ASSERT(pTargetArray->Size() > 1, 40);
for (int i = 1; i < pTargetArray->Size(); i++) {
float f = pTargetArray->Node(i).Float(NULL);
if (m_vTargets.size() < 2) m_vTargets.push_back(f);
else MILO_WARN("Too many targets specified for game type: %i", mGameType);
}
int i = m_vTargets.size();
if (i < 2) {MILO_WARN("Not enough targets specified for game type: %i", mGameType);
for (i; i < 2; i++) {
m_vTargets.push_back(0);
}}
mChallengeData = i_pConfig->FindArray(challenge_specific_data, false);
}

TourGameType TourGameRules::GetGameType() const { return mGameType; }
u16 TourGameRules::GetNumTargets() const { return m_vTargets.size(); }
float TourGameRules::GetTarget(int i_iIndex) const { MILO_ASSERT(i_iIndex < m_vTargets.size(), 90); return m_vTargets[i_iIndex]; }
const DataArray* TourGameRules::GetChallengeSpecificData() const { return mChallengeData; }
3 changes: 2 additions & 1 deletion src/band3/tour/TourGameRules.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef TOUR_TOURGAMERULES_H
#define TOUR_TOURGAMERULES_H

#include "types.h"
#include "obj/Data.h"
#include <vector>

Expand All @@ -15,7 +16,7 @@ class TourGameRules {
virtual void Init(const DataArray*);

TourGameType mGameType; TourGameType GetGameType() const;
std::vector<int> mTargets; short GetNumTargets() const; int GetTarget(int) const;
std::vector<float> m_vTargets; u16 GetNumTargets() const; float GetTarget(int) const;
DataArray* mChallengeData; const DataArray* GetChallengeSpecificData() const;
};

Expand Down
13 changes: 13 additions & 0 deletions src/band3/tour/TourQuestGameRules.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "TourQuestGameRules.h"
#include "os/Debug.h"
#include "tour/TourGameRules.h"
#include "utl/Symbols.h"

TourQuestGameRules::TourQuestGameRules() : mModifier() {}
TourQuestGameRules::~TourQuestGameRules() {}

void TourQuestGameRules::Init(const DataArray* i_pConfig) {
MILO_ASSERT(i_pConfig, 23);
TourGameRules::Init(i_pConfig);
mModifier.Init(i_pConfig->FindArray(modifiers, false));
}
4 changes: 2 additions & 2 deletions src/system/meta/FixedSizeSaveable.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class FixedSizeSaveable {
static void DepadStream(FixedSizeSaveableStream&, int);
static void SaveFixedSymbol(FixedSizeSaveableStream&, const Symbol&);
static void LoadFixedSymbol(FixedSizeSaveableStream&, Symbol&);
static void SaveFixedString(FixedSizeSaveableStream&, const String&);
static void LoadFixedString(FixedSizeSaveableStream&, String&);
static void SaveFixedString(FixedSizeSaveableStream&, const class String&);
static void LoadFixedString(FixedSizeSaveableStream&, class String&);
static void SaveSymbolID(FixedSizeSaveableStream&, Symbol);
static void LoadSymbolFromID(FixedSizeSaveableStream&, Symbol&);

Expand Down
2 changes: 1 addition & 1 deletion src/system/rndobj/Bitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ bool RndBitmap::LoadSafely(BinStream& bs, int a, int b) {
if (mWidth > a || mHeight > b) {
MILO_WARN("Something is wrong with the bitmap you're loading from %s, w = %d, h = %d", bs.Name(), mWidth, mHeight);
Create(8,8,0,0x20,0,NULL,NULL,NULL);
return true;
return false;
} else if (mBpp * mWidth / 8 != mRowBytes) {
MILO_WARN("Something is wrong with the bitmap you're loading from %s, w = %d, bpp = %d, row bytes: %d", bs.Name(), mWidth, mBpp, mRowBytes);
Create(8,8,0,0x20,0,NULL,NULL,NULL);
Expand Down
2 changes: 1 addition & 1 deletion src/system/utl/BufStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class BufStream : public BinStream {
int mSize;
StreamChecksumValidator* mChecksum;
int mBytesChecksummed;
String mName;
class String mName;
};

#endif
Loading