mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-16 04:57:01 +00:00
Merge remote-tracking branch 'origin/master' into hsh
This commit is contained in:
@@ -1049,13 +1049,13 @@ void CAutoMapper::ProcessControllerInput(const CFinalInput& input, CStateManager
|
||||
} else {
|
||||
x2fc_textpane_hint->TextSupport().SetText(u"");
|
||||
std::u16string str = fmt::format(FMT_STRING(u"&image=SI,0.6,1.0,{};"), g_tweakPlayerRes->x24_lStick[x2e4_lStickPos]);
|
||||
str += g_MainStringTable->GetString(46); // Rotate
|
||||
str += g_MainStringTable->GetString(46 + (!g_Main->IsUSA() || g_Main->IsTrilogy())); // Rotate
|
||||
x300_textpane_instructions->TextSupport().SetText(str);
|
||||
str = fmt::format(FMT_STRING(u"&image=SI,0.6,1.0,{};"), g_tweakPlayerRes->x4c_cStick[x2e8_rStickPos]);
|
||||
str += g_MainStringTable->GetString(47); // Move
|
||||
str += g_MainStringTable->GetString(47 + (!g_Main->IsUSA() || g_Main->IsTrilogy())); // Move
|
||||
x304_textpane_instructions1->TextSupport().SetText(str);
|
||||
str = fmt::format(FMT_STRING(u"&image={};"), g_tweakPlayerRes->x74_lTrigger[x2ec_lTriggerPos]);
|
||||
str += g_MainStringTable->GetString(48); // Zoom
|
||||
str += g_MainStringTable->GetString(48 + (!g_Main->IsUSA() || g_Main->IsTrilogy())); // Zoom
|
||||
str += fmt::format(FMT_STRING(u"&image={};"), g_tweakPlayerRes->x80_rTrigger[x2f0_rTriggerPos]);
|
||||
x308_textpane_instructions2->TextSupport().SetText(str);
|
||||
}
|
||||
@@ -1104,10 +1104,10 @@ void CAutoMapper::Update(float dt, CStateManager& mgr) {
|
||||
m_frmeInitialized = true;
|
||||
static_cast<CGuiTextPane*>(x28_frmeMapScreen->FindWidget("textpane_left"))
|
||||
->TextSupport()
|
||||
.SetText(g_MainStringTable->GetString(42));
|
||||
.SetText(g_MainStringTable->GetString(42 + (!g_Main->IsUSA() || g_Main->IsTrilogy())));
|
||||
static_cast<CGuiTextPane*>(x28_frmeMapScreen->FindWidget("textpane_yicon"))
|
||||
->TextSupport()
|
||||
.SetText(g_MainStringTable->GetString(43));
|
||||
.SetText(g_MainStringTable->GetString(43 + (!g_Main->IsUSA() || g_Main->IsTrilogy())));
|
||||
x2fc_textpane_hint = static_cast<CGuiTextPane*>(x28_frmeMapScreen->FindWidget("textpane_hint"));
|
||||
x300_textpane_instructions = static_cast<CGuiTextPane*>(x28_frmeMapScreen->FindWidget("textpane_instructions"));
|
||||
x304_textpane_instructions1 = static_cast<CGuiTextPane*>(x28_frmeMapScreen->FindWidget("textpane_instructions1"));
|
||||
@@ -1115,7 +1115,7 @@ void CAutoMapper::Update(float dt, CStateManager& mgr) {
|
||||
CGuiTextPane* mapLegend = static_cast<CGuiTextPane*>(x28_frmeMapScreen->FindWidget("textpane_mapLegend"));
|
||||
mapLegend->TextSupport().ClearRenderBuffer();
|
||||
mapLegend->TextSupport().SetImageBaseline(true);
|
||||
mapLegend->TextSupport().SetText(g_MainStringTable->GetString(49));
|
||||
mapLegend->TextSupport().SetText(g_MainStringTable->GetString(49 + (!g_Main->IsUSA() || g_Main->IsTrilogy())));
|
||||
x30c_basewidget_leftPane = x28_frmeMapScreen->FindWidget("basewidget_leftPane");
|
||||
x310_basewidget_yButtonPane = x28_frmeMapScreen->FindWidget("basewidget_yButtonPane");
|
||||
x314_basewidget_bottomPane = x28_frmeMapScreen->FindWidget("basewidget_bottomPane");
|
||||
@@ -1472,7 +1472,7 @@ void CAutoMapper::Draw(const CStateManager& mgr, const zeus::CTransform& xf, flo
|
||||
beaconAlpha = loc.x4_beaconAlpha;
|
||||
}
|
||||
if (beaconAlpha > 0.f) {
|
||||
const std::array<CTexturedQuadFilter::Vert, 4> verts{{
|
||||
constexpr std::array<CTexturedQuadFilter::Vert, 4> verts{{
|
||||
{{-4.f, -8.f, 8.f}, {0.f, 1.f}},
|
||||
{{-4.f, -8.f, 0.f}, {0.f, 0.f}},
|
||||
{{4.f, -8.f, 8.f}, {1.f, 1.f}},
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "Runtime/rstl.hpp"
|
||||
#include "Runtime/RetroTypes.hpp"
|
||||
#include "Runtime/AutoMapper/CMapUniverse.hpp"
|
||||
#include "Runtime/MP1/CInGameGuiManager.hpp"
|
||||
|
||||
#include <zeus/CQuaternion.hpp>
|
||||
@@ -17,7 +18,6 @@
|
||||
#include <zeus/CVector3f.hpp>
|
||||
|
||||
namespace urde {
|
||||
class CMapUniverse;
|
||||
class CMapWorldInfo;
|
||||
class CStateManager;
|
||||
class IWorld;
|
||||
|
||||
@@ -27,30 +27,40 @@ struct Circle {
|
||||
Circle(const Circle2& circ2) : x0_point(circ2.x0_point), x8_radius(std::sqrt(circ2.x8_radiusSq)) {}
|
||||
};
|
||||
|
||||
Circle2 ExactCircle1(const zeus::CVector2f* a) { return {*a, 0.f}; }
|
||||
Circle2 ExactCircle1(const zeus::CVector2f* a) {
|
||||
return {
|
||||
.x0_point = *a,
|
||||
.x8_radiusSq = 0.f,
|
||||
};
|
||||
}
|
||||
|
||||
Circle2 ExactCircle2(const zeus::CVector2f* a, const zeus::CVector2f* b) {
|
||||
Circle2 ret = {};
|
||||
ret.x0_point = 0.5f * (*a + *b);
|
||||
ret.x8_radiusSq = (*b - *a).magSquared() * 0.25f;
|
||||
return ret;
|
||||
return {
|
||||
.x0_point = 0.5f * (*a + *b),
|
||||
.x8_radiusSq = (*b - *a).magSquared() * 0.25f,
|
||||
};
|
||||
}
|
||||
|
||||
Circle2 ExactCircle3(const zeus::CVector2f* a, const zeus::CVector2f* b, const zeus::CVector2f* c) {
|
||||
Circle2 ret = {};
|
||||
zeus::CVector2f d1 = *b - *a;
|
||||
zeus::CVector2f d2 = *c - *a;
|
||||
float cross = d1.cross(d2);
|
||||
zeus::CVector2f magVec(d1.magSquared() * 0.5f, d2.magSquared() * 0.5f);
|
||||
const zeus::CVector2f d1 = *b - *a;
|
||||
const zeus::CVector2f d2 = *c - *a;
|
||||
const float cross = d1.cross(d2);
|
||||
const zeus::CVector2f magVec(d1.magSquared() * 0.5f, d2.magSquared() * 0.5f);
|
||||
|
||||
if (std::fabs(cross) > 0.01f) {
|
||||
zeus::CVector2f tmp((d2.y() * magVec.x() - d1.y() * magVec.y()) / cross,
|
||||
(d1.x() * magVec.y() - d2.x() * magVec.x()) / cross);
|
||||
ret.x0_point = *a + tmp;
|
||||
ret.x8_radiusSq = tmp.magSquared();
|
||||
const zeus::CVector2f tmp((d2.y() * magVec.x() - d1.y() * magVec.y()) / cross,
|
||||
(d1.x() * magVec.y() - d2.x() * magVec.x()) / cross);
|
||||
|
||||
return {
|
||||
.x0_point = *a + tmp,
|
||||
.x8_radiusSq = tmp.magSquared(),
|
||||
};
|
||||
} else {
|
||||
ret.x8_radiusSq = FLT_MAX;
|
||||
return {
|
||||
.x0_point = zeus::skZero2f,
|
||||
.x8_radiusSq = FLT_MAX,
|
||||
};
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool PointInsideCircle(const zeus::CVector2f& point, const Circle2& circ, float& intersect) {
|
||||
@@ -59,7 +69,7 @@ bool PointInsideCircle(const zeus::CVector2f& point, const Circle2& circ, float&
|
||||
}
|
||||
|
||||
Circle2 UpdateSupport1(int idx, const zeus::CVector2f** list, Support& support) {
|
||||
Circle2 ret = ExactCircle2(list[support.x4_[0]], list[idx]);
|
||||
const Circle2 ret = ExactCircle2(list[support.x4_[0]], list[idx]);
|
||||
support.x0_ = 2;
|
||||
support.x4_[1] = idx;
|
||||
return ret;
|
||||
|
||||
@@ -20,7 +20,7 @@ CMapWorldInfo::CMapWorldInfo(CBitStreamReader& reader, const CSaveWorld& savw, C
|
||||
SetIsMapped(i, mapped);
|
||||
}
|
||||
|
||||
for (const TEditorId doorId : savw.GetDoors()) {
|
||||
for (const auto& doorId : savw.GetDoors()) {
|
||||
SetDoorVisited(doorId, reader.ReadEncoded(1) != 0);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ void CMapWorldInfo::PutTo(CBitStreamWriter& writer, const CSaveWorld& savw, CAss
|
||||
}
|
||||
}
|
||||
|
||||
for (const TEditorId doorId : savw.GetDoors()) {
|
||||
for (const auto& doorId : savw.GetDoors()) {
|
||||
writer.WriteEncoded(u32(IsDoorVisited(doorId)), 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ void CMappableObject::Draw(int curArea, const CMapWorldInfo& mwInfo, float alpha
|
||||
m_texQuadFilter.emplace(EFilterType::Add, tex, CTexturedQuadFilter::ZTest::GEqual);
|
||||
}
|
||||
|
||||
const std::array<CTexturedQuadFilter::Vert, 4> verts{{
|
||||
constexpr std::array<CTexturedQuadFilter::Vert, 4> verts{{
|
||||
{{-2.6f, 0.f, 2.6f}, {0.f, 1.f}},
|
||||
{{-2.6f, 0.f, -2.6f}, {0.f, 0.f}},
|
||||
{{2.6f, 0.f, 2.6f}, {1.f, 1.f}},
|
||||
|
||||
Reference in New Issue
Block a user