| 1480 | } |
| 1481 | |
| 1482 | void CGameScreen::DrawGameWindowLight() |
| 1483 | { |
| 1484 | #ifndef NEW_RENDERER_ENABLED |
| 1485 | glColor4f(1.0f, 1.0f, 1.0f, 1.0f); |
| 1486 | #else |
| 1487 | RenderAdd_SetColor(g_renderCmdList, SetColorCmd{ g_ColorWhite }); |
| 1488 | #endif |
| 1489 | |
| 1490 | if (!UseLight) |
| 1491 | { |
| 1492 | return; |
| 1493 | } |
| 1494 | |
| 1495 | g_LightColorizerShader.Enable(); |
| 1496 | |
| 1497 | if (/*g_LightBuffer.Ready() &&*/ g_LightBuffer.Use()) |
| 1498 | { |
| 1499 | float newLightColor = ((32 - g_LightLevel + g_PersonalLightLevel) / 32.0f); |
| 1500 | |
| 1501 | if (!g_ConfigManager.DarkNights) |
| 1502 | { |
| 1503 | newLightColor += 0.2f; |
| 1504 | } |
| 1505 | |
| 1506 | #ifndef NEW_RENDERER_ENABLED |
| 1507 | glClearColor(newLightColor, newLightColor, newLightColor, 1.0f); |
| 1508 | glClear(GL_COLOR_BUFFER_BIT); |
| 1509 | glClearColor(0.0f, 0.0f, 0.0f, 1.0f); |
| 1510 | |
| 1511 | glEnable(GL_BLEND); |
| 1512 | glBlendFunc(GL_ONE, GL_ONE); |
| 1513 | #else |
| 1514 | RenderAdd_SetClearColor( |
| 1515 | g_renderCmdList, |
| 1516 | SetClearColorCmd{ { newLightColor, newLightColor, newLightColor, 1.f } }); |
| 1517 | RenderAdd_ClearRT(g_renderCmdList, ClearRTCmd{ ClearRT::ClearRT_Color }); |
| 1518 | RenderAdd_SetClearColor(g_renderCmdList, SetClearColorCmd{ g_ColorBlack }); |
| 1519 | |
| 1520 | RenderAdd_SetBlend( |
| 1521 | g_renderCmdList, |
| 1522 | BlendStateCmd{ BlendFactor::BlendFactor_One, BlendFactor::BlendFactor_One }); |
| 1523 | #endif |
| 1524 | |
| 1525 | int offsetX = 0; |
| 1526 | int offsetY = 0; |
| 1527 | |
| 1528 | if (g_ConfigManager.GetUseScaling()) |
| 1529 | { |
| 1530 | offsetX = g_RenderBounds.GameWindowPosX - g_RenderBounds.GameWindowScaledOffsetX; |
| 1531 | offsetY = g_RenderBounds.GameWindowPosY - g_RenderBounds.GameWindowScaledOffsetY; |
| 1532 | } |
| 1533 | |
| 1534 | float translateOffsetX = (float)offsetX; |
| 1535 | float translateOffsetY = (float)offsetY; |
| 1536 | |
| 1537 | #ifndef NEW_RENDERER_ENABLED |
| 1538 | glTranslatef(translateOffsetX, translateOffsetY, 0.0f); |
| 1539 | #else |
nothing calls this directly
no test coverage detected