mirror of https://github.com/AxioDL/metaforce.git
Allocation bounds fix, Space Warp 0.5 bias
This commit is contained in:
parent
0ddf4dc426
commit
03671ce5e1
|
@ -416,11 +416,12 @@ void ProjectResourceFactoryBase::AsyncTask::CookComplete()
|
|||
}
|
||||
|
||||
/* Ready for buffer transaction at this point */
|
||||
x14_resSize = std::min(s32(x14_resSize), std::max(0, s32(fr.length()) - s32(x14_resOffset)));
|
||||
x10_loadBuffer.reset(new u8[x14_resSize]);
|
||||
u32 availSz = std::max(0, s32(fr.length()) - s32(x14_resOffset));
|
||||
u32 sz = std::min(x14_resSize, availSz);
|
||||
x10_loadBuffer.reset(new u8[sz]);
|
||||
m_bufTransaction = m_parent.m_clientProc.addBufferTransaction(m_cookedPath,
|
||||
x10_loadBuffer.get(),
|
||||
x14_resSize, x14_resOffset);
|
||||
sz, x14_resOffset);
|
||||
}
|
||||
|
||||
bool ProjectResourceFactoryBase::AsyncTask::AsyncPump()
|
||||
|
|
|
@ -118,8 +118,8 @@ void CSpaceWarpFilter::draw(const zeus::CVector2f& pt)
|
|||
zeus::CVector2f vp{CGraphics::g_ViewportResolution.x, CGraphics::g_ViewportResolution.y};
|
||||
m_uniform.m_matrix[0][0] = clipRect.xc_width / vp.x;
|
||||
m_uniform.m_matrix[1][1] = clipRect.x10_height / vp.y;
|
||||
m_uniform.m_matrix[2][0] = pt.x;
|
||||
m_uniform.m_matrix[2][1] = pt.y;
|
||||
m_uniform.m_matrix[2][0] = pt.x + (1.f / vp.x);
|
||||
m_uniform.m_matrix[2][1] = pt.y + (1.f / vp.y);
|
||||
|
||||
m_uniform.m_strength.x = m_uniform.m_matrix[0][0] * m_strength * 0.5f;
|
||||
m_uniform.m_strength.y = m_uniform.m_matrix[1][1] * m_strength * 0.5f;
|
||||
|
|
Loading…
Reference in New Issue