Commit Graph

45 Commits (master)

Author SHA1 Message Date
Evil Eye 5a0aed3a78 Use more decomposition, string_view, and implicit sizes in ESM code 9 months ago
AnyOldName3 818a99a870 Review 9 months ago
Evil Eye cef59e8928 Replace fixed size writeHNT calls with decomposition 10 months ago
Evil Eye 7d7e8939ab Use ESM::decompose to handle WPDTstruct 10 months ago
Evil Eye ec1c6ee171 Use ESM::decompose to handle ENAMstruct 10 months ago
elsid 6451750890
Write AiSequence and Script data field by field via decompose function
Use the same function to load and save to have single place with field order
definition. Use concepts for overload over different types.
12 months ago
Andrei Kortunov 93e50cc7aa Improve format version in content selector 1 year ago
Evil Eye 3e101ab409 Add a variadic getHNOT 1 year ago
Evil Eye c10b9297f0 Remove Sized methods from ESMReader 1 year ago
Evil Eye a9e6e63c4e Remove fixed size reads 1 year ago
Evil Eye 62f47acf6b Replace more explicitly sized reads and variable width integers 1 year ago
Evil Eye 48484c9416 Replace explicitly sized reads in aisequence 1 year ago
psi29a 7b4f7b7f07 Merge branch 'adjust_refnum' into 'master'
Adjust FormId in FormIdRefId and for items in containers when loading saves

See merge request OpenMW/openmw!3293
1 year ago
psi29a 5160fbc2a0 Merge branch 'fixedtimestamp' into 'master'
Move TimeStamp to ESM3 and remove sized reads

See merge request OpenMW/openmw!3295
1 year ago
Evil Eye 79b3855c5b Move TimeStamp to ESM3 and remove sized reads 1 year ago
Petr Mikheev 9a9f9d7081 Adjust FormId in FormIdRefId and for items in containers when loading saves 1 year ago
elsid dd54857610
Add missing array include 1 year ago
Evil Eye 6e5d84ce37 inline 1 year ago
Evil Eye 9d4877d432 Treat std::array like regular arrays 1 year ago
Evil Eye 45ba05c0ed Disallow implicitly sized reads of ESM structs 1 year ago
Petr Mikheev f09a689a4f Merge ESM::RefNum and ESM4::FormId 2 years ago
florent.teppe c39dd576f8 Gets rid of most ESM::CellId 2 years ago
elsid 0992624c8b
Support reading and writing typed ESM::RefId to ESM 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 a5ec108cfb
Add missing space 2 years ago
elsid 080700f8fe
Name all custom ESM format versions and add tests 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 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
elsid 063fff7fa4
Fix and prevent -Wextra-semi warning 2 years ago
clang-format-bot ddb0522bbf
Apply clang-format to code base 2 years ago
Project579 e5c417c968 Make sure all paths are passed as std::filesystem::path instead of std::string where possible. 2 years ago
elsid f99ed6f1db
Split components/misc/stringops.hpp into multiple headers
Replace all ciEqual overloads with one having std::string_view as argument.
2 years ago
elsid 3affe9913f
Limit the number of simultaneously open not actively used content files
Use LRU cache for ESMReaders. When cache capacity is reached close least
recently used ESMReader. Remember the file name if a reader was open. Once the
reader requested again open the file if there is stored name for it. Put
released ESMReader to the back of the free items list. Close ESMReader's from
the front of the free items list.

Cached item can be used only by one client at the same time. If the same item is
requested twice exception is thrown. This should never happen in practice. If
this happens need to fix the client logic.

It's allowed to go over the capacity limit when requesting different readers.
Ideally this should never happen but there will be system error anyway
signalizing about too many open files. Need to fix client logic in this case.

All places that were using a vector of ESMReaders now using the cache. Cache is
local for each use case and there is no need for a thread safety.
3 years ago
jvoisin 23eccebe9e Convert esmtool from `const std::string&` to `std::string_view` 3 years ago
elsid b09570692e
Use ifstream for ESMReader
ESMReader reads the whole file, there is no need in the ConstrainedFileStream.
3 years ago
elsid 4447ab0ed7
Remove ESM:: namespace qualifier in components/esm3/ and tests 3 years ago
psi29a 03806eb75e Merge branch 'esm_rm_redundant_include' into 'master'
Remove redundant include from esm3/esmreader.hpp

See merge request OpenMW/openmw!1761
3 years ago
elsid 6481324eb1
Read when need to skip few bytes 3 years ago
elsid db44f91fd5
Remove redundant include from esm3/esmreader.hpp 3 years ago
elsid c3a924de23
Fix skip DATA in cell ref loading 3 years ago
elsid 6b464a9330
Check ESMReader value size in compile time 3 years ago
elsid bbfdb347bd
Skip load cell ref when there is no need
Primarily to avoid temporary allocations by ESMReader::getHString.
3 years ago
elsid 3305b400dc
Use ESM::NAME instead of const char* and std::string as argument type 3 years ago
Bret Curtis d1fb854521 move most of the files from esm to esm3, keep common code in esm; this is make space for a future with esm4
esm typo

esm typo
3 years ago