From 3bfdfcf1de90c27771231329cd5441bd60d3a417 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Thu, 19 Oct 2023 10:39:17 -0700 Subject: [PATCH] Match and link CColorElement.cpp Former-commit-id: a326f4b8c29fd289ed6976708fb5429f49d10e24 --- config/GM8E01_00/symbols.txt | 2 +- config/GM8E01_01/symbols.txt | 2 +- configure.py | 2 +- include/Kyoto/Graphics/CColor.hpp | 8 +++---- src/Kyoto/CFactoryStore.cpp | 4 ++-- src/Kyoto/Particles/CColorElement.cpp | 32 +++++---------------------- 6 files changed, 15 insertions(+), 35 deletions(-) diff --git a/config/GM8E01_00/symbols.txt b/config/GM8E01_00/symbols.txt index 33ace6c6..070d8f72 100644 --- a/config/GM8E01_00/symbols.txt +++ b/config/GM8E01_00/symbols.txt @@ -18720,7 +18720,7 @@ jumptable_803ED948 = .data:0x803ED948; // type:object size:0x20 scope:local jumptable_803ED968 = .data:0x803ED968; // type:object size:0x2C scope:local @344 = .data:0x803ED994; // type:object size:0x2C scope:local __vt__10IAllocator = .data:0x803ED9C0; // type:object size:0x40 scope:global -lbl_803EDA00 = .data:0x803EDA00; // type:object size:0x10 +__vt__16CCEParticleColor = .data:0x803EDA00; // type:object size:0x10 __vt__18CCEKeyframeEmitter = .data:0x803EDA10; // type:object size:0x10 scope:global __vt__8CCEPulse = .data:0x803EDA20; // type:object size:0x10 scope:global __vt__12CCETimeChain = .data:0x803EDA30; // type:object size:0x10 scope:global diff --git a/config/GM8E01_01/symbols.txt b/config/GM8E01_01/symbols.txt index ea90971f..639675d8 100644 --- a/config/GM8E01_01/symbols.txt +++ b/config/GM8E01_01/symbols.txt @@ -18771,7 +18771,7 @@ lbl_803ED948 = .data:0x803EDB28; // type:object size:0x20 scope:global lbl_803ED968 = .data:0x803EDB48; // type:object size:0x2C scope:global lbl_803ED994 = .data:0x803EDB74; // type:object size:0x2C scope:global __vt__10IAllocator = .data:0x803EDBA0; // type:object size:0x40 scope:global -lbl_803EDA00 = .data:0x803EDBE0; // type:object size:0x10 scope:global +__vt__16CCEParticleColor = .data:0x803EDBE0; // type:object size:0x10 scope:global __vt__18CCEKeyframeEmitter = .data:0x803EDBF0; // type:object size:0x10 scope:global __vt__8CCEPulse = .data:0x803EDC00; // type:object size:0x10 scope:global __vt__12CCETimeChain = .data:0x803EDC10; // type:object size:0x10 scope:global diff --git a/configure.py b/configure.py index e09c7800..73c88915 100755 --- a/configure.py +++ b/configure.py @@ -855,7 +855,7 @@ config.libs = [ Object(Matching, "Kyoto/Alloc/IAllocator.cpp"), Object(NonMatching, "Kyoto/PVS/CPVSVisOctree.cpp"), Object(NonMatching, "Kyoto/PVS/CPVSVisSet.cpp"), - Object(NonMatching, "Kyoto/Particles/CColorElement.cpp"), + Object(Matching, "Kyoto/Particles/CColorElement.cpp"), Object(NonMatching, "Kyoto/Particles/CElementGen.cpp"), Object(Matching, "Kyoto/Particles/CIntElement.cpp"), Object(NonMatching, "Kyoto/Particles/CModVectorElement.cpp"), diff --git a/include/Kyoto/Graphics/CColor.hpp b/include/Kyoto/Graphics/CColor.hpp index 63417c70..9e585f7f 100644 --- a/include/Kyoto/Graphics/CColor.hpp +++ b/include/Kyoto/Graphics/CColor.hpp @@ -16,17 +16,17 @@ class CInputStream; class CColor { public: CColor() { Set(255, 0, 255); } - CColor(uint col) { Set(col); } + CColor(const uint col) { Set(col); } CColor(CInputStream& in); - CColor(float r, float g, float b, float a = 1.f); - CColor(uchar r, uchar g, uchar b, uchar a = 255) { + CColor(const float r, const float g, const float b, const float a = 1.f); + CColor(const uchar r, const uchar g, const uchar b, const uchar a = 255) { mR = r; mG = g; mB = b; mA = a; } - void Set(float r, float g, float b, float a); + void Set(const float r, const float g, const float b, const float a); void Set(uchar r, uchar g, uchar b, uchar a = 255) { mR = r; mG = g; diff --git a/src/Kyoto/CFactoryStore.cpp b/src/Kyoto/CFactoryStore.cpp index 7b5bce24..e0cd12bc 100644 --- a/src/Kyoto/CFactoryStore.cpp +++ b/src/Kyoto/CFactoryStore.cpp @@ -6,8 +6,8 @@ public: CDummyFactory(IFactory& factory) : mFactory(factory){}; CToken GetObj(const SObjectTag& tag, CVParamTransfer xfer) { return CToken(); } CToken GetObj(const SObjectTag& tag) { return CToken(); }; - CToken GetObj(const char* name){}; - CToken GetObj(const char* name, CVParamTransfer xfer){}; + CToken GetObj(const char* name) { return CToken(); }; + CToken GetObj(const char* name, CVParamTransfer xfer) { return CToken(); }; bool HasObject(const SObjectTag& tag) { return false; } bool ObjectIsLive(const SObjectTag& tag) { return false; } IFactory& GetFactory() { return mFactory; } diff --git a/src/Kyoto/Particles/CColorElement.cpp b/src/Kyoto/Particles/CColorElement.cpp index a894259f..7a91ff9b 100644 --- a/src/Kyoto/Particles/CColorElement.cpp +++ b/src/Kyoto/Particles/CColorElement.cpp @@ -30,32 +30,12 @@ bool CCEConstant::GetValue(int frame, CColor& colorOut) const { return false; } -static inline void SetClamp(CColor& color, float r, float g, float b, float a) { - float cr = CMath::Clamp(0.f, r, 1.f); - float cg = CMath::Clamp(0.f, g, 1.f); - float cb = CMath::Clamp(0.f, b, 1.f); - float ca = CMath::Clamp(0.f, a, 1.f); - color.Set(cr, cg, cb, ca); - // color.Set( - // CMath::Clamp(0.f, r, 1.f), - // CMath::Clamp(0.f, g, 1.f), - // CMath::Clamp(0.f, b, 1.f), - // CMath::Clamp(0.f, a, 1.f) - // ); -} - -CCEFastConstant::CCEFastConstant(float r, float g, float b, float a) { - SetClamp(x4_val, r, g, b, a); - // float cr = CMath::Clamp(0.f, r, 1.f); - // float cg = CMath::Clamp(0.f, g, 1.f); - // float cb = CMath::Clamp(0.f, b, 1.f); - // float ca = CMath::Clamp(0.f, a, 1.f); - // x4_val.Set(cr, cg, cb, ca - // // CMath::Clamp(0.f, r, 1.f), - // // CMath::Clamp(0.f, g, 1.f), - // // CMath::Clamp(0.f, b, 1.f), - // // CMath::Clamp(0.f, a, 1.f) - // ); +CCEFastConstant::CCEFastConstant(const float r, const float g, const float b, const float a) { + float cr = CMath::Clamp(0.f, r, 1.f); + float cg = CMath::Clamp(0.f, g, 1.f); + float cb = CMath::Clamp(0.f, b, 1.f); + float ca = CMath::Clamp(0.f, a, 1.f); + x4_val.Set(cr, cg, cb, ca); } CCEFastConstant::~CCEFastConstant() {}