Moved fourcc_from_cstr back into esx_reader.hpp. Not entirely sure where it should live.

This commit is contained in:
2022-10-27 15:47:41 +11:00
parent d01b2cfb3e
commit 8a3be3b67f
2 changed files with 7 additions and 7 deletions

View File

@@ -160,6 +160,13 @@ private:
[[nodiscard]] Header read_header(std::istream &in);
// Convert a compatible C string to a FourCC (e.g. "LITR")
static consteval FourCC fourcc_from_cstr(const char(&a)[5]) noexcept
{
char temp[4] = { a[0], a[1], a[2], a[3] };
return std::bit_cast<FourCC, char[4]>(temp);
}
}
#endif // ESX_READER_HPP

View File

@@ -15,13 +15,6 @@ static constexpr std::pair<GroupType, std::string_view> group_type_name_map_buil
{GroupType::CellTemporaryChildren , "Cell Temporary Children" },
};
// Convert a compatible C string to a FourCC (e.g. "LITR")
static consteval FourCC fourcc_from_cstr(const char(&a)[5]) noexcept
{
char temp[4] = { a[0], a[1], a[2], a[3] };
return std::bit_cast<FourCC, char[4]>(temp);
}
static constexpr std::pair<RecordType, FourCC> record_type_fourcc_map_builtin[] {
{RecordType::AACT, fourcc_from_cstr("AACT")},
{RecordType::ACHR, fourcc_from_cstr("ACHR")},