Commit Graph

329 Commits (master)

Author SHA1 Message Date
florent.teppe 6ff90b34a8 Fixed an issue with RefId in CellRefs where Ids wouldn't be loaded
Fixed multiple issues from the review.
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 20da0892ef openMW_test_suite compiles and runs
Slowly moving through the open-cs errors

Good progress in openCS

Very good progress on openCS

Getting closer with openCS

OpenCS compiles and runs! Didn't have time to test it all though

ix openMW

everything compiles on windows??

Fix gcc

Fix Clang
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 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
Evil Eye bbbcc5e4b7 Add an early out to dialogue loading to match Morrowind.exe behaviour 2 years ago
psi29a c164437d91 Merge branch 'classism' into 'master'
Use class service flags for autocalc NPCs

Closes #7044

See merge request OpenMW/openmw!2461
2 years ago
elsid 843753da14
Remove unused includes 2 years ago
Evil Eye 60c26832d2 Use class service flags for autocalc NPCs 2 years ago
elsid 063fff7fa4
Fix and prevent -Wextra-semi warning 2 years ago
Evil Eye e6592aa850 Add key flag on load 2 years ago
clang-format-bot ddb0522bbf
Apply clang-format to code base 2 years ago
AnyOldName3 84f8a6848a Renormalise line endings
This should replace accidental CRLF with LF
2 years ago
elsid 51314db2f1
Remove AI_CNDT from AI package types
AI_CNDT is a label of subrecord containing cell name. It's not AI package type.
2 years ago
elsid 52b7b66e9f
Add comma to the last array element to prevent putting multiple elements on a single line 2 years ago
Project579 a13709c510 Replace implicit convertions from std::filesystem::path to std::string with correctly converting functions. 2 years ago
Project579 e5c417c968 Make sure all paths are passed as std::filesystem::path instead of std::string where possible. 2 years ago
AnyOldName3 4e8e2e1c60 Eliminate &thing[0] pattern 2 years ago
Alexei Kotov a8e561d885 Avoid issues with saved games that have no screenshot data 2 years ago
elsid cc8c7002ea
Cleanup components includes 2 years ago
psi29a b382e92953 Merge branch 'please_dont_copy_my_nfts' into 'master'
Prevent various values from being copied

See merge request OpenMW/openmw!2267
2 years ago
Andrei Kortunov e3ad30a517 Do not copy data when it is not needed 2 years ago
Evil Eye eaa108d25d Return string_view from SoundId methods 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
Evil Eye 3967509cdd Use meaningful names instead of pretending we don't know what snow is 2 years ago
jvoisin 498a835b77 Merge branch 'coverity' into 'master'
Fix some Coverity issues

See merge request OpenMW/openmw!2082
3 years ago
Andrei Kortunov fe785ea788 Don't cast away const when we can avoid it 3 years ago
Andrei Kortunov aa349f2ed9 Initialize some missing variables 3 years ago
psi29a 9c1970dce4 Merge branch 'lua_esm' into 'master'
Advanced Lua scripts configuration in omwaddon

See merge request OpenMW/openmw!1947
3 years ago
Evil Eye 10e4eb8e8e Append orphaned dialogue instead of always appending it 3 years ago
Petr Mikheev a70d5831c5 Lua scripts configuration in omwaddon 3 years ago
psi29a 58fd560ce9 Merge branch 'esm_readers_cache' into 'master'
Limit the number of simultaneously open not actively used content files (#6756)

Closes #6756

See merge request OpenMW/openmw!1966
3 years ago
jvoisin df0cd86cf4 Use the proper types 3 years ago
jvoisin 6c71071083 Make the sRedcordId constexpr 3 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
Evil Eye bb495bffeb 0 initialize mRecordFlags 3 years ago
jvoisin 6feb92a9bf Remove boost::filesystem from a couple of files 3 years ago
psi29a f17d7fc00b Merge branch 'string_view' into 'master'
Make getStringLiteral return a string_view

See merge request OpenMW/openmw!1896
3 years ago
jvoisin fb732d74a2 Remove boost::filesystem from bsatool 3 years ago
Evil Eye ac78b537d2 Address feedback 3 years ago
jvoisin 23eccebe9e Convert esmtool from `const std::string&` to `std::string_view` 3 years ago
Evil Eye 134dc2b21b Address feedback on !1857 3 years ago
Evil Eye c0cc5feecd Initialize DialInfo::DATAstruct with the proper blank values 3 years ago
jvoisin 331363d469 Merge branch 'fix_uninit' into 'master'
Fix uninitialized coverity warnings

See merge request OpenMW/openmw!1819
3 years ago
Evil Eye a64979e25d Replace empty std::string assignments 3 years ago
elsid b67a0a8f2b
Fix uninitialized coverity warnings 3 years ago
elsid 92538dde89
End SNAM record as SNAM record 3 years ago
Evil Eye 9a96d64611 Use subrecord size instead of version to load WEAT 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
psi29a cf1764f255 Merge branch 'constrained_file_stream' into 'master'
Avoid redundant conversion to const char* and use make_shared

See merge request OpenMW/openmw!1763
3 years ago
elsid 6481324eb1
Read when need to skip few bytes 3 years ago
elsid 5eb8c4aebe
Avoid redundant conversion to const char* and use make_shared 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
psi29a 6d55317d57 Merge branch 'refactor/prng-2' into 'master'
Save random state and refactor usage of generators

See merge request OpenMW/openmw!1715
3 years ago
ζeh Matt b502dc12f0
Add prng to World instance and serialize state in Save 3 years ago
Evil Eye 484a7c7b7e Base dialogue order solely on mPrev 3 years ago
duncanspumpkin 3a117cac22 Switch to a constexpr for FourCC constant
Add static asssert on wrong size
3 years ago
Matt 54e114d83e Avoid string copies for ESM::Variant::getString 3 years ago
elsid 3c66a927d8
Fix coverity issue about uninitialized members of LevelledListBase
* Remove explicit constructor.
* Use static constexpr where possible.
* Use CRTP to get RecName.
3 years ago
elsid 595c2e0a8e
Use unique_ptr to manage AiPackage lifetime 3 years ago
psi29a 776b286286 Merge branch 'esm_name' into 'master'
Use ESM::NAME instead of const char* and std::string as argument type

See merge request OpenMW/openmw!1659
3 years ago
elsid 3305b400dc
Use ESM::NAME instead of const char* and std::string as argument type 3 years ago
Evil Eye 649c2f8286 Fix stats not working right for saves started before version 17 3 years ago
elsid c75e938c46
Return string_view from Utf8Encoder functions
To avoid redundant std::string constructions.
3 years ago
elsid c9c7fb7e49
Remove redundant functions from Utf8Encoder interface 3 years ago
jvoisin 4cd6d2dacf Merge branch 'rework_fixed_string' into 'master'
Rework fixed string

See merge request OpenMW/openmw!1596
3 years ago
elsid b17c9a22ff
Disallow to call ESMWriter::writeT with pointer type
This will make ESMWriter to use a pointer to this pointer to access the data
that is unlikely an intent. For example:
68ef96410c.
3 years ago
Petr Mikheev 4554a075e7 Merge branch 'fix_save_corruption' into 'master'
Fix save corruption introduced by https://gitlab.com/OpenMW/openmw/-/merge_requests/1600

See merge request OpenMW/openmw!1607
3 years ago
uramer de2383ec98 Fix save corruption introduced by https://gitlab.com/OpenMW/openmw/-/merge_requests/1600 3 years ago
elsid bebeff8881
Fix build with libc++
/home/elsid/dev/openmw/components/esm3/objectstate.cpp:33:30: error: implicit instantiation of undefined template 'std::array<float, 6>'
        std::array<float, 6> pos;
                             ^
/usr/bin/../include/c++/v1/__tuple:219:64: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
                                                               ^
/home/elsid/dev/openmw/components/esm3/objectstate.cpp:78:30: error: implicit instantiation of undefined template 'std::array<float, 6>'
        std::array<float, 6> pos;
                             ^
/usr/bin/../include/c++/v1/__tuple:219:64: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
                                                               ^
3 years ago
Petr Mikheev 68ef96410c Make ESM::Position not packed (should fix #6566) 3 years ago
elsid 45db56b382
Rework fixed string
* Avoid inheritance.
* Define equality operators out of the class definition.
* Replace toString with toStringView where it doesn't make sense to create a string.
3 years ago
elsid 3877d227f4
Avoid unnecessary copies 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