1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-14 09:40:39 +00:00
Commit Graph

31 Commits

Author SHA1 Message Date
florent.teppe
c39dd576f8 Gets rid of most ESM::CellId 2023-04-03 14:16:05 +02:00
elsid
2fcb94064d
Support RefId comparison with std::string_view 2023-02-28 23:04:48 +01:00
elsid
996153f78d
Convert RefId to class 2023-02-15 23:20:44 +01:00
florent.teppe
3780033837 Reverts Cell name to a string 2023-01-21 18:39:42 +01:00
florent.teppe
2c30575b3b CellName is now a RefId, makes more sense that way. 2022-12-27 19:16:21 +01:00
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
2022-12-27 19:15:57 +01:00
fteppe
2f2e401559 is Hidden marker now takes a const RefId& instead of a string_view 2022-12-27 19:15:55 +01:00
fteppe
ee941f9b09 RefId's mId can't be get as mutable from the outside
also removed useless operator= defintion
2022-12-27 19:15:55 +01:00
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!
2022-12-27 19:15:54 +01:00
elsid
843753da14
Remove unused includes 2022-10-09 16:44:18 +02:00
clang-format-bot
ddb0522bbf
Apply clang-format to code base 2022-09-22 21:35:26 +03:00
Project579
a13709c510 Replace implicit convertions from std::filesystem::path to std::string with correctly converting functions. 2022-09-11 14:41:20 +02:00
Project579
e5c417c968 Make sure all paths are passed as std::filesystem::path instead of std::string where possible. 2022-09-11 14:41:15 +02:00
elsid
f99ed6f1db
Split components/misc/stringops.hpp into multiple headers
Replace all ciEqual overloads with one having std::string_view as argument.
2022-08-03 22:06:24 +02:00
elsid
9c93de65be
Show groundcover loading progress 2022-06-05 22:21:12 +02:00
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.
2022-06-03 01:29:03 +02:00
jvoisin
4e4debb1cb Remove even more of boost::filesystem 2022-05-25 18:29:02 +00:00
Evil Eye
22d02e86b0 Respect ignored flag in navmeshtool and groundcover 2022-04-17 09:23:09 +02:00
elsid
b09570692e
Use ifstream for ESMReader
ESMReader reads the whole file, there is no need in the ConstrainedFileStream.
2022-04-15 02:58:57 +02:00
elsid
194c11f214
Fix loading order in EsmLoader
Need to load the last present record from a sequence of loaded records. That
means reverse should be called before unique or unique should be applied for
a reversed range. Since unique keeps only the first element from a sub
sequence of equal elements.

Use forEachUnique with reversed range to avoid redundant container
modifications.
2022-04-13 09:33:24 +02:00
elsid
db44f91fd5
Remove redundant include from esm3/esmreader.hpp 2022-04-10 22:16:32 +02:00
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
2022-01-23 17:04:48 +01:00
elsid
5129ab39fc
Check extension in lower case 2021-12-09 00:06:33 +01:00
psi29a
a332dec681 Merge branch 'fix_esm_loader' into 'master'
Load only supported content formats by EsmLoader

See merge request OpenMW/openmw!1427
2021-11-30 15:51:22 +00:00
elsid
da0c5b54f0
Load only supported content formats by EsmLoader 2021-11-22 20:58:48 +01:00
Andrei Kortunov
3275440f0d Use a separate storage for groundcover data 2021-11-14 19:11:42 +04:00
Bo Svensson
4657c655b1 refactors parentFileIndices (#3211)
This PR aims to start addressing `ESM` design issues that have silenced errors we incorporated into groundcover `ESM` loading approaches.

- We move the resolution of `parentFileIndices` from `ESMStore` to `ESMReader` as suggested in a `TODO` comment.
- We improve a highly misleading comment which downplayed the significance of `parentFileIndices`.
- We document important preconditions.
- We move a user facing error message to the highest level and improve its context.
- We remove an inappropriate `setGlobalReaderList` method. We now pass this reader list into the method that requires it.
- We remove a thoroughly pointless optimisation of `Store<ESM::LandTexture>`'s construction that has unnecessarily depended on `getGlobalReaderList`.

There should be no functional changes for `master`, but this PR should remove an issue blocking PR #3208.
2021-11-03 11:07:28 +01:00
psi29a
1ffa02b2fd Merge branch 'fix_windows_tests' into 'master'
Fix tests on windows

See merge request OpenMW/openmw!1313
2021-10-22 12:35:10 +00:00
elsid
b5f0057ac9
Fix tests on windows 2021-10-21 19:48:31 +02:00
elsid
a3b6bc7263
Fix logic expression for not found value 2021-10-20 17:48:10 +02:00
elsid
046b5f83ee
Add ESM data loader
A component to load ESM content files with limited support for record types and
selection which of them to load. Supported record types are:
ACTI, CELL, CONT, DOOR, GMST, LAND, STAT.
2021-10-17 19:55:29 +02:00