From 0723c324285aff6ccdd5bcca263ae1fae686d601 Mon Sep 17 00:00:00 2001 From: "florent.teppe" Date: Sat, 28 Jan 2023 19:47:04 +0100 Subject: [PATCH] flags no longer bitfield --- apps/openmw/mwworld/cell.cpp | 10 +++++----- apps/openmw/mwworld/cell.hpp | 9 ++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/apps/openmw/mwworld/cell.cpp b/apps/openmw/mwworld/cell.cpp index 372f130fcd..5f43b5bd43 100644 --- a/apps/openmw/mwworld/cell.cpp +++ b/apps/openmw/mwworld/cell.cpp @@ -17,9 +17,9 @@ namespace MWWorld mRegion = ESM::RefId::sEmpty; // Unimplemented for now - mFlags.hasWater = (cell.mCellFlags & ESM4::CELL_HasWater) != 0; + mFlags.hasWater = cell.mCellFlags & ESM4::CELL_HasWater; mFlags.isExterior = !(cell.mCellFlags & ESM4::CELL_Interior); - mFlags.isQuasiExterior = (cell.mCellFlags & ESM4::CELL_QuasiExt) != 0; + mFlags.isQuasiExterior = cell.mCellFlags & ESM4::CELL_QuasiExt; mFlags.noSleep = false; // No such notion in ESM4 mCellId.mWorldspace = Misc::StringUtils::lowerCase(cell.mEditorId); @@ -44,10 +44,10 @@ namespace MWWorld mRegion = ESM::RefId::sEmpty; // Unimplemented for now - mFlags.hasWater = (cell.mData.mFlags & ESM::Cell::HasWater) != 0; + mFlags.hasWater = cell.mData.mFlags & ESM::Cell::HasWater; mFlags.isExterior = !(cell.mData.mFlags & ESM::Cell::Interior); - mFlags.isQuasiExterior = (cell.mData.mFlags & ESM::Cell::QuasiEx) != 0; - mFlags.noSleep = (cell.mData.mFlags & ESM::Cell::NoSleep) != 0; + mFlags.isQuasiExterior = cell.mData.mFlags & ESM::Cell::QuasiEx; + mFlags.noSleep = cell.mData.mFlags & ESM::Cell::NoSleep; mCellId = cell.getCellId(); diff --git a/apps/openmw/mwworld/cell.hpp b/apps/openmw/mwworld/cell.hpp index f8545f40e3..902f2487e0 100644 --- a/apps/openmw/mwworld/cell.hpp +++ b/apps/openmw/mwworld/cell.hpp @@ -53,11 +53,10 @@ namespace MWWorld private: struct { - uint8_t isExterior : 1; - uint8_t isQuasiExterior : 1; - uint8_t hasWater : 1; - uint8_t noSleep : 1; - uint8_t _free : 4; + bool isExterior; + bool isQuasiExterior; + bool hasWater; + bool noSleep; } mFlags; osg::Vec2i mGridPos;