Commit Graph

26 Commits (master)

Author SHA1 Message Date
Petr Mikheev 32f3a16db3 Change FormId::toString to be consistent with RefId. Remove FormIdRefId. 1 year ago
Petr Mikheev 5d54ca6fdb Refactor components/esm4 1 year ago
Evil Eye c59032fd66 Make RefId::deserializeText return an empty RefId if no pre-existing StringRefId can be found 1 year 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
Petr Mikheev f09a689a4f Merge ESM::RefNum and ESM4::FormId 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
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 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 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 2fcb94064d
Support RefId comparison with std::string_view 2 years ago
psi29a 83718878b2 Merge branch 'Load_ESM4' into 'master'
Loading ESM4 data and storing them in the ESMStore

See merge request OpenMW/openmw!2557
2 years ago
florent.teppe c721a6cafa Initial commit to load ESM4
Some data is actually loaded and store in ESM Store
Any new ESM4 will go through the same code path and be automatically sent to the right store
2 years ago
elsid 755067f0f3
Remove redundant ESM::RefId member functions 2 years ago
florent.teppe dc21df97c8 Fixed issue with getSummonedCreature( that returned a reference to a non const static value
Fix compile, and apply review comment

Fixed greater vs more typo.

getCellname is back to a string view.

Because in most cases was used as a strong not a refId.
and there was a fundamental issue with region names used as a cellname
2 years ago
florent.teppe d49f60d2d6 To change fewer things with the master implementation, the Id isn't changed to lower case on creation
lower case utility functions used in comparison functions
2 years ago
florent.teppe 65cdd489fb create a specific esm reader function for RefID to avoid allocation for string and then again for RefId
Fixed some types

removed useless header

applied clang format

fixed compile tests

fixed clang tidy, and closer to logic before this MR

Removed hardcoded refids

unless there is a returned value we don't use static RefIds
can use == between RefId and hardcoded string

Fix clang format

Fixed a few instances where std::string was used, when only const std::string& was needed

removed unused variable
2 years ago
fteppe c283ea0ae8 string_view& => string_view
fixed ref to temp variable
2 years ago
fteppe 7da38113be Changed more hardcoded RefId to be static to avoid multiple runtime creations
adresses multiple review comments
2 years ago
fteppe 0d68735e23 moved all code in CPP in ESM namespace since it was already necessary for << operator
in the equality operator, no longer need ciequal since the id is already always lowercase
2 years ago
fteppe c8bb733360 removed clear() function, the only way to change the Id from the outside is from the assignment operator
replaced ciEqual with == operator
2 years ago
fteppe d6d2a37d03 some clean and better comments 2 years ago
fteppe 125b21de20 Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID

Slowly going through all the changes to make, still hundreds of errors

a lot of functions/structures use std::string or stringview to designate an ID. So it takes time

Continues slowly replacing ids. There are technically more and more compilation errors

I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type

Continue moving forward, changes to the stores

slowly moving along

Starting to see the fruit of those changes.

still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.

More replacements. Things are starting to get easier

I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.

Still moving forward, and for the first time error count is going down!

Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably

Cells are back to using string for the name, haven't fixed everything yet. Many other changes

Under the bar of 400 compilation errors.

more good progress <100 compile errors!

More progress

Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string

some more progress on other fronts

Mostly game settings clean

one error opened a lot of other errors. Down to 18, but more will prbably appear

only link errors left??

Fixed link errors

OpenMW compiles, and launches, with some issues, but still!
2 years ago