Commit Graph

138 Commits (8cf431aeb2b80907e25d941ee6078da0236720e7)

Author SHA1 Message Date
florent.teppe 56cb2a83ec removed sDefaultWorldspace, only sDefaultWorldspaceId now.
sDefaultWorldspaceId is a StringRefId to be able to getvalue easily.
2 years ago
florent.teppe a62e75fd19 Initial attempt at loading esm4 exteriors 2 years ago
elsid 0601d7213e
Remove ESM::RefId::sEmpty
This variable is only required to return empty RefId as const reference. There
is no point in doing so for a type cheap to copy.
2 years ago
elsid b33d12b8e1
Add missing and remove redundant includes 2 years ago
Petr Mikheev f09a689a4f Merge ESM::RefNum and ESM4::FormId 2 years ago
Evil Eye 8d8207b734 Refactor pathgrid indices to use size_t instead of int 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 53b14c8b42 fix tests
hopefully also fixes clang tidy
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 1e0c3bfdec fixes integration tests
we still want to be able to write using old formats
2 years ago
florent.teppe f99e65843a Removes most cellId.hpp include, simplifies id generation for cells. 2 years ago
florent.teppe c2182c2fcc Get Rid of ESM::CellId almost everywhere
it was a competing concept from using RefIds for cell.
There is almost no point to it now, except to load older data.
2 years ago
florent.teppe fb6701ac1a ESM::CellId is no longer stored on saves. 2 years ago
florent.teppe c39dd576f8 Gets rid of most ESM::CellId 2 years ago
florent.teppe 9f597ecfea No more Cellid used by ESM4 cells
and that also means it is no longer used by MWWorld::Cell
fixes tests
2 years ago
florent.teppe 3f678c3b0a Dest Door and teleport use ESM::RefId
This changes a lot of files as a consequence.
Still buggy, moving to exterior doesn't bring to the right place yet
coc "seyda neen" doesn't work. SO I broke somehting when fetching a cell from a name
2 years ago
florent.teppe 36502eaf75 ESM3 Cells have an Id.
Store<ESM::Cell> is updated to use it.
2 years ago
Andrei Kortunov 8c6616214b Remove redundant quotes 2 years ago
elsid 9162eaa019
Test more ESM::Player records 2 years ago
elsid 452d1e7e49
Store original string id for Dialogue records 2 years ago
elsid 06f42ba69c
Use fixed size enum type for ESM::Dialogue::mType 2 years ago
elsid 4716583f3e
Set ESM::Dialogue::mType on blank and skip load 2 years ago
elsid 90ed24f4c9
Split type traits for ESM4, ESM3 and unite common 2 years ago
elsid d5954aba68
Add suffix to the format version name 2 years ago
Evil Eye 54d6fb29c2 Don't store a save's cell name as a RefID 2 years ago
elsid d1e8e56619
Make QuickKey type a fixed size enum class 2 years ago
elsid eb79b29512
Use ranged for loop 2 years ago
elsid 2135eba103
Fix loading ESM3 QuickKeys 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
psi29a a60f657f5a Merge branch 'fast_cell4_load' into 'master'
Lazy loading of ESM4::reference

See merge request OpenMW/openmw!2804
2 years ago
psi29a 2ff4a5a11a Merge branch 'cs_fix_info_collection' into 'master'
Fix loading, inserting and moving topic info records

See merge request OpenMW/openmw!2806
2 years ago
Petr Mikheev 0b385d5db9 Create MWWorld::SafePtr 2 years ago
elsid e032214fcb
Use common info ordering implementation for engine and editor 2 years ago
elsid e892c62b10
Fix loading, inserting and moving topic info records
Topic info records need to have specific order defined via mNext and mPrev
fields (next and previous records). When loading multiple files a record may be
inserted into middle of the topic but neighborhood records may not be aware of
it. Having the order it's possible to move the records within one topic.

Sort the record once after loading all content files but preserve the order for
all other operations. Use std::map to group info ids by topic to make sure the
topics order is stable. Keep order within a topic for info ids on loading new
records. Use this order later for sorting the records.
2 years ago
florent.teppe 170b732854 readers cache keep a stateless encoder
to keep access to the current encoding configuration

build linux
2 years ago
psi29a 0ed1310417 Merge branch 'fix_fog_state_load' into 'master'
Fix loading fog state

See merge request OpenMW/openmw!2743
2 years ago
elsid b5ec584be2
Replace ESM::RefId::sEmpty by default constructed RefId where possible
Static const is only required to provide a reference or a pointer when it is not
possible with default constructed temporary.
2 years ago
elsid 959de6f4c1
Avoid UB on empty fog data record 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 beb017e699
Do not truncate too long strings on writing ESM 2 years ago
elsid c0c723bb1b
Add const to read only function 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
elsid a5ec108cfb
Add missing space 2 years ago
elsid 4f683d1ee9
Throw exception on failed write 2 years ago