Fix gaps at edges of view

This commit is contained in:
Simon 2023-11-18 10:52:00 +00:00
parent bde091d6b2
commit b3145a91bf
2 changed files with 78 additions and 0 deletions

View file

@ -4253,6 +4253,45 @@ static void CG_Draw2D( void )
CG_DrawZoomBorders();
}
if (cg.zoomMode)
{
cg.drawingHUD = CG_HUD_NORMAL;
const auto xOffset = (-vr->off_center_fov_x * 640);
const auto yOffset = (vr->off_center_fov_y * 480);
vec4_t color = { 0, 0, 0, 1 };
if (cg.stereoView == STEREO_LEFT)
{
//Left Gap
CG_FillRect(0, 0, xOffset, 480, color);
if (yOffset < 0)
{
//Bottom Gap
CG_FillRect(0, 0, 640, yOffset, color);
}
else
{
//Top Gap
CG_FillRect(0, 480 - yOffset, 640, yOffset, color);
}
}
else
{
//Right Gap
CG_FillRect(640 - xOffset, 0, xOffset, 480, color);
if (yOffset < 0)
{
//Bottom Gap
CG_FillRect(0, 0, 640, yOffset, color);
}
else
{
//Top Gap
CG_FillRect(0, 480 - yOffset, 640, yOffset, color);
}
}
}
cg.drawingHUD = CG_HUD_SCALED;
CG_DrawBatteryCharge();

View file

@ -2729,6 +2729,45 @@ static void CG_Draw2D( void )
CG_DrawZoomBorders();
}
if (cg.zoomMode)
{
cg.drawingHUD = CG_HUD_NORMAL;
const auto xOffset = (-vr->off_center_fov_x * 640);
const auto yOffset = (vr->off_center_fov_y * 480);
vec4_t color = { 0, 0, 0, 1 };
if (cg.stereoView == STEREO_LEFT)
{
//Left Gap
CG_FillRect(0, 0, xOffset, 480, color);
if (yOffset < 0)
{
//Bottom Gap
CG_FillRect(0, 0, 640, yOffset, color);
}
else
{
//Top Gap
CG_FillRect(0, 480 - yOffset, 640, yOffset, color);
}
}
else
{
//Right Gap
CG_FillRect(640 - xOffset, 0, xOffset, 480, color);
if (yOffset < 0)
{
//Bottom Gap
CG_FillRect(0, 0, 640, yOffset, color);
}
else
{
//Top Gap
CG_FillRect(0, 480 - yOffset, 640, yOffset, color);
}
}
}
cg.drawingHUD = CG_HUD_SCALED;
CG_DrawBatteryCharge();