From b29e5337fc14573e52c77a8eb970917f949f0b40 Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Mon, 5 Dec 2022 20:23:30 +0200 Subject: [PATCH] Add CMappableObject::IsDoorType Former-commit-id: 960b828260dd83f2486acedc560183a25456efd7 --- include/MetroidPrime/CMappableObject.hpp | 5 +++++ src/MetroidPrime/CMappableObject.cpp | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/MetroidPrime/CMappableObject.hpp b/include/MetroidPrime/CMappableObject.hpp index f90666a0..869cdc19 100644 --- a/include/MetroidPrime/CMappableObject.hpp +++ b/include/MetroidPrime/CMappableObject.hpp @@ -47,6 +47,11 @@ public: rstl::pair< CColor, CColor > GetDoorColors(int idx, const CMapWorldInfo&, float alpha) const; void Draw(int, const CMapWorldInfo&, float, bool) const; + + static bool IsDoorType(EMappableObjectType type) { + return type >= kMOT_BlueDoor && type <= kMOT_PlasmaDoorFloor2; + } + private: EMappableObjectType x0_type; EVisMode x4_visibilityMode; diff --git a/src/MetroidPrime/CMappableObject.cpp b/src/MetroidPrime/CMappableObject.cpp index ce7372d2..794610b3 100644 --- a/src/MetroidPrime/CMappableObject.cpp +++ b/src/MetroidPrime/CMappableObject.cpp @@ -118,8 +118,7 @@ void CMappableObject::PostConstruct(const void*) { x10_transform = AdjustTransfo void CMappableObject::Draw(int curArea, const CMapWorldInfo& mwInfo, float alpha, bool needsVtxLoad) const { - bool flag = -1 < x0_type && x0_type < 0x10; - if (flag) { + if (IsDoorType(x0_type) == true) { rstl::pair< CColor, CColor > colors = GetDoorColors(curArea, mwInfo, alpha); for (int i = 0; i < 6; ++i) { if (needsVtxLoad) {