From d019a4990f2e2da71555daf085a3e09c92085fa5 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Tue, 21 Oct 2014 21:44:17 -0700 Subject: add option to disable blood --- src/graphics/engine/camera.cpp | 10 ++++++++++ src/graphics/engine/camera.h | 4 ++++ src/graphics/engine/pyro.cpp | 6 +++--- 3 files changed, 17 insertions(+), 3 deletions(-) (limited to 'src/graphics/engine') diff --git a/src/graphics/engine/camera.cpp b/src/graphics/engine/camera.cpp index fedc70a..c37ed39 100644 --- a/src/graphics/engine/camera.cpp +++ b/src/graphics/engine/camera.cpp @@ -137,6 +137,7 @@ CCamera::CCamera() m_scriptLookat = Math::Vector(0.0f, 0.0f, 0.0f); m_effect = true; + m_blood = true; m_cameraScroll = true; m_cameraInvertX = false; m_cameraInvertY = false; @@ -151,6 +152,15 @@ void CCamera::SetEffect(bool enable) m_effect = enable; } +void CCamera::SetBlood(bool enable) +{ + m_blood = enable; +} + +bool CCamera::GetBlood() { + return m_blood; +} + void CCamera::SetCameraScroll(bool scroll) { m_cameraScroll = scroll; diff --git a/src/graphics/engine/camera.h b/src/graphics/engine/camera.h index 6d94dad..699593c 100644 --- a/src/graphics/engine/camera.h +++ b/src/graphics/engine/camera.h @@ -198,6 +198,8 @@ public: void SetScriptLookat(Math::Vector lookat); void SetEffect(bool enable); + void SetBlood(bool enable); + bool GetBlood(); void SetCameraScroll(bool scroll); void SetCameraInvertX(bool invert); void SetCameraInvertY(bool invert); @@ -379,6 +381,8 @@ protected: //! Shocks if explosion? bool m_effect; + //! Blood? + bool m_blood; //! Scroll in the edges? bool m_cameraScroll; //! X inversion in the edges? diff --git a/src/graphics/engine/pyro.cpp b/src/graphics/engine/pyro.cpp index d3e0405..d7edf51 100644 --- a/src/graphics/engine/pyro.cpp +++ b/src/graphics/engine/pyro.cpp @@ -312,7 +312,7 @@ bool CPyro::Create(PyroType type, CObject* obj, float force) } if ( m_type == PT_SHOTH ) { - if ( m_object->GetSelect() ) + if ( m_camera->GetBlood() && m_object->GetSelect() ) { m_camera->StartOver(CAM_OVER_EFFECT_BLOOD, m_pos, force); } @@ -672,7 +672,7 @@ bool CPyro::EventProcess(const Event &event) } } - if ( m_type == PT_SHOTH && + if ( m_camera->GetBlood() && m_type == PT_SHOTH && m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { m_lastParticle = m_time; @@ -694,7 +694,7 @@ bool CPyro::EventProcess(const Event &event) } } - if ( m_type == PT_SHOTM && + if ( m_camera->GetBlood() && m_type == PT_SHOTM && m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time ) { m_lastParticle = m_time; -- cgit v1.2.3-1-g7c22