diff options
Diffstat (limited to 'Source/Core/VideoCommon/GraphicsModSystem/Runtime/Actions/ScaleAction.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/GraphicsModSystem/Runtime/Actions/ScaleAction.cpp | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/Source/Core/VideoCommon/GraphicsModSystem/Runtime/Actions/ScaleAction.cpp b/Source/Core/VideoCommon/GraphicsModSystem/Runtime/Actions/ScaleAction.cpp index d0cac24acb..305cd8b737 100644 --- a/Source/Core/VideoCommon/GraphicsModSystem/Runtime/Actions/ScaleAction.cpp +++ b/Source/Core/VideoCommon/GraphicsModSystem/Runtime/Actions/ScaleAction.cpp @@ -30,30 +30,46 @@ ScaleAction::ScaleAction(Common::Vec3 scale) : m_scale(scale) { } -void ScaleAction::OnEFB(bool*, u32 texture_width, u32 texture_height, u32* scaled_width, - u32* scaled_height) +void ScaleAction::OnEFB(GraphicsModActionData::EFB* efb) { - if (scaled_width && m_scale.x > 0) - *scaled_width = texture_width * m_scale.x; + if (!efb) [[unlikely]] + return; + + if (!efb->scaled_width) [[unlikely]] + return; + + if (!efb->scaled_height) [[unlikely]] + return; + + if (m_scale.x > 0) + *efb->scaled_width = efb->texture_width * m_scale.x; - if (scaled_height && m_scale.y > 0) - *scaled_height = texture_height * m_scale.y; + if (m_scale.y > 0) + *efb->scaled_height = efb->texture_height * m_scale.y; } -void ScaleAction::OnProjection(Common::Matrix44* matrix) +void ScaleAction::OnProjection(GraphicsModActionData::Projection* projection) { - if (!matrix) + if (!projection) [[unlikely]] return; - auto& the_matrix = *matrix; - the_matrix.data[0] = the_matrix.data[0] * m_scale.x; - the_matrix.data[5] = the_matrix.data[5] * m_scale.y; + + if (!projection->matrix) [[unlikely]] + return; + + auto& matrix = *projection->matrix; + matrix.data[0] = matrix.data[0] * m_scale.x; + matrix.data[5] = matrix.data[5] * m_scale.y; } -void ScaleAction::OnProjectionAndTexture(Common::Matrix44* matrix) +void ScaleAction::OnProjectionAndTexture(GraphicsModActionData::Projection* projection) { - if (!matrix) + if (!projection) [[unlikely]] return; - auto& the_matrix = *matrix; - the_matrix.data[0] = the_matrix.data[0] * m_scale.x; - the_matrix.data[5] = the_matrix.data[5] * m_scale.y; + + if (!projection->matrix) [[unlikely]] + return; + + auto& matrix = *projection->matrix; + matrix.data[0] = matrix.data[0] * m_scale.x; + matrix.data[5] = matrix.data[5] * m_scale.y; } |
