diff options
Diffstat (limited to 'src/JSystem/J3DGraphBase/J3DStruct.cpp')
| -rw-r--r-- | src/JSystem/J3DGraphBase/J3DStruct.cpp | 120 |
1 files changed, 115 insertions, 5 deletions
diff --git a/src/JSystem/J3DGraphBase/J3DStruct.cpp b/src/JSystem/J3DGraphBase/J3DStruct.cpp index bc455e62c1..b273cafffe 100644 --- a/src/JSystem/J3DGraphBase/J3DStruct.cpp +++ b/src/JSystem/J3DGraphBase/J3DStruct.cpp @@ -7,6 +7,41 @@ #include "JSystem/J3DGraphBase/J3DStruct.h" #include "JSystem/JMath/JMath.h" +bool J3DTextureSRTInfo::operator==(J3DTextureSRTInfo& other) const { + if (mScaleX == other.mScaleX && + mScaleY == other.mScaleY && + mRotation == other.mRotation && + mTranslationX == other.mTranslationX && + mTranslationY == other.mTranslationY + ) { + return true; + } + return false; +} + +bool J3DLightInfo::operator==(J3DLightInfo& other) const { + if (mLightPosition.x == other.mLightPosition.x && + mLightPosition.y == other.mLightPosition.y && + mLightPosition.z == other.mLightPosition.z && + mLightDirection.x == other.mLightDirection.x && + mLightDirection.y == other.mLightDirection.y && + mLightDirection.z == other.mLightDirection.z && + mColor.r == other.mColor.r && + mColor.g == other.mColor.g && + mColor.b == other.mColor.b && + mColor.a == other.mColor.a && + mCosAtten.x == other.mCosAtten.x && + mCosAtten.y == other.mCosAtten.y && + mCosAtten.z == other.mCosAtten.z && + mDistAtten.x == other.mDistAtten.x && + mDistAtten.y == other.mDistAtten.y && + mDistAtten.z == other.mDistAtten.z + ) { + return true; + } + return false; +} + J3DLightInfo& J3DLightInfo::operator=(J3DLightInfo const& param_0) { JMath::gekko_ps_copy6(&mLightPosition, ¶m_0.mLightPosition); mColor = param_0.mColor; @@ -14,6 +49,42 @@ J3DLightInfo& J3DLightInfo::operator=(J3DLightInfo const& param_0) { return *this; } +bool J3DTexMtxInfo::operator==(J3DTexMtxInfo& other) const { + if (mProjection != other.mProjection || + mInfo != other.mInfo || + !(mSRT == other.mSRT) + ) { + return false; + } + if (mEffectMtx[0][0] != other.mEffectMtx[0][0] || + mEffectMtx[0][1] != other.mEffectMtx[0][1] || + mEffectMtx[0][2] != other.mEffectMtx[0][2] || + mEffectMtx[0][3] != other.mEffectMtx[0][3] || + mEffectMtx[1][0] != other.mEffectMtx[1][0] || + mEffectMtx[1][1] != other.mEffectMtx[1][1] || + mEffectMtx[1][2] != other.mEffectMtx[1][2] || + mEffectMtx[1][3] != other.mEffectMtx[1][3] || + mEffectMtx[2][0] != other.mEffectMtx[2][0] || + mEffectMtx[2][1] != other.mEffectMtx[2][1] || + mEffectMtx[2][2] != other.mEffectMtx[2][2] || + mEffectMtx[2][3] != other.mEffectMtx[2][3] || + mEffectMtx[3][0] != other.mEffectMtx[3][0] || + mEffectMtx[3][1] != other.mEffectMtx[3][1] || + mEffectMtx[3][2] != other.mEffectMtx[3][2] || + mEffectMtx[3][3] != other.mEffectMtx[3][3] + ) { + return false; + } + if ( + mCenter.x != other.mCenter.x || + mCenter.y != other.mCenter.y || + mCenter.z != other.mCenter.z + ) { + return false; + } + return true; +} + J3DTexMtxInfo& J3DTexMtxInfo::operator=(J3DTexMtxInfo const& param_0) { mProjection = param_0.mProjection; mInfo = param_0.mInfo; @@ -47,7 +118,30 @@ J3DIndTexMtxInfo& J3DIndTexMtxInfo::operator=(J3DIndTexMtxInfo const& param_0) { return *this; } -J3DFogInfo& J3DFogInfo::operator=(J3DFogInfo const& param_0) { +bool J3DFogInfo::operator==(J3DFogInfo& other) const { + if (mType == other.mType && + mAdjEnable == other.mAdjEnable && + mCenter == other.mCenter && + mStartZ == other.mStartZ && + mEndZ == other.mEndZ && + mNearZ == other.mNearZ && + mFarZ == other.mFarZ && + mColor.r == other.mColor.r && + mColor.g == other.mColor.g && + mColor.b == other.mColor.b && + mColor.a == other.mColor.a + ) { + for (int i = 0; i < 10; i++) { + if (mFogAdjTable.r[i] != other.mFogAdjTable.r[i]) { + return false; + } + } + return true; + } + return false; +} + +J3DFogInfo& J3DFogInfo::operator=(const J3DFogInfo& param_0) { mType = param_0.mType; mAdjEnable = param_0.mAdjEnable; mCenter = param_0.mCenter; @@ -55,15 +149,31 @@ J3DFogInfo& J3DFogInfo::operator=(J3DFogInfo const& param_0) { mEndZ = param_0.mEndZ; mNearZ = param_0.mNearZ; mFarZ = param_0.mFarZ; - mColor = param_0.mColor; + mColor.r = param_0.mColor.r; + mColor.g = param_0.mColor.g; + mColor.b = param_0.mColor.b; + mColor.a = param_0.mColor.a; for (int i = 0; i < 10; i++) { mFogAdjTable.r[i] = param_0.mFogAdjTable.r[i]; } return *this; } -J3DNBTScaleInfo& J3DNBTScaleInfo::operator=(J3DNBTScaleInfo const& param_0) { - mbHasScale = param_0.mbHasScale; - mScale = param_0.mScale; +bool J3DNBTScaleInfo::operator==(const J3DNBTScaleInfo& other) const { + if (mbHasScale == other.mbHasScale && + mScale.x == other.mScale.x && + mScale.y == other.mScale.y && + mScale.z == other.mScale.z + ) { + return true; + } + return false; +} + +J3DNBTScaleInfo& J3DNBTScaleInfo::operator=(const J3DNBTScaleInfo& other) { + mbHasScale = other.mbHasScale; + mScale.x = other.mScale.x; + mScale.y = other.mScale.y; + mScale.z = other.mScale.z; return *this; } |
