Commit Graph

1085 Commits (8e3576022a327c68c053f1869ff44997262aedd6)

Author SHA1 Message Date
florent.teppe 3bbf60373a Keep things coherent between references and and cell table 2 years ago
psi29a 70ddca78bf Merge branch 'ref_id_print_tests' into 'master'
Add more tests for printing RefId and clarify some constants

See merge request OpenMW/openmw!2945
2 years ago
elsid 7db14b3392
Add more tests for printing RefId and clarify some constants 2 years ago
elsid c97df7d770
Check FormIdRefId value in constructor 2 years ago
Petr Mikheev 00beb06391 Initial Lua bindings for ESM4 types; bindings for ESM4Door. 2 years ago
Evil Eye 97fb06d8c9 Add RefId::is 2 years ago
elsid 20129568e6
Replace VisitorCellIdIsESM3Ext with RefId::getIf function 2 years ago
Petr Mikheev ff774d6406 Load more ESM4 records 2 years ago
Petr Mikheev f09a689a4f Merge ESM::RefNum and ESM4::FormId 2 years ago
elsid bd10becb65
Use lexicographical comparison in ESM3ExteriorCellRefId::operator< 2 years ago
elsid 794050df63
Fix and add tests for ESM3ExteriorCellRefId serialization and text representation 2 years ago
florent.teppe 0d17e20490 Implements serialize/deserialize
fixes test compilation.
2 years ago
florent.teppe 21bd28542a Applies review advice
2d coord hash moved to hash.hpp file
format version adds suffix to be more coherent
don't use ESM::RefId::sEmpty
RefId equality with string_view, conversion to refId unecessary
action teleport remove test that mCellId is empty
removes some const references, when copy is enough
invalid refid => empty refid
removes useless change
2 years ago
florent.teppe d782d37ee2 Make sure Vec2iRefId is trivially copyable on GCC 11.3
std::pair<int, int> isn't trivially copyable on some compilers
so a specific struct is defined, it's an int pair, but it should be recognised by GCC 11.3 as trivially copyable

Vec2iRefId => ESM3ExteriorCellRefId

more explcit name and use mX,mY instead of pair
renamed files and enum
2 years ago
florent.teppe 4c15064a83 Create new Vec2i RefId for ESM3 exterior cells.
Applies the necessary changes to use !2708 for the new Id type
2 years ago
florent.teppe c39dd576f8 Gets rid of most ESM::CellId 2 years ago
psi29a 0a791528bc Merge branch 'fix_index_ref_id_hash' into 'master'
Shift record type value for IndexRefId hash

See merge request OpenMW/openmw!2885
2 years ago
elsid 171a25645a
Make sure there are tests for all RefId types 2 years ago
elsid 258aec223a
Shift record type value for IndexRefId hash 2 years ago
elsid 90ed24f4c9
Split type traits for ESM4, ESM3 and unite common 2 years ago
psi29a 8f80895b59 Merge branch 'build_fix' into 'master'
Add missing include

See merge request OpenMW/openmw!2860
2 years ago
Andrei Kortunov e1bee039ac Add missing include 2 years ago
elsid b7fdca0fe6
Use serialized ESM::RefId for Lua records 2 years ago
elsid cd4027ffd6
Do not use ESM::RefId::getRefIdString for spell id 2 years ago
elsid 04d7781424
Support not only StringRefId for checking first person body part 2 years ago
elsid e6cf516e12
Support index RefId as pair of record type and std::uint32_t 2 years ago
elsid 86293af084
Support generated RefId as std::uint64_t 2 years ago
elsid 0992624c8b
Support reading and writing typed ESM::RefId to ESM 2 years ago
elsid 069d4255b9
Make ESM::RefId to be fixed size cheap to copy
Use std::variant. Store refId strings in unordered_set and use pointer to an
item there. Inserts to unordered_set do not invalidate pointers to values so the
pointer is always valid. Elements are not removed. Assume there is finite number
of string refIds.
2 years ago
elsid 83d212fe0f
Use SFINAE to avoid conflicts between visit functions 2 years ago
elsid cd6a5b5a0e
Support asymmetric comparison between ESM::RefId and std::string_view 2 years ago
elsid dfcea389be
Add helper functions for string comparison to RefId 2 years ago
elsid 6518688120
Reorder RefId members 2 years ago
elsid 2fcb94064d
Support RefId comparison with std::string_view 2 years ago
elsid 996153f78d
Convert RefId to class 2 years ago
elsid 6d261d38dd
Add functions to read and write ESM::RefId and use them
To be later changed with another implementation.
2 years ago
elsid 80e6d6cbe3
Support variable size strings in ESM3 2 years ago
elsid 2e64155c0f
Use signed type for left record and files size in ESM3 reader context
Otherwise reading some of the records like ESM::CellRef without a subrecord
after could lead to underflow of ESM_Context::leftRec which makes
ESM::ESMReader::hasMoreSubs to return true and load hangs for a while trying to
read the same subrecord many times.

Fix ESM::Variant tests since it's now required to have a record for any ESM
data. Add 16 (size of record header) to all expected data sizes.
2 years ago
florent.teppe 084207af64 Avoids a lot a special cases for ESM3 vs ESM4 cells. 2 years ago
florent.teppe 1caed2de2a Applies some review comments.
Proper visit for ESM::CellVariant

Fixed MWWorldCell constructor
2 years ago
florent.teppe ebfee18e35 implements std::visit for CellVariant, fixes struct vs class forward decl 2 years ago
florent.teppe aa29f86efe fixed struct vs class. 2 years ago
florent.teppe 216ca71149 Applied review comments
getEditorName => getNameId
restored cosntructor in CoordinateConverter
2 years ago
florent.teppe e6e27413d9 gives MWWorld::CellRef the MWWorld::Cell treatment
MWWorld::CellRef now has a variant, and datas that are part of the intersection of both ESM4::Reference and ESM::CellRef are part of MWWorld::CellRef

For ESM4 most data isn't filled in, so it returns default values.
2 years ago
florent.teppe 23614ae2ae Renamed esm3esm4bridge => esmbridge 2 years ago
florent.teppe 5037dcf9bc Fixes a crash on launch and some compile issue
also uses std::visit in cellstore comparison to avoid missing combinasion

split loadrefs in loadref of ESM4 and ESM3.
2 years ago
florent.teppe cb8cdd8831 ESM::CellVariant aans MWWorld:Cell now take reference in constructor: signals that nullptr isn't accepted.
also applied other review comments.
2 years ago
florent.teppe 531e55e04c Better handling of the esm3 vs esm4 cell problem
Common attribute are in one structure that has two constructors, one for ESM3 vs ESM4 Cell
Mood part of MWWorld::Cell
2 years ago
florent.teppe 3515c8e61a Static references are created as refcells, nothing displayed yet. 2 years ago
florent.teppe c896a2ca48 Crashfix on launch 2 years ago