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

Method CollectLightsForRoom

TombEngine/Renderer/RendererFrame.cpp:893–933  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

891 }
892
893 void Renderer::CollectLightsForRoom(short roomNumber, RenderView &renderView)
894 {
895 if (_rooms.size() <= roomNumber)
896 return;
897
898 RendererRoom& room = _rooms[roomNumber];
899 RoomData* r = &g_Level.Rooms[roomNumber];
900
901 // Collect dynamic lights for rooms
902 for (int i = 0; i < _dynamicLights[_dynamicLightList].size(); i++)
903 {
904 RendererLight* light = &_dynamicLights[_dynamicLightList][i];
905
906 // If no radius, ignore
907 if (light->Out == 0.0f)
908 {
909 continue;
910 }
911
912 // Light buffer is full
913 if (renderView.LightsToDraw.size() >= NUM_LIGHTS_PER_BUFFER)
914 {
915 break;
916 }
917
918 // Light already on a list
919 if (TEN::Utils::Contains(renderView.LightsToDraw, light))
920 {
921 continue;
922 }
923
924 // Light is not within room bounds
925 if (!room.BoundingBox.Intersects(light->BoundingSphere))
926 {
927 continue;
928 }
929
930 renderView.LightsToDraw.push_back(light);
931 room.LightsToDraw.push_back(light);
932 }
933 }
934
935 void Renderer::CollectEffects(short roomNumber)
936 {

Callers

nothing calls this directly

Calls 4

ContainsFunction · 0.85
IntersectsMethod · 0.80
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected