Scan visor fixes

This commit is contained in:
Jack Andersen 2018-05-07 19:10:24 -10:00
parent 81d2276458
commit 1c977e8021
28 changed files with 197 additions and 36 deletions

View File

@ -11,8 +11,8 @@ struct ITweakTargeting : public ITweak
virtual float GetCurrLockOnEnterDuration() const=0;
virtual float GetCurrLockOnSwitchDuration() const=0;
virtual float GetLockConfirmScale() const=0;
virtual float GetNextLockOnExitDuration() const=0;
virtual float GetNextLockOnEnterDuration() const=0;
virtual float GetNextLockOnExitDuration() const=0;
virtual float GetNextLockOnSwitchDuration() const=0;
virtual float GetSeekerScale() const=0;
virtual float GetSeekerAngleSpeed() const=0;

View File

@ -185,7 +185,7 @@ struct CTweakGui final : ITweakGui
Value<float> x364_;
CTweakGui() = default;
CTweakGui(athena::io::IStreamReader& r) { this->read(r); }
CTweakGui(athena::io::IStreamReader& r) { this->read(r); FixupValues(); }
float GetMapAlphaInterpolant() const { return x8_mapAlphaInterp; }
float GetPauseBlurFactor() const { return xc_pauseBlurFactor; }

View File

@ -13,8 +13,8 @@ struct CTweakTargeting final : public ITweakTargeting
Value<float> xc_currLockOnEnterDuration;
Value<float> x10_currLockOnSwitchDuration;
Value<float> x14_lockConfirmScale;
Value<float> x18_nextLockOnExitDuration;
Value<float> x1c_nextLockOnEnterDuration;
Value<float> x18_nextLockOnEnterDuration;
Value<float> x1c_nextLockOnExitDuration;
Value<float> x20_nextLockOnSwitchDuration;
Value<float> x24_seekerScale;
Value<float> x28_seekerAngleSpeed;
@ -157,8 +157,8 @@ struct CTweakTargeting final : public ITweakTargeting
float GetCurrLockOnEnterDuration() const { return xc_currLockOnEnterDuration; }
float GetCurrLockOnSwitchDuration() const { return x10_currLockOnSwitchDuration; }
float GetLockConfirmScale() const { return x14_lockConfirmScale; }
float GetNextLockOnExitDuration() const { return x18_nextLockOnExitDuration; }
float GetNextLockOnEnterDuration() const { return x1c_nextLockOnEnterDuration; }
float GetNextLockOnEnterDuration() const { return x18_nextLockOnEnterDuration; }
float GetNextLockOnExitDuration() const { return x1c_nextLockOnExitDuration; }
float GetNextLockOnSwitchDuration() const { return x20_nextLockOnSwitchDuration; }
float GetSeekerScale() const { return x24_seekerScale; }
float GetSeekerAngleSpeed() const { return x28_seekerAngleSpeed; }

View File

@ -299,7 +299,7 @@ bool ViewManager::proc()
gfxQ->execute();
if (g_ResFactory)
g_ResFactory->AsyncIdle();
if (!m_skipWait && hecl::com_developer->toBoolean())
if (!m_skipWait || !hecl::com_developer->toBoolean())
m_mainWindow->waitForRetrace(m_voiceEngine.get());
CBooModel::ClearModelUniformCounters();
CGraphics::TickRenderTimings();

View File

@ -326,6 +326,8 @@ void CNESEmulator::DeinitializeEmulator()
CNESEmulator::~CNESEmulator()
{
if (m_dvdReq)
m_dvdReq->PostCancelRequest();
if (EmulatorInst)
DeinitializeEmulator();
if (emuNesROM)

View File

@ -15,6 +15,12 @@ CPakFile::CPakFile(std::string_view filename, bool buildDepList, bool worldPak)
x28_27_stashedInARAM = false;
}
CPakFile::~CPakFile()
{
if (x30_dvdReq)
x30_dvdReq->PostCancelRequest();
}
const SObjectTag* CPakFile::GetResIdByName(std::string_view name) const
{
for (const std::pair<std::string, SObjectTag>& p : x54_nameList)

View File

@ -70,6 +70,7 @@ private:
void Warmup();
public:
CPakFile(std::string_view filename, bool buildDepList, bool worldPak);
~CPakFile();
const std::vector<std::pair<std::string, SObjectTag>>& GetNameList() const { return x54_nameList; }
const std::vector<CAssetId>& GetDepList() const { return x64_depList; }
const SObjectTag* GetResIdByName(std::string_view name) const;

View File

@ -38,8 +38,9 @@ CFactoryFnReturn CResFactory::BuildSync(const SObjectTag& tag, const CVParamTran
bool CResFactory::PumpResource(SLoadingData& data)
{
if (data.x8_dvdReq->IsComplete())
if (data.x8_dvdReq && data.x8_dvdReq->IsComplete())
{
data.x8_dvdReq.reset();
*data.xc_targetPtr =
x5c_factoryMgr.MakeObjectFromMemory(data.x0_tag, std::move(data.x10_loadBuffer),
data.x14_resSize, data.m_compressed, data.x18_cvXfer,
@ -109,7 +110,8 @@ void CResFactory::CancelBuild(const SObjectTag& tag)
auto search = m_loadMap.find(tag);
if (search != m_loadMap.end())
{
search->second->x8_dvdReq->PostCancelRequest();
if (search->second->x8_dvdReq)
search->second->x8_dvdReq->PostCancelRequest();
m_loadList.erase(search->second);
m_loadMap.erase(search);
}

View File

@ -24,7 +24,8 @@ hecl::UniformBufferPool<CLineRenderer::SDrawUniform> CLineRenderer::s_uniformPoo
CLineRenderer::CLineRenderer(boo::IGraphicsDataFactory::Context& ctx,
EPrimitiveMode mode, u32 maxVerts,
const boo::ObjToken<boo::ITexture>& texture, bool additive)
const boo::ObjToken<boo::ITexture>& texture,
bool additive, bool zTest)
: m_mode(mode), m_maxVerts(maxVerts)
{
if (maxVerts < 2)
@ -55,11 +56,12 @@ CLineRenderer::CLineRenderer(boo::IGraphicsDataFactory::Context& ctx,
m_uniformBuf = s_uniformPool.allocateBlock(CGraphics::g_BooFactory);
CLineRendererShaders::BuildShaderDataBinding(ctx, *this, texture, additive);
CLineRendererShaders::BuildShaderDataBinding(ctx, *this, texture, additive, zTest);
}
CLineRenderer::CLineRenderer(EPrimitiveMode mode, u32 maxVerts,
const boo::ObjToken<boo::ITexture>& texture, bool additive)
const boo::ObjToken<boo::ITexture>& texture,
bool additive, bool zTest)
: m_mode(mode), m_maxVerts(maxVerts)
{
if (maxVerts < 2)
@ -90,9 +92,9 @@ CLineRenderer::CLineRenderer(EPrimitiveMode mode, u32 maxVerts,
m_uniformBuf = s_uniformPool.allocateBlock(CGraphics::g_BooFactory);
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) -> bool
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx)
{
CLineRendererShaders::BuildShaderDataBinding(ctx, *this, texture, additive);
CLineRendererShaders::BuildShaderDataBinding(ctx, *this, texture, additive, zTest);
return true;
});
}

View File

@ -73,8 +73,10 @@ public:
boo::ObjToken<boo::IShaderDataBinding> m_shaderBind;
CLineRenderer(boo::IGraphicsDataFactory::Context& ctx,
EPrimitiveMode mode, u32 maxVerts, const boo::ObjToken<boo::ITexture>& texture, bool additive);
CLineRenderer(EPrimitiveMode mode, u32 maxVerts, const boo::ObjToken<boo::ITexture>& texture, bool additive);
EPrimitiveMode mode, u32 maxVerts, const boo::ObjToken<boo::ITexture>& texture,
bool additive, bool zTest = false);
CLineRenderer(EPrimitiveMode mode, u32 maxVerts, const boo::ObjToken<boo::ITexture>& texture,
bool additive, bool zTest = false);
CLineRenderer(CLineRenderer&&) = default;
void Reset();

View File

@ -9,6 +9,12 @@ boo::ObjToken<boo::IShaderPipeline> CLineRendererShaders::m_texAdditive;
boo::ObjToken<boo::IShaderPipeline> CLineRendererShaders::m_noTexAlpha;
boo::ObjToken<boo::IShaderPipeline> CLineRendererShaders::m_noTexAdditive;
boo::ObjToken<boo::IShaderPipeline> CLineRendererShaders::m_texAlphaZ;
boo::ObjToken<boo::IShaderPipeline> CLineRendererShaders::m_texAdditiveZ;
boo::ObjToken<boo::IShaderPipeline> CLineRendererShaders::m_noTexAlphaZ;
boo::ObjToken<boo::IShaderPipeline> CLineRendererShaders::m_noTexAdditiveZ;
boo::ObjToken<boo::IVertexFormat> CLineRendererShaders::m_texVtxFmt;
boo::ObjToken<boo::IVertexFormat> CLineRendererShaders::m_noTexVtxFmt;
@ -57,6 +63,10 @@ void CLineRendererShaders::Shutdown()
m_texAdditive.reset();
m_noTexAlpha.reset();
m_noTexAdditive.reset();
m_texAlphaZ.reset();
m_texAdditiveZ.reset();
m_noTexAlphaZ.reset();
m_noTexAdditiveZ.reset();
m_texVtxFmt.reset();
m_noTexVtxFmt.reset();
}
@ -64,22 +74,42 @@ void CLineRendererShaders::Shutdown()
void CLineRendererShaders::BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
CLineRenderer& renderer,
const boo::ObjToken<boo::ITexture>& texture,
bool additive)
bool additive, bool zTest)
{
boo::ObjToken<boo::IShaderPipeline> pipeline;
if (texture)
if (zTest)
{
if (additive)
pipeline = m_texAdditive;
if (texture)
{
if (additive)
pipeline = m_texAdditiveZ;
else
pipeline = m_texAlphaZ;
}
else
pipeline = m_texAlpha;
{
if (additive)
pipeline = m_noTexAdditiveZ;
else
pipeline = m_noTexAlphaZ;
}
}
else
{
if (additive)
pipeline = m_noTexAdditive;
if (texture)
{
if (additive)
pipeline = m_texAdditive;
else
pipeline = m_texAlpha;
}
else
pipeline = m_noTexAlpha;
{
if (additive)
pipeline = m_noTexAdditive;
else
pipeline = m_noTexAlpha;
}
}
m_bindFactory->BuildShaderDataBinding(ctx, renderer, pipeline, texture);

View File

@ -30,6 +30,12 @@ private:
static boo::ObjToken<boo::IShaderPipeline> m_noTexAlpha;
static boo::ObjToken<boo::IShaderPipeline> m_noTexAdditive;
static boo::ObjToken<boo::IShaderPipeline> m_texAlphaZ;
static boo::ObjToken<boo::IShaderPipeline> m_texAdditiveZ;
static boo::ObjToken<boo::IShaderPipeline> m_noTexAlphaZ;
static boo::ObjToken<boo::IShaderPipeline> m_noTexAdditiveZ;
static boo::ObjToken<boo::IVertexFormat> m_texVtxFmt;
static boo::ObjToken<boo::IVertexFormat> m_noTexVtxFmt;
@ -52,7 +58,7 @@ public:
static void Initialize();
static void Shutdown();
static void BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, CLineRenderer& renderer,
const boo::ObjToken<boo::ITexture>& texture, bool additive);
const boo::ObjToken<boo::ITexture>& texture, bool additive, bool zTest);
};
}

View File

@ -160,6 +160,23 @@ CLineRendererShaders::IDataBindingFactory* CLineRendererShaders::Initialize(boo:
boo::Primitive::TriStrips, boo::ZTest::None,
false, true, false, boo::CullMode::None);
m_texAlphaZ = ctx.newShaderPipeline(VS_GLSL_TEX, FS_GLSL_TEX, 1, TexNames, 1, UniNames,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
boo::Primitive::TriStrips, boo::ZTest::LEqual,
false, true, false, boo::CullMode::None);
m_texAdditiveZ = ctx.newShaderPipeline(VS_GLSL_TEX, FS_GLSL_TEX, 1, TexNames, 1, UniNames,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
boo::Primitive::TriStrips, boo::ZTest::LEqual,
false, true, false, boo::CullMode::None);
m_noTexAlphaZ = ctx.newShaderPipeline(VS_GLSL_NOTEX, FS_GLSL_NOTEX, 0, nullptr, 1, UniNames,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
boo::Primitive::TriStrips, boo::ZTest::LEqual,
false, true, false, boo::CullMode::None);
m_noTexAdditiveZ = ctx.newShaderPipeline(VS_GLSL_NOTEX, FS_GLSL_NOTEX, 0, nullptr, 1, UniNames,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
boo::Primitive::TriStrips, boo::ZTest::LEqual,
false, true, false, boo::CullMode::None);
return new struct OGLLineDataBindingFactory;
}
@ -235,6 +252,23 @@ CLineRendererShaders::IDataBindingFactory* CLineRendererShaders::Initialize(boo:
boo::Primitive::TriStrips, boo::ZTest::None,
false, true, false, boo::CullMode::None);
m_texAlphaZ = ctx.newShaderPipeline(VS_GLSL_TEX, FS_GLSL_TEX, m_texVtxFmt,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
boo::Primitive::TriStrips, boo::ZTest::LEqual,
false, true, false, boo::CullMode::None);
m_texAdditiveZ = ctx.newShaderPipeline(VS_GLSL_TEX, FS_GLSL_TEX, m_texVtxFmt,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
boo::Primitive::TriStrips, boo::ZTest::LEqual,
false, true, false, boo::CullMode::None);
m_noTexAlphaZ = ctx.newShaderPipeline(VS_GLSL_NOTEX, FS_GLSL_NOTEX, m_noTexVtxFmt,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
boo::Primitive::TriStrips, boo::ZTest::LEqual,
false, true, false, boo::CullMode::None);
m_noTexAdditiveZ = ctx.newShaderPipeline(VS_GLSL_NOTEX, FS_GLSL_NOTEX, m_noTexVtxFmt,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
boo::Primitive::TriStrips, boo::ZTest::LEqual,
false, true, false, boo::CullMode::None);
return new struct VulkanLineDataBindingFactory;
}
#endif

View File

@ -161,6 +161,27 @@ CLineRendererShaders::IDataBindingFactory* CLineRendererShaders::Initialize(boo:
boo::Primitive::TriStrips, boo::ZTest::None,
false, true, false, boo::CullMode::None);
m_texAlphaZ = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, nullptr, nullptr,
nullptr, m_texVtxFmt,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
boo::Primitive::TriStrips, boo::ZTest::LEqual,
false, true, false, boo::CullMode::None);
m_texAdditiveZ = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, nullptr, nullptr,
nullptr, m_texVtxFmt,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
boo::Primitive::TriStrips, boo::ZTest::LEqual,
false, true, false, boo::CullMode::None);
m_noTexAlphaZ = ctx.newShaderPipeline(VS_HLSL_NOTEX, FS_HLSL_NOTEX, nullptr, nullptr,
nullptr, m_noTexVtxFmt,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
boo::Primitive::TriStrips, boo::ZTest::LEqual,
false, true, false, boo::CullMode::None);
m_noTexAdditiveZ = ctx.newShaderPipeline(VS_HLSL_NOTEX, FS_HLSL_NOTEX, nullptr, nullptr,
nullptr, m_noTexVtxFmt,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
boo::Primitive::TriStrips, boo::ZTest::LEqual,
false, true, false, boo::CullMode::None);
return new struct HLSLLineDataBindingFactory;
}

View File

@ -173,6 +173,23 @@ CLineRendererShaders::IDataBindingFactory* CLineRendererShaders::Initialize(boo:
boo::Primitive::TriStrips, boo::ZTest::None,
false, true, false, boo::CullMode::None);
m_texAlphaZ = ctx.newShaderPipeline(VS_METAL_TEX, FS_METAL_TEX, nullptr, nullptr, m_texVtxFmt,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
boo::Primitive::TriStrips, boo::ZTest::LEqual,
false, true, false, boo::CullMode::None);
m_texAdditiveZ = ctx.newShaderPipeline(VS_METAL_TEX, FS_METAL_TEX, nullptr, nullptr, m_texVtxFmt,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
boo::Primitive::TriStrips, boo::ZTest::LEqual,
false, true, false, boo::CullMode::None);
m_noTexAlphaZ = ctx.newShaderPipeline(VS_METAL_NOTEX, FS_METAL_NOTEX, nullptr, nullptr, m_noTexVtxFmt,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
boo::Primitive::TriStrips, boo::ZTest::LEqual,
false, true, false, boo::CullMode::None);
m_noTexAdditiveZ = ctx.newShaderPipeline(VS_METAL_NOTEX, FS_METAL_NOTEX, nullptr, nullptr, m_noTexVtxFmt,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::One,
boo::Primitive::TriStrips, boo::ZTest::LEqual,
false, true, false, boo::CullMode::None);
return new struct MetalLineDataBindingFactory;
}

View File

@ -59,9 +59,9 @@ CCompoundTargetReticle::SScanReticuleRenderer::SScanReticuleRenderer()
{
for (int i=0 ; i<2 ; ++i)
{
m_lineRenderers[i].emplace(ctx, CLineRenderer::EPrimitiveMode::Lines, 8, nullptr, true);
m_lineRenderers[i].emplace(ctx, CLineRenderer::EPrimitiveMode::Lines, 8, nullptr, true, true);
for (int j=0 ; j<4 ; ++j)
m_stripRenderers[i][j].emplace(ctx, CLineRenderer::EPrimitiveMode::LineStrip, 4, nullptr, true);
m_stripRenderers[i][j].emplace(ctx, CLineRenderer::EPrimitiveMode::LineStrip, 4, nullptr, true, true);
}
return true;
});
@ -415,13 +415,13 @@ void CCompoundTargetReticle::UpdateNextLockOnGroup(float dt, const CStateManager
nextTargetId = mgr.GetPlayer().GetOrbitTargetId();
if (nextTargetId != xf2_nextTargetId)
{
if (xf2_nextTargetId == kInvalidUniqueId)
if (nextTargetId == kInvalidUniqueId)
{
x194_nextGroupA = x174_nextGroupInterp;
x1b4_nextGroupB = CTargetReticleRenderState(kInvalidUniqueId, 1.f,
(x20_prevState == EReticleState::XRay || x20_prevState == EReticleState::Thermal) ?
x100_laggingTargetPos : xf4_targetPos, 0.f, 1.f, true);
x1d4_nextGroupDur = x1d8_nextGroupTimer = g_tweakTargeting->GetNextLockOnEnterDuration();
x1d4_nextGroupDur = x1d8_nextGroupTimer = g_tweakTargeting->GetNextLockOnExitDuration();
xf2_nextTargetId = nextTargetId;
}
else
@ -430,7 +430,7 @@ void CCompoundTargetReticle::UpdateNextLockOnGroup(float dt, const CStateManager
x1b4_nextGroupB = CTargetReticleRenderState(nextTargetId, 1.f, zeus::CVector3f::skZero, 1.f,
IsGrappleTarget(nextTargetId, mgr) ? g_tweakTargeting->GetGrappleMinClampScale() : 1.f, true);
x1d4_nextGroupDur = x1d8_nextGroupTimer = xf2_nextTargetId == kInvalidUniqueId ?
g_tweakTargeting->GetNextLockOnExitDuration() :
g_tweakTargeting->GetNextLockOnEnterDuration() :
g_tweakTargeting->GetNextLockOnSwitchDuration();
xf2_nextTargetId = nextTargetId;
}

View File

@ -199,6 +199,7 @@ void CHudDecoInterfaceScan::SetFrameColorValue(float v)
void CHudDecoInterfaceScan::InitializeFlatFrame()
{
x10_loadedScanHudFlat = x4_scanHudFlat.GetObj();
x10_loadedScanHudFlat->SetMaxAspect(1.33f);
x10_loadedScanHudFlat->GetFrameCamera()->SetO2WTransform(zeus::CTransform::Translate(x20c_camPos));
x258_flat_basewidget_scanguage = x10_loadedScanHudFlat->FindWidget("basewidget_scanguage");
x258_flat_basewidget_scanguage->SetVisibility(false, ETraversalMode::Children);

View File

@ -109,6 +109,8 @@ class CRasterFont
if (chr == xc_glyphs[i].first)
break;
if (i == xc_glyphs.size())
return nullptr;
return &xc_glyphs[i].second;
}

View File

@ -81,6 +81,7 @@ CScanDisplay::CScanDisplay(const CGuiFrame& selHud)
x0_dataDot = g_SimplePool->GetObj("TXTR_DataDot");
for (int i=0 ; i<4 ; ++i)
xbc_dataDots.emplace_back(x0_dataDot);
x170_paneStates.resize(4);
}
void CScanDisplay::ProcessInput(const CFinalInput& input)
@ -340,10 +341,13 @@ void CScanDisplay::Update(float dt, float scanningTime)
if (x1b4_scanComplete || x14_scannableInfo->GetCategory() == 0)
{
xc_state = EScanState::ViewingScan;
x1b0_aPulse = x1a4_xAlpha = 1.f;
CSfxManager::SfxStart(1417, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);
}
else
{
xc_state = EScanState::DownloadComplete;
x1b0_aPulse = x1a4_xAlpha = 1.f;
xa8_message->TextSupport().SetText(std::u16string(g_MainStringTable->GetString(29)) +
g_MainStringTable->GetString(x14_scannableInfo->GetCategory() + 30) +
g_MainStringTable->GetString(30));

View File

@ -36,6 +36,12 @@ CGBASupport::CGBASupport()
x30_dvdReq = AsyncRead(x2c_buffer.get(), x28_fileSize);
}
CGBASupport::~CGBASupport()
{
if (x30_dvdReq)
x30_dvdReq->PostCancelRequest();
}
u8 CGBASupport::CalculateFusionJBusChecksum(const u8* data, size_t len)
{
u32 sum = -1;

View File

@ -40,6 +40,7 @@ public:
static void GlobalPoll();
CGBASupport();
~CGBASupport();
bool PollResponse();
void Update(float dt);
bool IsReady();

View File

@ -29,6 +29,12 @@ CPauseScreen::CPauseScreen(ESubScreen subscreen,
x7c_screens.resize(2);
}
CPauseScreen::~CPauseScreen()
{
if (x60_loadTok)
x60_loadTok->PostCancelRequest();
}
std::unique_ptr<CPauseScreenBase> CPauseScreen::BuildPauseSubScreen(ESubScreen subscreen,
const CStateManager& mgr,
CGuiFrame& frame) const

View File

@ -64,6 +64,7 @@ private:
void TransitionComplete();
public:
CPauseScreen(ESubScreen subscreen, const CDependencyGroup& suitDgrp, const CDependencyGroup& ballDgrp);
~CPauseScreen();
void ProcessControllerInput(const CStateManager& mgr, const CFinalInput& input);
void Update(float dt, const CStateManager& mgr, CRandom16& rand, CArchitectureQueue& archQueue);
void PreDraw();

View File

@ -495,6 +495,9 @@ CGameArea::CGameArea(CAssetId mreaId)
CGameArea::~CGameArea()
{
for (auto& lt : xf8_loadTransactions)
lt->PostCancelRequest();
if (xf0_24_postConstructed)
RemoveStaticGeometry();
else

View File

@ -4674,7 +4674,7 @@ TUniqueId CPlayer::FindBestOrbitableObject(const std::vector<TUniqueId>& ids,
mgr.GetPlayerState()->GetCurrentVisor() != CPlayerState::EPlayerVisor::Scan)
{
rstl::reserved_vector<TUniqueId, 1024> nearList;
TUniqueId bestId = kInvalidUniqueId;
TUniqueId idOut = kInvalidUniqueId;
eyeToOrbit.normalize();
mgr.BuildNearList(nearList, eyePos, eyeToOrbit, eyeToOrbitMag,
OccluderFilter, act.GetPtr());
@ -4708,7 +4708,7 @@ TUniqueId CPlayer::FindBestOrbitableObject(const std::vector<TUniqueId>& ids,
eyeToOrbit.normalize();
CRayCastResult result =
mgr.RayWorldIntersection(bestId, eyePos, eyeToOrbit, eyeToOrbitMag,
mgr.RayWorldIntersection(idOut, eyePos, eyeToOrbit, eyeToOrbitMag,
LineOfSightFilter, nearList);
if (result.IsInvalid())
{
@ -4730,7 +4730,7 @@ TUniqueId CPlayer::FindBestOrbitableObject(const std::vector<TUniqueId>& ids,
if (posInBoxMagSq < minPosInBoxMagSq)
{
rstl::reserved_vector<TUniqueId, 1024> nearList;
TUniqueId bestId = kInvalidUniqueId;
TUniqueId idOut = kInvalidUniqueId;
eyeToOrbit.normalize();
mgr.BuildNearList(nearList, eyePos, eyeToOrbit, eyeToOrbitMag,
OccluderFilter, act.GetPtr());
@ -4765,7 +4765,7 @@ TUniqueId CPlayer::FindBestOrbitableObject(const std::vector<TUniqueId>& ids,
eyeToOrbit.normalize();
CRayCastResult result =
mgr.RayWorldIntersection(bestId, eyePos, eyeToOrbit, eyeToOrbitMag,
mgr.RayWorldIntersection(idOut, eyePos, eyeToOrbit, eyeToOrbitMag,
LineOfSightFilter, nearList);
if (result.IsInvalid())
{
@ -4960,6 +4960,8 @@ void CPlayer::UpdateOrbitInput(const CFinalInput& input, CStateManager& mgr)
}
else
{
#else
m_deferredOrbitObject = ControlMapper::GetPressInput(ControlMapper::ECommands::OrbitObject, input);
#endif
if (ControlMapper::GetPressInput(ControlMapper::ECommands::OrbitFar, input))
OrbitPoint(EPlayerOrbitType::Far, mgr);
@ -4996,8 +4998,9 @@ void CPlayer::UpdateOrbitInput(const CFinalInput& input, CStateManager& mgr)
UpdateOrbitSelection(input, mgr);
break;
case EPlayerOrbitState::OrbitPoint:
if (ControlMapper::GetPressInput(ControlMapper::ECommands::OrbitObject, input))
if (ControlMapper::GetPressInput(ControlMapper::ECommands::OrbitObject, input) || m_deferredOrbitObject)
{
m_deferredOrbitObject = false;
SetOrbitTargetId(FindOrbitTargetId(mgr), mgr);
if (x310_orbitTargetId != kInvalidUniqueId)
{
@ -5033,8 +5036,9 @@ void CPlayer::UpdateOrbitInput(const CFinalInput& input, CStateManager& mgr)
UpdateOrbitPosition(g_tweakPlayer->GetOrbitNormalDistance(int(x308_orbitType)), mgr);
break;
case EPlayerOrbitState::OrbitCarcass:
if (ControlMapper::GetPressInput(ControlMapper::ECommands::OrbitObject, input))
if (ControlMapper::GetPressInput(ControlMapper::ECommands::OrbitObject, input) || m_deferredOrbitObject)
{
m_deferredOrbitObject = false;
SetOrbitTargetId(FindOrbitTargetId(mgr), mgr);
if (x310_orbitTargetId != kInvalidUniqueId)
{
@ -5063,6 +5067,8 @@ void CPlayer::UpdateOrbitInput(const CFinalInput& input, CStateManager& mgr)
{
switch (x304_orbitState)
{
case EPlayerOrbitState::NoOrbit:
break;
case EPlayerOrbitState::OrbitObject:
if (TCastToConstPtr<CScriptGrapplePoint> point = mgr.GetObjectById(x310_orbitTargetId))
BreakGrapple(EPlayerOrbitRequest::Default, mgr);

View File

@ -241,6 +241,7 @@ private:
EPlayerZoneType x334_orbitType = EPlayerZoneType::Ellipse;
u32 x338_ = 1;
TUniqueId x33c_orbitNextTargetId = kInvalidUniqueId;
bool m_deferredOrbitObject = false;
float x340_ = 0.f;
std::vector<TUniqueId> x344_nearbyOrbitObjects;
std::vector<TUniqueId> x354_onScreenOrbitObjects;

View File

@ -25,6 +25,12 @@ CDummyWorld::CDummyWorld(CAssetId mlvlId, bool loadMap) : x4_loadMap(loadMap), x
x30_loadToken = g_ResFactory->LoadResourceAsync(tag, x34_loadBuf.get());
}
CDummyWorld::~CDummyWorld()
{
if (x30_loadToken)
x30_loadToken->PostCancelRequest();
}
CAssetId CDummyWorld::IGetWorldAssetId() const { return xc_mlvlId; }
CAssetId CDummyWorld::IGetStringTableAssetId() const { return x10_strgId; }

View File

@ -56,6 +56,7 @@ class CDummyWorld : public IWorld
TAreaId x3c_curAreaId = kInvalidAreaId;
public:
CDummyWorld(CAssetId mlvlId, bool loadMap);
~CDummyWorld();
CAssetId IGetWorldAssetId() const;
CAssetId IGetStringTableAssetId() const;
CAssetId IGetSaveWorldAssetId() const;