mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-27 21:41:37 +00:00
improved readability of esm3Recname and esm4Recname
This commit is contained in:
parent
1ed22a298d
commit
9e40550a4a
1 changed files with 8 additions and 3 deletions
|
@ -91,12 +91,17 @@ bool inline operator!= (const Position& left, const Position& right) noexcept
|
||||||
constexpr unsigned int esm4RecnameFlag = 0x00800000;
|
constexpr unsigned int esm4RecnameFlag = 0x00800000;
|
||||||
|
|
||||||
constexpr unsigned int esm3Recname(const char(&name)[5]) {
|
constexpr unsigned int esm3Recname(const char(&name)[5]) {
|
||||||
return (fourCC(name) & esm4RecnameFlag) == 0 ? fourCC(name) : throw std::logic_error("there must be no collision between esm3 records and esm4 records"); //The throw errors ensures at compile time that no collision between ESM4 and ESM3 is possible
|
if ((fourCC(name) & esm4RecnameFlag) == 0)
|
||||||
|
return fourCC(name);
|
||||||
|
else
|
||||||
|
throw std::logic_error("there must be no collision between esm3 records and esm4 records"); //The throw errors ensures at compile time that no collision between ESM4 and ESM3 is possible
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr unsigned int esm4Recname(const ESM4::RecordTypes recType) {
|
constexpr unsigned int esm4Recname(const ESM4::RecordTypes recType) {
|
||||||
|
if ((recType & esm4RecnameFlag) == 0)
|
||||||
return (recType & esm4RecnameFlag) == 0 ? (recType | esm4RecnameFlag) : throw std::logic_error("there must be no collision between esm3 records and esm4 records");//The throw errors ensures at compile time that no collision between ESM4 and ESM3 is possible
|
return (recType | esm4RecnameFlag);
|
||||||
|
else
|
||||||
|
throw std::logic_error("there must be no collision between esm3 records and esm4 records");//The throw errors ensures at compile time that no collision between ESM4 and ESM3 is possible
|
||||||
}
|
}
|
||||||
|
|
||||||
enum RecNameInts : unsigned int
|
enum RecNameInts : unsigned int
|
||||||
|
|
Loading…
Reference in a new issue