Add CMappableObject::IsDoorType

Former-commit-id: 960b828260
This commit is contained in:
Henrique Gemignani Passos Lima 2022-12-05 20:23:30 +02:00
parent 236045c563
commit b29e5337fc
2 changed files with 6 additions and 2 deletions

View File

@ -47,6 +47,11 @@ public:
rstl::pair< CColor, CColor > GetDoorColors(int idx, const CMapWorldInfo&, float alpha) const; rstl::pair< CColor, CColor > GetDoorColors(int idx, const CMapWorldInfo&, float alpha) const;
void Draw(int, const CMapWorldInfo&, float, bool) const; void Draw(int, const CMapWorldInfo&, float, bool) const;
static bool IsDoorType(EMappableObjectType type) {
return type >= kMOT_BlueDoor && type <= kMOT_PlasmaDoorFloor2;
}
private: private:
EMappableObjectType x0_type; EMappableObjectType x0_type;
EVisMode x4_visibilityMode; EVisMode x4_visibilityMode;

View File

@ -118,8 +118,7 @@ void CMappableObject::PostConstruct(const void*) { x10_transform = AdjustTransfo
void CMappableObject::Draw(int curArea, const CMapWorldInfo& mwInfo, float alpha, void CMappableObject::Draw(int curArea, const CMapWorldInfo& mwInfo, float alpha,
bool needsVtxLoad) const { bool needsVtxLoad) const {
bool flag = -1 < x0_type && x0_type < 0x10; if (IsDoorType(x0_type) == true) {
if (flag) {
rstl::pair< CColor, CColor > colors = GetDoorColors(curArea, mwInfo, alpha); rstl::pair< CColor, CColor > colors = GetDoorColors(curArea, mwInfo, alpha);
for (int i = 0; i < 6; ++i) { for (int i = 0; i < 6; ++i) {
if (needsVtxLoad) { if (needsVtxLoad) {