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

Method DrawOverlays

TombEngine/Renderer/RendererDraw2D.cpp:249–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247 }
248
249 void Renderer::DrawOverlays(RenderView& view)
250 {
251 auto flashColor = Weather.FlashColor();
252 if (flashColor != Vector3::Zero)
253 {
254 SetBlendMode(BlendMode::Additive);
255 DrawFullScreenQuad(_whiteTexture.ShaderResourceView.Get(), flashColor);
256 }
257
258 if (CurrentLevel == 0)
259 return;
260
261 if (!Lara.Control.Look.OpticRange && !SpotcamOverlay)
262 return;
263
264 SetBlendMode(BlendMode::AlphaBlend);
265
266 if (Lara.Control.Look.OpticRange != 0 && !Lara.Control.Look.IsUsingLasersight)
267 {
268 DrawFullScreenSprite(&_sprites[Objects[ID_BINOCULAR_GRAPHICS].meshIndex], Vector3::One, false);
269 }
270 else if (Lara.Control.Look.OpticRange != 0 && Lara.Control.Look.IsUsingLasersight)
271 {
272 DrawFullScreenSprite(&_sprites[Objects[ID_LASERSIGHT_GRAPHICS].meshIndex], Vector3::One);
273
274 SetBlendMode(BlendMode::Opaque);
275
276 // Draw the aiming point
277 Vertex vertices[4];
278
279 vertices[0].Position.x = -4.0f / _screenWidth;
280 vertices[0].Position.y = 4.0f / _screenHeight;
281 vertices[0].Position.z = 0.0f;
282 vertices[0].UV.x = 0.0f;
283 vertices[0].UV.y = 0.0f;
284 vertices[0].Color = VectorColorToRGBA_TempToVector4(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
285
286 vertices[1].Position.x = 4.0f / _screenWidth;
287 vertices[1].Position.y = 4.0f / _screenHeight;
288 vertices[1].Position.z = 0.0f;
289 vertices[1].UV.x = 1.0f;
290 vertices[1].UV.y = 0.0f;
291 vertices[1].Color = VectorColorToRGBA_TempToVector4(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
292
293 vertices[2].Position.x = 4.0f / _screenWidth;
294 vertices[2].Position.y = -4.0f / _screenHeight;
295 vertices[2].Position.z = 0.0f;
296 vertices[2].UV.x = 1.0f;
297 vertices[2].UV.y = 1.0f;
298 vertices[2].Color = VectorColorToRGBA_TempToVector4(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
299
300 vertices[3].Position.x = -4.0f / _screenWidth;
301 vertices[3].Position.y = -4.0f / _screenHeight;
302 vertices[3].Position.z = 0.0f;
303 vertices[3].UV.x = 0.0f;
304 vertices[3].UV.y = 1.0f;
305 vertices[3].Color = VectorColorToRGBA_TempToVector4(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
306

Callers

nothing calls this directly

Calls 5

FlashColorMethod · 0.80
BindMethod · 0.80
Vector4Function · 0.50
GetMethod · 0.45

Tested by

no test coverage detected