mirror of https://github.com/AxioDL/metaforce.git
Various bug fixes
This commit is contained in:
parent
92ed463051
commit
cc6d79e280
|
@ -1838,8 +1838,8 @@ void CStateManager::SetGameState(EGameState state)
|
||||||
if (x904_gameState == state)
|
if (x904_gameState == state)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (state == EGameState::SoftPaused)
|
if (x904_gameState == EGameState::SoftPaused)
|
||||||
x850_world->SetPauseState(false);
|
x850_world->SetLoadPauseState(false);
|
||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
|
@ -1850,7 +1850,7 @@ void CStateManager::SetGameState(EGameState state)
|
||||||
case EGameState::SoftPaused:
|
case EGameState::SoftPaused:
|
||||||
if (!x88c_rumbleManager->IsDisabled())
|
if (!x88c_rumbleManager->IsDisabled())
|
||||||
x88c_rumbleManager->SetDisabled(true);
|
x88c_rumbleManager->SetDisabled(true);
|
||||||
x850_world->SetPauseState(true);
|
x850_world->SetLoadPauseState(true);
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2620,7 +2620,7 @@ void CStateManager::DeferStateTransition(EStateManagerTransition t)
|
||||||
{
|
{
|
||||||
if (xf90_deferredTransition != EStateManagerTransition::InGame)
|
if (xf90_deferredTransition != EStateManagerTransition::InGame)
|
||||||
{
|
{
|
||||||
x850_world->SetPauseState(false);
|
x850_world->SetLoadPauseState(false);
|
||||||
xf90_deferredTransition = EStateManagerTransition::InGame;
|
xf90_deferredTransition = EStateManagerTransition::InGame;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2628,7 +2628,7 @@ void CStateManager::DeferStateTransition(EStateManagerTransition t)
|
||||||
{
|
{
|
||||||
if (xf90_deferredTransition == EStateManagerTransition::InGame)
|
if (xf90_deferredTransition == EStateManagerTransition::InGame)
|
||||||
{
|
{
|
||||||
x850_world->SetPauseState(true);
|
x850_world->SetLoadPauseState(true);
|
||||||
xf90_deferredTransition = t;
|
xf90_deferredTransition = t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "CAABoxFilter.hpp"
|
#include "CAABoxFilter.hpp"
|
||||||
|
#include "CollisionUtil.hpp"
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
|
@ -10,7 +11,26 @@ void CAABoxFilter::Filter(const CCollisionInfoList& in, CCollisionInfoList& out)
|
||||||
|
|
||||||
void CAABoxFilter::FilterBoxFloorCollisions(const CCollisionInfoList& in, CCollisionInfoList& out)
|
void CAABoxFilter::FilterBoxFloorCollisions(const CCollisionInfoList& in, CCollisionInfoList& out)
|
||||||
{
|
{
|
||||||
/* TODO: finish */
|
float minZ = 10000.f;
|
||||||
|
for (const CCollisionInfo& info : in)
|
||||||
|
{
|
||||||
|
if (info.GetMaterialLeft().HasMaterial(EMaterialTypes::Wall) && info.GetPoint().z < minZ)
|
||||||
|
minZ = info.GetPoint().z;
|
||||||
|
}
|
||||||
|
CCollisionInfoList temp;
|
||||||
|
for (const CCollisionInfo& info : in)
|
||||||
|
{
|
||||||
|
if (info.GetMaterialLeft().HasMaterial(EMaterialTypes::Floor))
|
||||||
|
{
|
||||||
|
if (info.GetPoint().z < minZ)
|
||||||
|
temp.Add(info, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
temp.Add(info, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CollisionUtil::AddAverageToFront(temp, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,9 +47,9 @@ public:
|
||||||
const CMaterialList& GetMaterialRight() const { return x40_materialRight; }
|
const CMaterialList& GetMaterialRight() const { return x40_materialRight; }
|
||||||
zeus::CVector3f GetExtreme() const;
|
zeus::CVector3f GetExtreme() const;
|
||||||
void Swap();
|
void Swap();
|
||||||
zeus::CVector3f GetNormalLeft() const { return x48_normalLeft; }
|
const zeus::CVector3f& GetNormalLeft() const { return x48_normalLeft; }
|
||||||
zeus::CVector3f GetNormalRight() const { return x54_normalRight; }
|
const zeus::CVector3f& GetNormalRight() const { return x54_normalRight; }
|
||||||
zeus::CVector3f GetPoint() const { return x0_point; }
|
const zeus::CVector3f& GetPoint() const { return x0_point; }
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace urde
|
||||||
|
|
||||||
static float CollisionImpulseFiniteVsInfinite(float mass, float velNormDot, float restitution)
|
static float CollisionImpulseFiniteVsInfinite(float mass, float velNormDot, float restitution)
|
||||||
{
|
{
|
||||||
return mass * ((1.f / restitution) * velNormDot);
|
return mass * -(1.f + restitution) * velNormDot;
|
||||||
}
|
}
|
||||||
|
|
||||||
static float CollisionImpulseFiniteVsFinite(float mass0, float mass1, float velNormDot, float restitution)
|
static float CollisionImpulseFiniteVsFinite(float mass0, float mass1, float velNormDot, float restitution)
|
||||||
|
|
|
@ -1237,6 +1237,25 @@ bool AABox_AABox_Moving(const zeus::CAABox& aabb0, const zeus::CAABox& aabb1, co
|
||||||
|
|
||||||
void AddAverageToFront(const CCollisionInfoList& in, CCollisionInfoList& out)
|
void AddAverageToFront(const CCollisionInfoList& in, CCollisionInfoList& out)
|
||||||
{
|
{
|
||||||
|
if (in.GetCount() > 1)
|
||||||
|
{
|
||||||
|
zeus::CVector3f pointAccum, normAccum;
|
||||||
|
|
||||||
|
for (const CCollisionInfo& info : in)
|
||||||
|
{
|
||||||
|
pointAccum += info.GetPoint();
|
||||||
|
normAccum += info.GetNormalLeft();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (normAccum.canBeNormalized())
|
||||||
|
{
|
||||||
|
out.Add(CCollisionInfo(pointAccum / float(in.GetCount()),
|
||||||
|
in.GetItem(0).GetMaterialRight(), in.GetItem(0).GetMaterialLeft(),
|
||||||
|
normAccum.normalized()), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const CCollisionInfo& info : in)
|
||||||
|
out.Add(info, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,17 +70,32 @@ void CGraphics::SetAmbientColor(const zeus::CColor& col)
|
||||||
|
|
||||||
void CGraphics::SetFog(ERglFogMode mode, float startz, float endz, const zeus::CColor& color)
|
void CGraphics::SetFog(ERglFogMode mode, float startz, float endz, const zeus::CColor& color)
|
||||||
{
|
{
|
||||||
if (mode == ERglFogMode::None)
|
g_Fog.m_mode = mode > ERglFogMode::PerspRevExp2 ? ERglFogMode(int(mode) - 8) : mode;
|
||||||
|
switch (g_Fog.m_mode)
|
||||||
|
{
|
||||||
|
case ERglFogMode::None:
|
||||||
{
|
{
|
||||||
g_Fog.m_start = 4096.f;
|
g_Fog.m_start = 4096.f;
|
||||||
g_Fog.m_rangeScale = 0.f;
|
g_Fog.m_rangeScale = 0.f;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
case ERglFogMode::PerspRevExp:
|
||||||
|
case ERglFogMode::PerspRevExp2:
|
||||||
|
{
|
||||||
|
float userRange = endz - startz;
|
||||||
|
g_Fog.m_color = color;
|
||||||
|
g_Fog.m_start = endz;
|
||||||
|
g_Fog.m_rangeScale = 1.f / userRange;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
{
|
{
|
||||||
float userRange = endz - startz;
|
float userRange = endz - startz;
|
||||||
g_Fog.m_color = color;
|
g_Fog.m_color = color;
|
||||||
g_Fog.m_start = startz;
|
g_Fog.m_start = startz;
|
||||||
g_Fog.m_rangeScale = 1.f / userRange;
|
g_Fog.m_rangeScale = 1.f / userRange;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ enum class ERglAlphaOp
|
||||||
XNor = 3
|
XNor = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class ERglFogMode
|
enum class ERglFogMode : uint32_t
|
||||||
{
|
{
|
||||||
None = 0x00,
|
None = 0x00,
|
||||||
|
|
||||||
|
@ -232,6 +232,7 @@ public:
|
||||||
|
|
||||||
struct CFogState
|
struct CFogState
|
||||||
{
|
{
|
||||||
|
ERglFogMode m_mode;
|
||||||
zeus::CColor m_color;
|
zeus::CColor m_color;
|
||||||
float m_rangeScale = 0.f;
|
float m_rangeScale = 0.f;
|
||||||
float m_start = 4096.f;
|
float m_start = 4096.f;
|
||||||
|
|
|
@ -59,6 +59,7 @@ BOO_GLSL_BINDING_HEAD
|
||||||
"};\n"
|
"};\n"
|
||||||
"struct Fog\n" // Reappropriated for indirect texture scaling
|
"struct Fog\n" // Reappropriated for indirect texture scaling
|
||||||
"{\n"
|
"{\n"
|
||||||
|
" uint mode;\n"
|
||||||
" vec4 color;\n"
|
" vec4 color;\n"
|
||||||
" float indScale;\n"
|
" float indScale;\n"
|
||||||
" float start;\n"
|
" float start;\n"
|
||||||
|
@ -129,6 +130,7 @@ BOO_GLSL_BINDING_HEAD
|
||||||
"};\n"
|
"};\n"
|
||||||
"struct Fog\n" // Reappropriated for indirect texture scaling
|
"struct Fog\n" // Reappropriated for indirect texture scaling
|
||||||
"{\n"
|
"{\n"
|
||||||
|
" uint mode;\n"
|
||||||
" vec4 color;\n"
|
" vec4 color;\n"
|
||||||
" float indScale;\n"
|
" float indScale;\n"
|
||||||
" float start;\n"
|
" float start;\n"
|
||||||
|
|
|
@ -61,6 +61,7 @@ static const char* FS =
|
||||||
"};\n"
|
"};\n"
|
||||||
"struct Fog\n" // Reappropriated for indirect texture scaling
|
"struct Fog\n" // Reappropriated for indirect texture scaling
|
||||||
"{\n"
|
"{\n"
|
||||||
|
" uint mode;\n"
|
||||||
" float4 color;\n"
|
" float4 color;\n"
|
||||||
" float indScale;\n"
|
" float indScale;\n"
|
||||||
" float start;\n"
|
" float start;\n"
|
||||||
|
@ -130,6 +131,7 @@ static const char* FSDoor =
|
||||||
"};\n"
|
"};\n"
|
||||||
"struct Fog\n" // Reappropriated for indirect texture scaling
|
"struct Fog\n" // Reappropriated for indirect texture scaling
|
||||||
"{\n"
|
"{\n"
|
||||||
|
" uint mode;\n"
|
||||||
" float4 color;\n"
|
" float4 color;\n"
|
||||||
" float indScale;\n"
|
" float indScale;\n"
|
||||||
" float start;\n"
|
" float start;\n"
|
||||||
|
|
|
@ -73,6 +73,7 @@ static const char* FS =
|
||||||
"};\n"
|
"};\n"
|
||||||
"struct Fog\n" // Reappropriated for indirect texture scaling
|
"struct Fog\n" // Reappropriated for indirect texture scaling
|
||||||
"{\n"
|
"{\n"
|
||||||
|
" uint mode;\n"
|
||||||
" float4 color;\n"
|
" float4 color;\n"
|
||||||
" float indScale;\n"
|
" float indScale;\n"
|
||||||
" float start;\n"
|
" float start;\n"
|
||||||
|
@ -151,6 +152,7 @@ static const char* FSDoor =
|
||||||
"};\n"
|
"};\n"
|
||||||
"struct Fog\n" // Reappropriated for indirect texture scaling
|
"struct Fog\n" // Reappropriated for indirect texture scaling
|
||||||
"{\n"
|
"{\n"
|
||||||
|
" uint mode;\n"
|
||||||
" float4 color;\n"
|
" float4 color;\n"
|
||||||
" float indScale;\n"
|
" float indScale;\n"
|
||||||
" float start;\n"
|
" float start;\n"
|
||||||
|
|
|
@ -15,6 +15,7 @@ static const char* LightingGLSL =
|
||||||
"};\n"
|
"};\n"
|
||||||
"struct Fog\n"
|
"struct Fog\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
|
" uint mode;\n"
|
||||||
" vec4 color;\n"
|
" vec4 color;\n"
|
||||||
" float rangeScale;\n"
|
" float rangeScale;\n"
|
||||||
" float start;\n"
|
" float start;\n"
|
||||||
|
@ -63,6 +64,7 @@ static const char* LightingShadowGLSL =
|
||||||
"};\n"
|
"};\n"
|
||||||
"struct Fog\n"
|
"struct Fog\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
|
" uint mode;\n"
|
||||||
" vec4 color;\n"
|
" vec4 color;\n"
|
||||||
" float rangeScale;\n"
|
" float rangeScale;\n"
|
||||||
" float start;\n"
|
" float start;\n"
|
||||||
|
@ -118,8 +120,31 @@ static const char* LightingShadowGLSL =
|
||||||
static const char* MainPostGLSL =
|
static const char* MainPostGLSL =
|
||||||
"vec4 MainPostFunc(vec4 colorIn)\n"
|
"vec4 MainPostFunc(vec4 colorIn)\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" float fogZ = (-vtf.mvPos.z - fog.start) * fog.rangeScale;\n"
|
" float fogZ, temp;\n"
|
||||||
" return mix(fog.color, colorIn, clamp(exp2(-8.0 * fogZ), 0.0, 1.0));\n"
|
" switch (fog.mode)\n"
|
||||||
|
" {\n"
|
||||||
|
" case 2:\n"
|
||||||
|
" fogZ = (-vtf.mvPos.z - fog.start) * fog.rangeScale;\n"
|
||||||
|
" break;\n"
|
||||||
|
" case 4:\n"
|
||||||
|
" fogZ = 1.0 - exp2(-8.0 * (-vtf.mvPos.z - fog.start) * fog.rangeScale);\n"
|
||||||
|
" break;\n"
|
||||||
|
" case 5:\n"
|
||||||
|
" temp = (-vtf.mvPos.z - fog.start) * fog.rangeScale;\n"
|
||||||
|
" fogZ = 1.0 - exp2(-8.0 * temp * temp);\n"
|
||||||
|
" break;\n"
|
||||||
|
" case 6:\n"
|
||||||
|
" fogZ = exp2(-8.0 * (fog.start + vtf.mvPos.z) * fog.rangeScale);\n"
|
||||||
|
" break;\n"
|
||||||
|
" case 7:\n"
|
||||||
|
" temp = (fog.start + vtf.mvPos.z) * fog.rangeScale;\n"
|
||||||
|
" fogZ = exp2(-8.0 * temp * temp);\n"
|
||||||
|
" break;\n"
|
||||||
|
" default:\n"
|
||||||
|
" fogZ = 0.0;\n"
|
||||||
|
" break;\n"
|
||||||
|
" }\n"
|
||||||
|
" return mix(colorIn, fog.color, clamp(fogZ, 0.0, 1.0));\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n";
|
"\n";
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ static const char* LightingHLSL =
|
||||||
"};\n"
|
"};\n"
|
||||||
"struct Fog\n"
|
"struct Fog\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
|
" uint mode;\n"
|
||||||
" float4 color;\n"
|
" float4 color;\n"
|
||||||
" float rangeScale;\n"
|
" float rangeScale;\n"
|
||||||
" float start;\n"
|
" float start;\n"
|
||||||
|
@ -62,6 +63,7 @@ static const char* LightingShadowHLSL =
|
||||||
"};\n"
|
"};\n"
|
||||||
"struct Fog\n"
|
"struct Fog\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
|
" uint mode;\n"
|
||||||
" float4 color;\n"
|
" float4 color;\n"
|
||||||
" float rangeScale;\n"
|
" float rangeScale;\n"
|
||||||
" float start;\n"
|
" float start;\n"
|
||||||
|
@ -114,8 +116,31 @@ static const char* LightingShadowHLSL =
|
||||||
static const char* MainPostHLSL =
|
static const char* MainPostHLSL =
|
||||||
"static float4 MainPostFunc(in VertToFrag vtf, float4 colorIn)\n"
|
"static float4 MainPostFunc(in VertToFrag vtf, float4 colorIn)\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" float fogZ = (-vtf.mvPos.z - fog.start) * fog.rangeScale;\n"
|
" float fogZ, temp;\n"
|
||||||
" return lerp(fog.color, colorIn, saturate(exp2(-8.0 * fogZ)));\n"
|
" switch (fog.mode)\n"
|
||||||
|
" {\n"
|
||||||
|
" case 2:\n"
|
||||||
|
" fogZ = (-vtf.mvPos.z - fog.start) * fog.rangeScale;\n"
|
||||||
|
" break;\n"
|
||||||
|
" case 4:\n"
|
||||||
|
" fogZ = 1.0 - exp2(-8.0 * (-vtf.mvPos.z - fog.start) * fog.rangeScale);\n"
|
||||||
|
" break;\n"
|
||||||
|
" case 5:\n"
|
||||||
|
" temp = (-vtf.mvPos.z - fog.start) * fog.rangeScale;\n"
|
||||||
|
" fogZ = 1.0 - exp2(-8.0 * temp * temp);\n"
|
||||||
|
" break;\n"
|
||||||
|
" case 6:\n"
|
||||||
|
" fogZ = exp2(-8.0 * (fog.start + vtf.mvPos.z) * fog.rangeScale);\n"
|
||||||
|
" break;\n"
|
||||||
|
" case 7:\n"
|
||||||
|
" temp = (fog.start + vtf.mvPos.z) * fog.rangeScale;\n"
|
||||||
|
" fogZ = exp2(-8.0 * temp * temp);\n"
|
||||||
|
" break;\n"
|
||||||
|
" default:\n"
|
||||||
|
" fogZ = 0.0;\n"
|
||||||
|
" break;\n"
|
||||||
|
" }\n"
|
||||||
|
" return lerp(colorIn, fog.color, saturate(fogZ));\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n";
|
"\n";
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ static const char* LightingMetal =
|
||||||
"};\n"
|
"};\n"
|
||||||
"struct Fog\n"
|
"struct Fog\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
|
" uint mode;\n"
|
||||||
" float4 color;\n"
|
" float4 color;\n"
|
||||||
" float rangeScale;\n"
|
" float rangeScale;\n"
|
||||||
" float start;\n"
|
" float start;\n"
|
||||||
|
@ -62,6 +63,7 @@ static const char* LightingShadowMetal =
|
||||||
"};\n"
|
"};\n"
|
||||||
"struct Fog\n"
|
"struct Fog\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
|
" uint mode;\n"
|
||||||
" float4 color;\n"
|
" float4 color;\n"
|
||||||
" float rangeScale;\n"
|
" float rangeScale;\n"
|
||||||
" float start;\n"
|
" float start;\n"
|
||||||
|
@ -115,8 +117,31 @@ static const char* LightingShadowMetal =
|
||||||
static const char* MainPostMetal =
|
static const char* MainPostMetal =
|
||||||
"float4 MainPostFunc(thread VertToFrag& vtf, constant LightingUniform& lu, float4 colorIn)\n"
|
"float4 MainPostFunc(thread VertToFrag& vtf, constant LightingUniform& lu, float4 colorIn)\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" float fogZ = (-vtf.mvPos.z - lu.fog.start) * lu.fog.rangeScale;\n"
|
" float fogZ, temp;\n"
|
||||||
" return mix(lu.fog.color, colorIn, saturate(exp2(-8.0 * fogZ)));\n"
|
" switch (lu.fog.mode)\n"
|
||||||
|
" {\n"
|
||||||
|
" case 2:\n"
|
||||||
|
" fogZ = (-vtf.mvPos.z - lu.fog.start) * lu.fog.rangeScale;\n"
|
||||||
|
" break;\n"
|
||||||
|
" case 4:\n"
|
||||||
|
" fogZ = 1.0 - exp2(-8.0 * (-vtf.mvPos.z - lu.fog.start) * lu.fog.rangeScale);\n"
|
||||||
|
" break;\n"
|
||||||
|
" case 5:\n"
|
||||||
|
" temp = (-vtf.mvPos.z - lu.fog.start) * lu.fog.rangeScale;\n"
|
||||||
|
" fogZ = 1.0 - exp2(-8.0 * temp * temp);\n"
|
||||||
|
" break;\n"
|
||||||
|
" case 6:\n"
|
||||||
|
" fogZ = exp2(-8.0 * (lu.fog.start + vtf.mvPos.z) * lu.fog.rangeScale);\n"
|
||||||
|
" break;\n"
|
||||||
|
" case 7:\n"
|
||||||
|
" temp = (lu.fog.start + vtf.mvPos.z) * lu.fog.rangeScale;\n"
|
||||||
|
" fogZ = exp2(-8.0 * temp * temp);\n"
|
||||||
|
" break;\n"
|
||||||
|
" default:\n"
|
||||||
|
" fogZ = 0.0;\n"
|
||||||
|
" break;\n"
|
||||||
|
" }\n"
|
||||||
|
" return mix(colorIn, lu.fog.color, saturate(fogZ));\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n";
|
"\n";
|
||||||
|
|
||||||
|
|
|
@ -2006,7 +2006,7 @@ CFrontEndUI::CFrontEndUI()
|
||||||
|
|
||||||
m->ResetGameState();
|
m->ResetGameState();
|
||||||
g_GameState->SetCurrentWorldId(g_ResFactory->TranslateOriginalToNew(g_DefaultWorldTag.id));
|
g_GameState->SetCurrentWorldId(g_ResFactory->TranslateOriginalToNew(g_DefaultWorldTag.id));
|
||||||
g_GameState->CurrentWorldState().SetAreaId(1);
|
g_GameState->CurrentWorldState().SetAreaId(0);
|
||||||
g_GameState->GameOptions().ResetToDefaults();
|
g_GameState->GameOptions().ResetToDefaults();
|
||||||
g_GameState->WriteBackupBuf();
|
g_GameState->WriteBackupBuf();
|
||||||
|
|
||||||
|
|
|
@ -224,7 +224,7 @@ CElementGen::CElementGen(const TToken<CGenDescription>& gen,
|
||||||
tex = texr->GetValueTexture(0).GetObj()->GetBooTexture();
|
tex = texr->GetValueTexture(0).GetObj()->GetBooTexture();
|
||||||
int maxVerts = (x90_MAXP == 0 ? 256 : x90_MAXP);
|
int maxVerts = (x90_MAXP == 0 ? 256 : x90_MAXP);
|
||||||
m_lineRenderer.reset(new CLineRenderer(CLineRenderer::EPrimitiveMode::Lines,
|
m_lineRenderer.reset(new CLineRenderer(CLineRenderer::EPrimitiveMode::Lines,
|
||||||
maxVerts * 2, tex, x26c_26_AAPH));
|
maxVerts * 2, tex, x26c_26_AAPH, x26c_28_zTest));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -419,7 +419,7 @@ CGameArea::CGameArea(CInputStream& in, int idx, int mlvlVersion)
|
||||||
xf0_24_postConstructed = false;
|
xf0_24_postConstructed = false;
|
||||||
xf0_25_active = true;
|
xf0_25_active = true;
|
||||||
xf0_26_tokensReady = false;
|
xf0_26_tokensReady = false;
|
||||||
xf0_27_paused = false;
|
xf0_27_loadPaused = false;
|
||||||
xf0_28_validated = false;
|
xf0_28_validated = false;
|
||||||
x8_nameSTRG = in.readUint32Big();
|
x8_nameSTRG = in.readUint32Big();
|
||||||
xc_transform.read34RowMajor(in);
|
xc_transform.read34RowMajor(in);
|
||||||
|
@ -470,7 +470,7 @@ CGameArea::CGameArea(CAssetId mreaId)
|
||||||
xf0_24_postConstructed = false;
|
xf0_24_postConstructed = false;
|
||||||
xf0_25_active = false;
|
xf0_25_active = false;
|
||||||
xf0_26_tokensReady = false;
|
xf0_26_tokensReady = false;
|
||||||
xf0_27_paused = false;
|
xf0_27_loadPaused = false;
|
||||||
xf0_28_validated = false;
|
xf0_28_validated = false;
|
||||||
|
|
||||||
while (StartStreamingMainArea())
|
while (StartStreamingMainArea())
|
||||||
|
@ -552,11 +552,11 @@ const zeus::CTransform& CGameArea::IGetTM() const
|
||||||
return xc_transform;
|
return xc_transform;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameArea::SetPauseState(bool paused)
|
void CGameArea::SetLoadPauseState(bool paused)
|
||||||
{
|
{
|
||||||
if (xf0_26_tokensReady)
|
if (xf0_26_tokensReady)
|
||||||
return;
|
return;
|
||||||
xf0_27_paused = paused;
|
xf0_27_loadPaused = paused;
|
||||||
if (!paused)
|
if (!paused)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -982,7 +982,7 @@ void CGameArea::CullDeadAreaRequests()
|
||||||
|
|
||||||
void CGameArea::StartStreamIn(CStateManager& mgr)
|
void CGameArea::StartStreamIn(CStateManager& mgr)
|
||||||
{
|
{
|
||||||
if (xf0_24_postConstructed || xf0_27_paused)
|
if (xf0_24_postConstructed || xf0_27_loadPaused)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
VerifyTokenList(mgr);
|
VerifyTokenList(mgr);
|
||||||
|
|
|
@ -120,7 +120,7 @@ class CGameArea final : public IGameArea
|
||||||
bool xf0_24_postConstructed : 1;
|
bool xf0_24_postConstructed : 1;
|
||||||
bool xf0_25_active : 1;
|
bool xf0_25_active : 1;
|
||||||
bool xf0_26_tokensReady : 1;
|
bool xf0_26_tokensReady : 1;
|
||||||
bool xf0_27_paused : 1;
|
bool xf0_27_loadPaused : 1;
|
||||||
bool xf0_28_validated : 1;
|
bool xf0_28_validated : 1;
|
||||||
|
|
||||||
enum class EPhase
|
enum class EPhase
|
||||||
|
@ -285,7 +285,7 @@ public:
|
||||||
|
|
||||||
bool IsFinishedOccluding() const;
|
bool IsFinishedOccluding() const;
|
||||||
void ReadDependencyList();
|
void ReadDependencyList();
|
||||||
void SetPauseState(bool paused);
|
void SetLoadPauseState(bool paused);
|
||||||
|
|
||||||
std::pair<std::unique_ptr<u8[]>, s32> IGetScriptingMemoryAlways() const;
|
std::pair<std::unique_ptr<u8[]>, s32> IGetScriptingMemoryAlways() const;
|
||||||
TAreaId GetAreaId() const { return x4_selfIdx; }
|
TAreaId GetAreaId() const { return x4_selfIdx; }
|
||||||
|
|
|
@ -142,7 +142,7 @@ void CPhysicsActor::SetMass(float mass)
|
||||||
tensor = 1.0f / mass;
|
tensor = 1.0f / mass;
|
||||||
|
|
||||||
xec_massRecip = tensor;
|
xec_massRecip = tensor;
|
||||||
SetInertiaTensorScalar(mass * tensor);
|
SetInertiaTensorScalar(mass / 6.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPhysicsActor::SetAngularVelocityOR(const zeus::CAxisAngle& angVel)
|
void CPhysicsActor::SetAngularVelocityOR(const zeus::CAxisAngle& angVel)
|
||||||
|
|
|
@ -130,7 +130,7 @@ void CScriptPlayerActor::PumpBeamModel(CStateManager& mgr)
|
||||||
return;
|
return;
|
||||||
BuildBeamModelData();
|
BuildBeamModelData();
|
||||||
x314_beamModelData->Touch(mgr, 0);
|
x314_beamModelData->Touch(mgr, 0);
|
||||||
mgr.WorldNC()->CyclePauseState();
|
mgr.WorldNC()->CycleLoadPauseState();
|
||||||
x31c_beamModel = TLockedToken<CModel>();
|
x31c_beamModel = TLockedToken<CModel>();
|
||||||
x354_27_beamModelLoading = false;
|
x354_27_beamModelLoading = false;
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,7 @@ void CScriptPlayerActor::PumpSuitModel(CStateManager& mgr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
x320_suitModel->Touch(0);
|
x320_suitModel->Touch(0);
|
||||||
mgr.WorldNC()->CyclePauseState();
|
mgr.WorldNC()->CycleLoadPauseState();
|
||||||
|
|
||||||
bool didSetup = false;
|
bool didSetup = false;
|
||||||
if (x354_26_deferOfflineModelData)
|
if (x354_26_deferOfflineModelData)
|
||||||
|
|
|
@ -210,7 +210,7 @@ void CScriptSound::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CSta
|
||||||
|
|
||||||
void CScriptSound::PlaySound(CStateManager& mgr)
|
void CScriptSound::PlaySound(CStateManager& mgr)
|
||||||
{
|
{
|
||||||
if ((x11d_24_allowDuplicates || !xec_sfxHandle) && !x11d_25_processedThisFrame)
|
if ((x11d_24_allowDuplicates || !xec_sfxHandle || !xec_sfxHandle->IsPlaying()) && !x11d_25_processedThisFrame)
|
||||||
{
|
{
|
||||||
x11d_25_processedThisFrame = true;
|
x11d_25_processedThisFrame = true;
|
||||||
if (x11c_26_nonEmitter)
|
if (x11c_26_nonEmitter)
|
||||||
|
|
|
@ -93,7 +93,7 @@ void CScriptWorldTeleporter::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId
|
||||||
case EScriptObjectMessage::SetToZero:
|
case EScriptObjectMessage::SetToZero:
|
||||||
{
|
{
|
||||||
const auto& world = mgr.WorldNC();
|
const auto& world = mgr.WorldNC();
|
||||||
world->SetPauseState(true);
|
world->SetLoadPauseState(true);
|
||||||
CAssetId currentWorld = g_GameState->CurrentWorldAssetId();
|
CAssetId currentWorld = g_GameState->CurrentWorldAssetId();
|
||||||
|
|
||||||
if (g_ResFactory->GetResourceTypeById(currentWorld) == SBIG('MLVL'))
|
if (g_ResFactory->GetResourceTypeById(currentWorld) == SBIG('MLVL'))
|
||||||
|
|
|
@ -557,25 +557,25 @@ void CWorld::TravelToArea(TAreaId aid, CStateManager& mgr, bool skipLoadOther)
|
||||||
++toStreamCount;
|
++toStreamCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!toStreamCount && otherLoadArea && !x70_25_paused)
|
if (!toStreamCount && otherLoadArea && !x70_25_loadPaused)
|
||||||
otherLoadArea->StartStreamIn(mgr);
|
otherLoadArea->StartStreamIn(mgr);
|
||||||
|
|
||||||
x28_mapWorld->SetWhichMapAreasLoaded(*this, aid, 3);
|
x28_mapWorld->SetWhichMapAreasLoaded(*this, aid, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWorld::SetPauseState(bool paused)
|
void CWorld::SetLoadPauseState(bool paused)
|
||||||
{
|
{
|
||||||
for (auto it = GetChainHead(EChain::Loading) ; it != AliveAreasEnd() ; ++it)
|
for (auto it = GetChainHead(EChain::Loading) ; it != AliveAreasEnd() ; ++it)
|
||||||
it->SetPauseState(paused);
|
it->SetLoadPauseState(paused);
|
||||||
x70_25_paused = paused;
|
x70_25_loadPaused = paused;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWorld::CyclePauseState()
|
void CWorld::CycleLoadPauseState()
|
||||||
{
|
{
|
||||||
if (!x70_25_paused)
|
if (!x70_25_loadPaused)
|
||||||
{
|
{
|
||||||
SetPauseState(true);
|
SetLoadPauseState(true);
|
||||||
SetPauseState(false);
|
SetLoadPauseState(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ private:
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
bool x70_24_currentAreaNeedsAllocation : 1;
|
bool x70_24_currentAreaNeedsAllocation : 1;
|
||||||
bool x70_25_paused : 1;
|
bool x70_25_loadPaused : 1;
|
||||||
bool x70_26_skyboxActive : 1;
|
bool x70_26_skyboxActive : 1;
|
||||||
bool x70_27_skyboxVisible : 1;
|
bool x70_27_skyboxVisible : 1;
|
||||||
};
|
};
|
||||||
|
@ -169,8 +169,8 @@ public:
|
||||||
CGameArea::CConstChainIterator end() const { return GetAliveAreasEnd(); }
|
CGameArea::CConstChainIterator end() const { return GetAliveAreasEnd(); }
|
||||||
bool ScheduleAreaToLoad(CGameArea* area, CStateManager& mgr);
|
bool ScheduleAreaToLoad(CGameArea* area, CStateManager& mgr);
|
||||||
void TravelToArea(TAreaId aid, CStateManager& mgr, bool);
|
void TravelToArea(TAreaId aid, CStateManager& mgr, bool);
|
||||||
void SetPauseState(bool paused);
|
void SetLoadPauseState(bool paused);
|
||||||
void CyclePauseState();
|
void CycleLoadPauseState();
|
||||||
|
|
||||||
CWorld(IObjectStore& objStore, IFactory& resFactory, CAssetId mlvlId);
|
CWorld(IObjectStore& objStore, IFactory& resFactory, CAssetId mlvlId);
|
||||||
~CWorld();
|
~CWorld();
|
||||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
||||||
Subproject commit 2255856884b53bbc126d5dfc70723f4be193613d
|
Subproject commit 419a51e5cd341bbf109c0431737c7f89e27ac129
|
2
nod
2
nod
|
@ -1 +1 @@
|
||||||
Subproject commit d5f5db440cc266700bd59397b3a3b4a4596b87aa
|
Subproject commit 4d9071bad75f0f8de94777052cec6bfd5e1e585c
|
Loading…
Reference in New Issue