| 1746 | } |
| 1747 | |
| 1748 | void Renderer::PrepareScene() |
| 1749 | { |
| 1750 | if (g_GameFlow->CurrentFreezeMode == FreezeMode::None && |
| 1751 | g_Gui.GetInventoryMode() == InventoryMode::None) |
| 1752 | { |
| 1753 | _dynamicLightList ^= 1; |
| 1754 | _dynamicLights[_dynamicLightList].clear(); |
| 1755 | } |
| 1756 | |
| 1757 | _lines2DToDraw.clear(); |
| 1758 | _lines3DToDraw.clear(); |
| 1759 | _triangles3DToDraw.clear(); |
| 1760 | _stringsToDraw.clear(); |
| 1761 | |
| 1762 | _currentCausticsFrame++; |
| 1763 | _currentCausticsFrame %= 32; |
| 1764 | |
| 1765 | constexpr auto BLINK_VALUE_MAX = 1.0f; |
| 1766 | constexpr auto BLINK_VALUE_MIN = 0.1f; |
| 1767 | constexpr auto BLINK_TIME_STEP = 0.2f; |
| 1768 | |
| 1769 | // Calculate blink increment based on sine wave. |
| 1770 | float blink = ((sin(_blinkTime) + BLINK_VALUE_MAX) * 0.5f) + BLINK_VALUE_MIN; |
| 1771 | _blinkColorValue = Vector4(blink, blink, blink, 1.0f); |
| 1772 | |
| 1773 | // Update blink time. |
| 1774 | _blinkTime += BLINK_TIME_STEP; |
| 1775 | if (_blinkTime > PI_MUL_2) |
| 1776 | _blinkTime -= PI_MUL_2; |
| 1777 | |
| 1778 | _oldGameCamera = _currentGameCamera; |
| 1779 | Camera.DisableInterpolation = false; |
| 1780 | |
| 1781 | _isLocked = false; |
| 1782 | |
| 1783 | DrawDebugInfo(_gameCamera); |
| 1784 | } |
| 1785 | |
| 1786 | void Renderer::ClearScene() |
| 1787 | { |
no test coverage detected