diff --git a/Editor/CMakeLists.txt b/Editor/CMakeLists.txt index dd8f6625c..fd096d94c 100644 --- a/Editor/CMakeLists.txt +++ b/Editor/CMakeLists.txt @@ -1,4 +1,4 @@ -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR} ./../Runtime) add_subdirectory(locale) add_subdirectory(icons) @@ -52,6 +52,7 @@ target_link_libraries(urde UrdeIcons RuntimeCommonCharacter RuntimeCommonInput + RuntimeCommonParticle RuntimeCommon DNAMP3 DNAMP2 DNAMP1 DNACommon Specter SpecterFonts freetype ${DATA_SPEC_LIBS} diff --git a/Editor/main.cpp b/Editor/main.cpp index b5e80404c..7a12106b9 100644 --- a/Editor/main.cpp +++ b/Editor/main.cpp @@ -5,6 +5,7 @@ #include #include #include "ViewManager.hpp" +#include namespace URDE { @@ -23,6 +24,7 @@ struct Application : boo::IApplicationCallback int appMain(boo::IApplication* app) { + Retro::CElementGen::Initialize(); m_viewManager.init(app); while (m_running) { diff --git a/Runtime/Particle/CColorElement.cpp b/Runtime/Particle/CColorElement.cpp index aca779059..1ff594bc1 100644 --- a/Runtime/Particle/CColorElement.cpp +++ b/Runtime/Particle/CColorElement.cpp @@ -150,4 +150,10 @@ bool CCEPulse::GetValue(int frame, Zeus::CColor& valOut) const return false; } +bool CCEParticleColor::GetValue(int frame, Zeus::CColor& colorOut) const +{ + /* TODO: Do */ + return false; +} + } diff --git a/Runtime/Particle/CColorElement.hpp b/Runtime/Particle/CColorElement.hpp index 0863d0a62..acc6ab502 100644 --- a/Runtime/Particle/CColorElement.hpp +++ b/Runtime/Particle/CColorElement.hpp @@ -87,6 +87,11 @@ public: bool GetValue(int frame, Zeus::CColor& colorOut) const; }; +class CCEParticleColor : public CColorElement +{ +public: + bool GetValue(int frame, Zeus::CColor& colorOut) const; +}; } #endif // __RETRO_CCOLORELEMENT_HPP__ diff --git a/Runtime/Particle/CParticleDataFactory.cpp b/Runtime/Particle/CParticleDataFactory.cpp index 55a6903dc..b9260b688 100644 --- a/Runtime/Particle/CParticleDataFactory.cpp +++ b/Runtime/Particle/CParticleDataFactory.cpp @@ -177,6 +177,10 @@ CColorElement* CParticleDataFactory::GetColorElement(CInputStream& in) CColorElement* d = GetColorElement(in); return new CCEPulse(a, b, c, d); } + case SBIG('PCOL'): + { + return new CCEParticleColor(); + } default: break; } return nullptr; @@ -449,13 +453,27 @@ CVectorElement* CParticleDataFactory::GetVectorElement(CInputStream& in) { return new CVEPLOC; } + case SBIG('PSOF'): + { + return new CVEPSOF; + } + case SBIG('PSOU'): + { + return new CVEPSOU; + } case SBIG('PSOR'): { return new CVEPSOR; } - case SBIG('PSOF'): + case SBIG('PSTR'): { - return new CVEPSOF; + return new CVEPSTR; + } + case SBIG('SUB_'): + { + CVectorElement* a = GetVectorElement(in); + CVectorElement* b = GetVectorElement(in); + return new CVESubtract(a, b); } default: break; } @@ -515,6 +533,12 @@ CRealElement* CParticleDataFactory::GetRealElement(CInputStream& in) CRealElement* b = GetRealElement(in); return new CRERandom(a, b); } + case SBIG('DOTP'): + { + CVectorElement* a = GetVectorElement(in); + CVectorElement* b = GetVectorElement(in); + return new CREDotProduct(a, b); + } case SBIG('MULT'): { CRealElement* a = GetRealElement(in); @@ -645,6 +669,35 @@ CRealElement* CParticleDataFactory::GetRealElement(CInputStream& in) CRealElement* b = GetRealElement(in); return new CREIntTimesReal(a, b); } + case SBIG('CRNG'): + { + CRealElement* a = GetRealElement(in); + CRealElement* b = GetRealElement(in); + CRealElement* c = GetRealElement(in); + CRealElement* d = GetRealElement(in); + CRealElement* e = GetRealElement(in); + return new CREConstantRange(a, b, c, d, e); + } + case SBIG('GTCR'): + { + CColorElement* a = GetColorElement(in); + return new CREGetComponentRed(a); + } + case SBIG('GTCG'): + { + CColorElement* a = GetColorElement(in); + return new CREGetComponentGreen(a); + } + case SBIG('GTCB'): + { + CColorElement* a = GetColorElement(in); + return new CREGetComponentBlue(a); + } + case SBIG('GTCA'): + { + CColorElement* a = GetColorElement(in); + return new CREGetComponentAlpha(a); + } default: break; } return nullptr; diff --git a/Runtime/Particle/CRealElement.cpp b/Runtime/Particle/CRealElement.cpp index 754a4c62b..85761b947 100644 --- a/Runtime/Particle/CRealElement.cpp +++ b/Runtime/Particle/CRealElement.cpp @@ -92,7 +92,7 @@ bool CREAdd::GetValue(int frame, float& valOut) const return false; } -bool CREClamp::GetValue(int frame, float &valOut) const +bool CREClamp::GetValue(int frame,float& valOut) const { float a, b; x4_min->GetValue(frame, a); @@ -115,6 +115,25 @@ bool CRERandom::GetValue(int frame, float& valOut) const return false; } +bool CREDotProduct::GetValue(int frame, float& valOut) const +{ + Zeus::CVector3f a, b; + x4_a->GetValue(frame, a); + x8_b->GetValue(frame, b); + valOut = a.dot(b); + return false; +} + + +bool CREMultiply::GetValue(int frame, float& valOut) const +{ + float a, b; + x4_a->GetValue(frame, a); + x8_b->GetValue(frame, b); + valOut = a * b; + return false; +} + bool CREPulse::GetValue(int frame, float& valOut) const { int a, b; @@ -316,4 +335,51 @@ bool CREIntTimesReal::GetValue(int frame, float& valOut) const return false; } +bool CREConstantRange::GetValue(int frame, float& valOut) const +{ + float val, min, max; + x4_val->GetValue(frame, val); + x8_min->GetValue(frame, min); + xc_max->GetValue(frame, max); + + if (val > min && val < max) + x10_inRange->GetValue(frame, valOut); + else + x14_outOfRange->GetValue(frame, valOut); + + return false; +} + +bool CREGetComponentRed::GetValue(int frame, float& valOut) const +{ + Zeus::CColor a = Zeus::CColor::skBlack; + x4_a->GetValue(frame, a); + valOut = a.r; + return false; +} + +bool CREGetComponentGreen::GetValue(int frame, float& valOut) const +{ + Zeus::CColor a = Zeus::CColor::skBlack; + x4_a->GetValue(frame, a); + valOut = a.g; + return false; +} + +bool CREGetComponentBlue::GetValue(int frame, float& valOut) const +{ + Zeus::CColor a = Zeus::CColor::skBlack; + x4_a->GetValue(frame, a); + valOut = a.b; + return false; +} + +bool CREGetComponentAlpha::GetValue(int frame, float& valOut) const +{ + Zeus::CColor a = Zeus::CColor::skBlack; + x4_a->GetValue(frame, a); + valOut = a.a; + return false; +} + } diff --git a/Runtime/Particle/CRealElement.hpp b/Runtime/Particle/CRealElement.hpp index 9207401d8..3c5e28c21 100644 --- a/Runtime/Particle/CRealElement.hpp +++ b/Runtime/Particle/CRealElement.hpp @@ -92,6 +92,16 @@ public: bool GetValue(int frame, float& valOut) const; }; +class CREDotProduct : public CRealElement +{ + std::unique_ptr x4_a; + std::unique_ptr x8_b; +public: + CREDotProduct(CVectorElement* a, CVectorElement* b) + : x4_a(a), x8_b(b) {} + bool GetValue(int frame, float& valOut) const; +}; + class CREMultiply : public CRealElement { std::unique_ptr x4_a; @@ -302,6 +312,59 @@ public: bool GetValue(int frame, float& valOut) const; }; +class CREConstantRange : public CRealElement +{ + std::unique_ptr x4_val; + std::unique_ptr x8_min; + std::unique_ptr xc_max; + std::unique_ptr x10_inRange; + std::unique_ptr x14_outOfRange; +public: + CREConstantRange(CRealElement* a, CRealElement* b, CRealElement* c, CRealElement* d, CRealElement* e) + : x4_val(a), x8_min(b), xc_max(c), x10_inRange(d), x14_outOfRange(e) {} + + bool GetValue(int frame, float& valOut) const; +}; + +class CREGetComponentRed : public CRealElement +{ + std::unique_ptr x4_a; +public: + CREGetComponentRed(CColorElement* a) + : x4_a(a) {} + + bool GetValue(int frame, float& valOut) const; +}; + +class CREGetComponentGreen : public CRealElement +{ + std::unique_ptr x4_a; +public: + CREGetComponentGreen(CColorElement* a) + : x4_a(a) {} + + bool GetValue(int frame, float& valOut) const; +}; + +class CREGetComponentBlue : public CRealElement +{ + std::unique_ptr x4_a; +public: + CREGetComponentBlue(CColorElement* a) + : x4_a(a) {} + + bool GetValue(int frame, float& valOut) const; +}; + +class CREGetComponentAlpha : public CRealElement +{ + std::unique_ptr x4_a; +public: + CREGetComponentAlpha(CColorElement* a) + : x4_a(a) {} + + bool GetValue(int frame, float& valOut) const; +}; } #endif // __RETRO_CREALELEMENT_HPP__ diff --git a/Runtime/Particle/CVectorElement.cpp b/Runtime/Particle/CVectorElement.cpp index a2405b9dc..8418bf9ab 100644 --- a/Runtime/Particle/CVectorElement.cpp +++ b/Runtime/Particle/CVectorElement.cpp @@ -285,16 +285,37 @@ bool CVEPLOC::GetValue(int frame, Zeus::CVector3f& valOut) const return false; } -bool CVEPSOR::GetValue(int frame, Zeus::CVector3f& valOut) const -{ - /* TODO: Do */ - return false; -} - bool CVEPSOF::GetValue(int frame, Zeus::CVector3f& valOut) const { /* TODO: Do */ return false; } +bool CVEPSOU::GetValue(int frame, Zeus::CVector3f& valOut) const +{ + /* TODO: Do */ + return false; +} + +bool CVEPSOR::GetValue(int frame, Zeus::CVector3f& valOut) const +{ + /* TODO: Do */ + return false; +} + +bool CVEPSTR::GetValue(int frame, Zeus::CVector3f& valOut) const +{ + /* TODO: Do */ + return false; +} + +bool CVESubtract::GetValue(int frame, Zeus::CVector3f& valOut) const +{ + Zeus::CVector3f a, b; + x4_a->GetValue(frame, a); + x8_b->GetValue(frame, b); + valOut = a - b; + return false; +} + } diff --git a/Runtime/Particle/CVectorElement.hpp b/Runtime/Particle/CVectorElement.hpp index 9b20dec9e..2112d5ce0 100644 --- a/Runtime/Particle/CVectorElement.hpp +++ b/Runtime/Particle/CVectorElement.hpp @@ -168,18 +168,41 @@ public: bool GetValue(int frame, Zeus::CVector3f& valOut) const; }; -class CVEPSOR : public CVectorElement -{ -public: - bool GetValue(int frame, Zeus::CVector3f& valOut) const; -}; - class CVEPSOF : public CVectorElement { public: bool GetValue(int frame, Zeus::CVector3f& valOut) const; }; +class CVEPSOU : public CVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + +class CVEPSOR : public CVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + +class CVEPSTR : public CVectorElement +{ +public: + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + +class CVESubtract : public CVectorElement +{ + std::unique_ptr x4_a; + std::unique_ptr x8_b; +public: + CVESubtract(CVectorElement* a, CVectorElement* b) + : x4_a(a), x8_b(b) + {} + bool GetValue(int frame, Zeus::CVector3f& valOut) const; +}; + } #endif // __RETRO_CVECTORELEMENT_HPP__