Match and link CMaterialFilter/List

Former-commit-id: 480e975add
This commit is contained in:
Phillip Stephens 2022-10-06 11:26:18 -07:00
parent 1d574dea1c
commit 54e2e23a86
4 changed files with 9 additions and 15 deletions

View File

@ -29,6 +29,7 @@ COMPLETE_OBJECTS = [
"MetroidPrime/ScriptObjects/CScriptDebugCameraWaypoint", "MetroidPrime/ScriptObjects/CScriptDebugCameraWaypoint",
"Weapons/IWeaponRenderer", "Weapons/IWeaponRenderer",
"Collision/CMaterialList", "Collision/CMaterialList",
"Collision/CMaterialFilter",
"Collision/CMRay", "Collision/CMRay",
"Kyoto/Basics/CStopwatch", "Kyoto/Basics/CStopwatch",
"Kyoto/Basics/COsContextDolphin", "Kyoto/Basics/COsContextDolphin",

View File

@ -118,8 +118,8 @@ public:
// Intersection__13CMaterialListCFRC13CMaterialList weak // Intersection__13CMaterialListCFRC13CMaterialList weak
static s32 BitPosition(u64 flags); static s32 BitPosition(u64 flags);
// GetMaterialString__13CMaterialListCFv weak // GetMaterialString__13CMaterialListCFv weak
u64 SharesMaterials(const CMaterialList& other) const { bool SharesMaterials(const CMaterialList& other) const {
return (other.value & value); return (other.value & value) ? true : false;
} }
private: private:

View File

@ -410,10 +410,10 @@ COLLISION :=\
$(BUILD_DIR)/asm/Collision/CCollisionInfo.o\ $(BUILD_DIR)/asm/Collision/CCollisionInfo.o\
$(BUILD_DIR)/asm/Collision/InternalColliders.o\ $(BUILD_DIR)/asm/Collision/InternalColliders.o\
$(BUILD_DIR)/asm/Collision/CCollisionPrimitive.o\ $(BUILD_DIR)/asm/Collision/CCollisionPrimitive.o\
$(BUILD_DIR)/asm/Collision/CMaterialList.o\ $(BUILD_DIR)/src/Collision/CMaterialList.o\
$(BUILD_DIR)/asm/Collision/CollisionUtil.o\ $(BUILD_DIR)/asm/Collision/CollisionUtil.o\
$(BUILD_DIR)/asm/Collision/CCollidableSphere.o\ $(BUILD_DIR)/asm/Collision/CCollidableSphere.o\
$(BUILD_DIR)/asm/Collision/CMaterialFilter.o\ $(BUILD_DIR)/src/Collision/CMaterialFilter.o\
$(BUILD_DIR)/asm/Collision/COBBox.o\ $(BUILD_DIR)/asm/Collision/COBBox.o\
$(BUILD_DIR)/src/Collision/CMRay.o\ $(BUILD_DIR)/src/Collision/CMRay.o\

View File

@ -7,18 +7,11 @@ bool CMaterialFilter::Passes(const CMaterialList& other) const {
case kFT_Always: case kFT_Always:
return true; return true;
case kFT_Include: case kFT_Include:
return other.SharesMaterials(include) != 0 ? true : false; return other.SharesMaterials(include);
case kFT_Exclude: case kFT_Exclude:
return other.SharesMaterials(exclude) == 0; return !other.SharesMaterials(exclude);
case kFT_IncludeExclude: { case kFT_IncludeExclude:
bool ret = false; return other.SharesMaterials(include) && !other.SharesMaterials(exclude);
if (other.SharesMaterials(include) != 0) {
if (other.SharesMaterials(exclude) == 0) {
ret = true;
}
}
return ret;
}
default: default:
return true; return true;
} }