MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / RenderScene

Method RenderScene

TombEngine/Renderer/RendererDraw.cpp:1794–2047  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1792 }
1793
1794 void Renderer::RenderScene(RenderTarget2D* renderTarget, RenderView& view, SceneRenderMode renderMode)
1795 {
1796 using ns = std::chrono::nanoseconds;
1797 using get_time = std::chrono::steady_clock;
1798
1799 ResetDebugVariables();
1800
1801 auto& level = *g_GameFlow->GetLevel(CurrentLevel);
1802
1803 // Prepare scene to draw.
1804 auto time1 = std::chrono::high_resolution_clock::now();
1805 CollectMirrors(view);
1806 CollectRooms(view, false);
1807 auto time = std::chrono::high_resolution_clock::now();
1808 _timeRoomsCollector = (std::chrono::duration_cast<ns>(time - time1)).count() / 1000000;
1809 time1 = time;
1810
1811 UpdateLaraAnimations(false);
1812 UpdateItemAnimations(view);
1813
1814 _stBlending.AlphaTest = NO_VALUE;
1815 _stBlending.AlphaThreshold = NO_VALUE;
1816
1817 CollectLightsForCamera();
1818 RenderItemShadows(view);
1819
1820 // Prepare all sprites for later.
1821 PrepareFires(view);
1822 PrepareSmokes(view);
1823 PrepareSmokeParticles(view);
1824 PrepareSimpleParticles(view);
1825 PrepareSparkParticles(view);
1826 PrepareExplosionParticles(view);
1827 PrepareFootprints(view);
1828 PrepareBlood(view);
1829 PrepareWeatherParticles(view);
1830 PrepareParticles(view);
1831 PrepareBubbles(view);
1832 PrepareDrips(view);
1833 PrepareRipples(view);
1834 PrepareUnderwaterBloodParticles(view);
1835 PrepareSplashes(view);
1836 PrepareShockwaves(view);
1837 PrepareElectricity(view);
1838 PrepareHelicalLasers(view);
1839 PrepareRopes(view);
1840 PrepareStreamers(view);
1841 PrepareLaserBarriers(view);
1842 PrepareSingleLaserBeam(view);
1843 PrepareFireflies(view);
1844
1845 // Sprites grouped in buckets for instancing. Non-commutative sprites are collected at a later stage.
1846 SortAndPrepareSprites(view);
1847
1848 auto time2 = std::chrono::high_resolution_clock::now();
1849 _timeUpdate = (std::chrono::duration_cast<ns>(time2 - time1)).count() / 1000000;
1850 time1 = time2;
1851

Callers

nothing calls this directly

Calls 15

GetLevelMethod · 0.80
GetAddressOfMethod · 0.80
FillConstantBufferMethod · 0.80
GetFogMaxDistanceMethod · 0.80
GetFogColorMethod · 0.80
GetFogMinDistanceMethod · 0.80
GetSettingsMethod · 0.80
Draw3DMethod · 0.80
Draw2DMethod · 0.80
Vector3Function · 0.50
Vector4Function · 0.50

Tested by

no test coverage detected