diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2022-10-09 13:17:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-09 13:17:11 +0200 |
| commit | 1647fa350bf7e945b9821296748a130504b7d8c6 (patch) | |
| tree | 34346c779d6802ac111ddd1070e6e8e1e1b22d56 /Source/Core/VideoCommon/GraphicsModSystem/Runtime/Actions/ScaleAction.cpp | |
| parent | 8be5300ef9247b02715e9c250c9f1d39c1c6858e (diff) | |
| parent | bc360584a3a8a8902f50642496b2d1287e5088ac (diff) | |
Merge pull request #10804 from iwubcode/graphics-mod-input-output-structs
VideoCommon: add structures to graphics mods internal API
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; } |
