From 25de1ca6414f7d24d155b3e0c0e4f03ae5117121 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Wed, 17 Feb 2016 00:07:32 -0800 Subject: [PATCH] Add missed VectorElement --- Runtime/Particle/CParticleDataFactory.cpp | 5 +++++ Runtime/Particle/CVectorElement.cpp | 8 ++++++++ Runtime/Particle/CVectorElement.hpp | 10 ++++++++++ 3 files changed, 23 insertions(+) diff --git a/Runtime/Particle/CParticleDataFactory.cpp b/Runtime/Particle/CParticleDataFactory.cpp index fb4ada0f6..4ed4127fd 100644 --- a/Runtime/Particle/CParticleDataFactory.cpp +++ b/Runtime/Particle/CParticleDataFactory.cpp @@ -476,6 +476,11 @@ CVectorElement* CParticleDataFactory::GetVectorElement(CInputStream& in) CVectorElement* b = GetVectorElement(in); return new CVESubtract(a, b); } + case SBIG('CTVC'): + { + CColorElement* a = GetColorElement(in); + return new CVEColorToVector(a); + } default: break; } return nullptr; diff --git a/Runtime/Particle/CVectorElement.cpp b/Runtime/Particle/CVectorElement.cpp index 96a2dbee9..d08c0245e 100644 --- a/Runtime/Particle/CVectorElement.cpp +++ b/Runtime/Particle/CVectorElement.cpp @@ -328,4 +328,12 @@ bool CVESubtract::GetValue(int frame, Zeus::CVector3f& valOut) const return false; } +bool CVEColorToVector::GetValue(int frame, Zeus::CVector3f &valOut) const +{ + Zeus::CColor black = {0.0, 0.0, 0.0, 1.0}; + x4_a->GetValue(frame, black); + valOut = Zeus::CVector3f{black.r, valOut.y, black.g }; + return false; +} + } diff --git a/Runtime/Particle/CVectorElement.hpp b/Runtime/Particle/CVectorElement.hpp index 9b3d2f768..a62f0138a 100644 --- a/Runtime/Particle/CVectorElement.hpp +++ b/Runtime/Particle/CVectorElement.hpp @@ -203,6 +203,16 @@ public: bool GetValue(int frame, Zeus::CVector3f& valOut) const; }; +class CVEColorToVector : public CVectorElement +{ + std::unique_ptr x4_a; +public: + CVEColorToVector(CColorElement* a) + : x4_a(a) {} + + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + } #endif // __PSHAG_CVECTORELEMENT_HPP__