Fixed shader tiling being bad with virtual scaling on mohaas/mohaab

This commit is contained in:
smallmodel 2023-07-29 23:18:31 +02:00
parent d40755eb7c
commit a86ed01ba3
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -2393,9 +2393,16 @@ void UIWidget::Display
m_material->ReregisterMaterial();
if( m_flags & WA_TOP )
if( m_flags & WF_TILESHADER )
{
uii.Rend_DrawPicTiled( 0, 0, m_frame.size.width, m_frame.size.height, m_material->GetMaterial() );
if (m_bVirtual) {
float fvWidth = m_frame.size.width / m_vVirtualScale[0] / uii.Rend_GetShaderWidth(m_material->GetMaterial());
float fvHeight = m_frame.size.height / m_vVirtualScale[1] / uii.Rend_GetShaderHeight(m_material->GetMaterial());
uii.Rend_DrawPicStretched(0, 0, m_frame.size.width, m_frame.size.height, 0, 0, fvWidth, fvHeight, m_material->GetMaterial());
} else {
uii.Rend_DrawPicTiled(0, 0, m_frame.size.width, m_frame.size.height, m_material->GetMaterial());
}
}
else
{