Match and link CMaterialFilter/List

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

View File

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

View File

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

View File

@ -410,10 +410,10 @@ COLLISION :=\
$(BUILD_DIR)/asm/Collision/CCollisionInfo.o\
$(BUILD_DIR)/asm/Collision/InternalColliders.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/CCollidableSphere.o\
$(BUILD_DIR)/asm/Collision/CMaterialFilter.o\
$(BUILD_DIR)/src/Collision/CMaterialFilter.o\
$(BUILD_DIR)/asm/Collision/COBBox.o\
$(BUILD_DIR)/src/Collision/CMRay.o\

View File

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