mirror of https://github.com/AxioDL/metaforce.git
Various fixes
This commit is contained in:
parent
e943a60694
commit
055c8e8a47
|
@ -213,7 +213,7 @@ s16 CSortedListManager::CalculateIntersections(ESortedList la, ESortedList lb, s
|
|||
for (int i=0 ; i<a ; ++i)
|
||||
{
|
||||
s16 id = AccessElement(xb000_sortedLists[int(la)].x0_ids, i);
|
||||
if (AccessElement(x0_nodes, id).x1c_selfIdxs[lb] > aabb[int(lb)])
|
||||
if (AccessElement(x0_nodes, id).x4_box[int(lb)] > aabb[int(lb)])
|
||||
AddToLinkedList(id, headId, tailId);
|
||||
}
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ s16 CSortedListManager::CalculateIntersections(ESortedList la, ESortedList lb, s
|
|||
for (int i=d ; i<xb000_sortedLists[int(lb)].x800_size ; ++i)
|
||||
{
|
||||
s16 id = AccessElement(xb000_sortedLists[int(lb)].x0_ids, i);
|
||||
if (AccessElement(x0_nodes, id).x1c_selfIdxs[la] < aabb[int(la)])
|
||||
if (AccessElement(x0_nodes, id).x4_box[int(la)] < aabb[int(la)])
|
||||
AddToLinkedList(id, headId, tailId);
|
||||
}
|
||||
}
|
||||
|
@ -246,16 +246,16 @@ s16 CSortedListManager::CalculateIntersections(ESortedList la, ESortedList lb, s
|
|||
return headId;
|
||||
}
|
||||
|
||||
void CSortedListManager::BuildNearList(rstl::reserved_vector<TUniqueId, 1024>& out, const zeus::CVector3f& v1,
|
||||
const zeus::CVector3f& v2, float f1, const CMaterialFilter& filter,
|
||||
void CSortedListManager::BuildNearList(rstl::reserved_vector<TUniqueId, 1024>& out, const zeus::CVector3f& pos,
|
||||
const zeus::CVector3f& dir, float mag, const CMaterialFilter& filter,
|
||||
const CActor* actor) const
|
||||
{
|
||||
if (f1 == 0.f)
|
||||
f1 = 8000.f;
|
||||
zeus::CVector3f mul = v2 * f1;
|
||||
zeus::CVector3f sum = mul + v1;
|
||||
zeus::CVector3f maxs(std::max(v1.z, sum.z), std::max(v1.y, sum.y), std::max(v1.x, sum.x));
|
||||
zeus::CVector3f mins(std::min(sum.z, v1.z), std::min(sum.y, v1.y), std::min(sum.y, v1.y));
|
||||
if (mag == 0.f)
|
||||
mag = 8000.f;
|
||||
zeus::CVector3f ray = dir * mag;
|
||||
zeus::CVector3f sum = ray + pos;
|
||||
zeus::CVector3f maxs(std::max(pos.z, sum.z), std::max(pos.y, sum.y), std::max(pos.x, sum.x));
|
||||
zeus::CVector3f mins(std::min(sum.z, pos.z), std::min(sum.y, pos.y), std::min(sum.y, pos.y));
|
||||
BuildNearList(out, zeus::CAABox(mins, maxs), filter, actor);
|
||||
}
|
||||
|
||||
|
|
|
@ -2339,7 +2339,18 @@ void CStateManager::RemoveObject(TUniqueId uid)
|
|||
if (CEntity* ent = GetAllObjectList().GetValidObjectById(uid))
|
||||
{
|
||||
if (ent->GetEditorId() != kInvalidEditorId)
|
||||
x890_scriptIdMap.erase(ent->GetEditorId());
|
||||
{
|
||||
auto search = x890_scriptIdMap.equal_range(ent->GetEditorId());
|
||||
for (auto it = search.first; it != search.second;)
|
||||
{
|
||||
if (it->second == uid)
|
||||
{
|
||||
it = x890_scriptIdMap.erase(it);
|
||||
continue;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
}
|
||||
if (ent->GetAreaIdAlways() != kInvalidAreaId)
|
||||
{
|
||||
CGameArea* area = x850_world->GetArea(ent->GetAreaIdAlways());
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
private:
|
||||
TUniqueId x34_parent = kInvalidUniqueId;
|
||||
EFadeState x38_fadeState = EFadeState::A2B;
|
||||
float x3c_curTime;
|
||||
float x3c_curTime = 0.f;
|
||||
zeus::CColor x40_colorA;
|
||||
zeus::CColor x44_colorB;
|
||||
EBlendMode x48_blendMode;
|
||||
|
|
|
@ -396,7 +396,7 @@ void CScriptDebris::PreRender(CStateManager& mgr, const zeus::CFrustum& frustum)
|
|||
if (t < x2a4_colorInT)
|
||||
t = x2a4_colorInT > 0.f ? 1.f - x270_curTime / (x274_duration * x2a4_colorInT) : 0.f;
|
||||
else if (t > x2a8_colorOutT)
|
||||
t = (x270_curTime - x274_duration * x2a8_colorOutT) / x274_duration * (1.f - x2a8_colorOutT);
|
||||
t = (x270_curTime - x274_duration * x2a8_colorOutT) / (x274_duration * (1.f - x2a8_colorOutT));
|
||||
else
|
||||
t = 0.f;
|
||||
|
||||
|
|
Loading…
Reference in New Issue