mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-05-15 09:11:20 +00:00
CRasterFont: Remove ignored maybe_unused attributes
This commit is contained in:
parent
04597c2787
commit
330eeebf08
@ -4,38 +4,39 @@
|
|||||||
|
|
||||||
namespace urde {
|
namespace urde {
|
||||||
|
|
||||||
CStaticInterference::CStaticInterference(size_t sourceCount) { m_sources.reserve(sourceCount); }
|
CStaticInterference::CStaticInterference(size_t sourceCount) { x0_sources.reserve(sourceCount); }
|
||||||
|
|
||||||
void CStaticInterference::RemoveSource(TUniqueId id) {
|
void CStaticInterference::RemoveSource(TUniqueId id) {
|
||||||
const auto iter = std::find_if(m_sources.cbegin(), m_sources.cend(), [id](const auto& src) { return src.id == id; });
|
const auto iter =
|
||||||
|
std::find_if(x0_sources.cbegin(), x0_sources.cend(), [id](const auto& src) { return src.id == id; });
|
||||||
|
|
||||||
if (iter == m_sources.cend()) {
|
if (iter == x0_sources.cend()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_sources.erase(iter);
|
x0_sources.erase(iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CStaticInterference::Update(CStateManager&, float dt) {
|
void CStaticInterference::Update(CStateManager&, float dt) {
|
||||||
std::vector<CStaticInterferenceSource> newSources;
|
std::vector<CStaticInterferenceSource> newSources;
|
||||||
newSources.reserve(m_sources.size());
|
newSources.reserve(x0_sources.size());
|
||||||
for (CStaticInterferenceSource& src : m_sources) {
|
for (CStaticInterferenceSource& src : x0_sources) {
|
||||||
if (src.timeLeft >= 0.f) {
|
if (src.x8_timeLeft >= 0.f) {
|
||||||
src.timeLeft -= dt;
|
src.x8_timeLeft -= dt;
|
||||||
newSources.push_back(src);
|
newSources.push_back(src);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_sources = std::move(newSources);
|
x0_sources = std::move(newSources);
|
||||||
}
|
}
|
||||||
|
|
||||||
float CStaticInterference::GetTotalInterference() const {
|
float CStaticInterference::GetTotalInterference() const {
|
||||||
float validAccum = 0.f;
|
float validAccum = 0.f;
|
||||||
float invalidAccum = 0.f;
|
float invalidAccum = 0.f;
|
||||||
for (const CStaticInterferenceSource& src : m_sources) {
|
for (const CStaticInterferenceSource& src : x0_sources) {
|
||||||
if (src.id == kInvalidUniqueId)
|
if (src.x0_id == kInvalidUniqueId)
|
||||||
invalidAccum += src.magnitude;
|
invalidAccum += src.x4_magnitude;
|
||||||
else
|
else
|
||||||
validAccum += src.magnitude;
|
validAccum += src.x4_magnitude;
|
||||||
}
|
}
|
||||||
if (validAccum > 0.80000001f)
|
if (validAccum > 0.80000001f)
|
||||||
validAccum = 0.80000001f;
|
validAccum = 0.80000001f;
|
||||||
@ -47,16 +48,16 @@ float CStaticInterference::GetTotalInterference() const {
|
|||||||
|
|
||||||
void CStaticInterference::AddSource(TUniqueId id, float magnitude, float duration) {
|
void CStaticInterference::AddSource(TUniqueId id, float magnitude, float duration) {
|
||||||
magnitude = zeus::clamp(0.f, magnitude, 1.f);
|
magnitude = zeus::clamp(0.f, magnitude, 1.f);
|
||||||
const auto search = std::find_if(m_sources.begin(), m_sources.end(),
|
const auto search = std::find_if(x0_sources.begin(), x0_sources.end(),
|
||||||
[id](const CStaticInterferenceSource& source) { return source.id == id; });
|
[id](const CStaticInterferenceSource& source) { return source.x0_id == id; });
|
||||||
if (search != m_sources.cend()) {
|
if (search != x0_sources.cend()) {
|
||||||
search->magnitude = magnitude;
|
search->x4_magnitude = magnitude;
|
||||||
search->timeLeft = duration;
|
search->x8_timeLeft = duration;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_sources.size() < m_sources.capacity()) {
|
if (x0_sources.size() < x0_sources.capacity()) {
|
||||||
m_sources.push_back({id, magnitude, duration});
|
x0_sources.push_back({id, magnitude, duration});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,13 +7,13 @@ namespace urde {
|
|||||||
class CStateManager;
|
class CStateManager;
|
||||||
|
|
||||||
struct CStaticInterferenceSource {
|
struct CStaticInterferenceSource {
|
||||||
TUniqueId id;
|
TUniqueId x0_id;
|
||||||
float magnitude;
|
float x4_magnitude;
|
||||||
float timeLeft;
|
float x8_timeLeft;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CStaticInterference {
|
class CStaticInterference {
|
||||||
std::vector<CStaticInterferenceSource> m_sources;
|
std::vector<CStaticInterferenceSource> x0_sources;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CStaticInterference(size_t sourceCount);
|
explicit CStaticInterference(size_t sourceCount);
|
||||||
|
@ -81,10 +81,10 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
class CFontInfo {
|
class CFontInfo {
|
||||||
[[maybe_unused]] bool x0_ = false;
|
bool x0_ = false;
|
||||||
[[maybe_unused]] bool x1_ = false;
|
bool x1_ = false;
|
||||||
[[maybe_unused]] s32 x4_ = 0;
|
s32 x4_ = 0;
|
||||||
[[maybe_unused]] s32 x8_fontSize = 0;
|
s32 x8_fontSize = 0;
|
||||||
char xc_name[64] = "";
|
char xc_name[64] = "";
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user