1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00

483 Commits

Author SHA1 Message Date
elsid
f6fce5ee15
Cleanup includes 2023-07-08 11:28:56 +02:00
elsid
6e8dcc16c6
Use settings values for Game settings 2023-07-01 00:59:35 +02:00
psi29a
dd0d66513d Merge branch 'clickbait' into 'master'
Mostly dehardcode attributes

See merge request OpenMW/openmw!3164
2023-06-25 20:11:19 +00:00
Evil Eye
c5344b7069 Return the actual topic the info came from 2023-06-24 11:40:25 +02:00
Evil Eye
abcebd49d2 Allow for more than 8 attributes 2023-06-19 20:41:54 +02:00
Evil Eye
47c1569961 Use RefId key for NPC skills 2023-06-08 18:35:48 +02:00
Evil Eye
dd83da5eba Use std::array in FADTstruct 2023-06-03 13:11:49 +02:00
Mads Buvik Sandvei
410e8b100a Elsid comments 2023-05-23 19:30:29 +02:00
Evil Eye
11f875d9c4 Detect service refusal in constant time 2023-05-22 22:24:04 +02:00
Evil Eye
5491512905 Use string_view in more places and reduce the number of empty string literals 2023-05-21 16:39:32 +02:00
Evil Eye
3cf0977c0b Remove dialogue related instances of getRefIdString 2023-05-04 19:46:49 +02:00
Petr Mikheev
f1beaa7b8c Put ESMStore to Environment 2023-04-20 21:45:49 +02:00
elsid
452d1e7e49
Store original string id for Dialogue records 2023-03-26 19:07:32 +02:00
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.
2023-03-19 17:20:43 +01:00
Shi Han
a90e3b8c3b Move from std::atoi to std::from_char 2023-03-18 09:30:48 +00:00
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.
2023-02-18 01:07:15 +01:00
elsid
996153f78d
Convert RefId to class 2023-02-15 23:20:44 +01:00
elsid
f09789002a
Define hardcoded global variable names as constants 2023-02-07 00:47:34 +01:00
Petr Mikheev
5983f22290 Remember actor in the actor's InventoryStore instead passing the actor in every call 2023-01-21 23:43:00 +01:00
Petr Mikheev
e9420b2b68 Remove implicit conversion MWWorld::Ptr -> bool 2023-01-18 02:40:56 +01:00
elsid
b88f0d2dbd
Replace mwscript program serialization into a vector with simple struct
Mostly to avoid string literal lookup by index with iteration over all preciding
literals and calling strlen. This is very inefficient. In genral this makes code
much more straightforward but also makes it portable since now int and float of
different sizes are properly supported.
2023-01-14 00:07:37 +01:00
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
2022-12-27 19:16:22 +01:00
florent.teppe
1ef1de974d script blacklist => RefId
Applies changes from review

Fixed clang format

Clang format + review.
2022-12-27 19:16:21 +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
a7d0a8d9d1 Replaced some RefId* => RefId&
Rebase fix commit
2022-12-27 19:15:57 +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
7da38113be Changed more hardcoded RefId to be static to avoid multiple runtime creations
adresses multiple review comments
2022-12-27 19:15:56 +01:00
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
2022-12-27 19:15:55 +01:00
fteppe
c8bb733360 removed clear() function, the only way to change the Id from the outside is from the assignment operator
replaced ciEqual with == operator
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
Evil Eye
f61083d02c Replace switch statements 2022-11-04 12:20:37 +01:00
Evil Eye
29a46b0fc0 Reimplement --script-all-dialogue to be more useful to modders 2022-11-03 20:54:44 +01:00
Evil Eye
a24e9e4c0a Mark constant methods const 2022-10-17 09:43:20 +02:00
Evil Eye
81f138cea0 Prevent potentially returning garbage flags 2022-10-17 09:37:56 +02:00
Evil Eye
1c17260d87 Don't use potentially invalid cache entry 2022-10-17 09:35:43 +02:00
clang-format-bot
ddb0522bbf
Apply clang-format to code base 2022-09-22 21:35:26 +03:00
elsid
410a2881fe
Add comma to the last array element to prevent putting multiple elements on a single line 2022-09-14 00:36:02 +02:00
florent.teppe
0a5c863f27 fewer header includes 2022-09-08 21:08:59 +02:00
florent.teppe
0dd529ab1d With the records include removed from store.hpp, need to include the relevant files accross the codebase.Lots of touched files, but very little done 2022-09-06 13:26:13 +02:00
florent.teppe
1ced0c912e partially revert "Store: moved all the template specialization to its own heaper file, included where it's needed"
This reverts commit 80a25bcd3021f7ebfaf2f864e34532009b9b8aeb.
It didn't really make sense to do all those changes in the same MR

partially Revert "Store refactoring: more forgotten storeSpecialization.hpp"

This reverts commit 9943a5bc96b9025f06cbaac5bb7f1bf51ebc746f.

removed remaining references to storeSpecialization  CMakeLists.txt,  and landmanager.cpp
2022-09-05 17:35:06 +02:00
florent.teppe
3a62ef3a99 Store added storespecialization to cmakelist, and removed the captial first letter 2022-09-05 17:34:40 +02:00
florent.teppe
0d85e7db7d Store: moved all the template specialization to its own heaper file, included where it's needed
in the esm store a function is defined in the cpp file to not rely on the knowledge of store.hpp in the header file
2022-09-05 17:34:22 +02:00
AnyOldName3
4e8e2e1c60 Eliminate &thing[0] pattern 2022-09-03 16:41:35 +01:00
Evil Eye
0cded25033 Remove various string copies 2022-08-24 20:38:52 +02:00
elsid
226f12528b
Remove redundant .cpp file 2022-08-19 22:06:59 +02:00
psi29a
bf40f9b287 Merge branch 'name_view' into 'master'
Make Class::getName return string_view

See merge request OpenMW/openmw!2289
2022-08-17 20:14:27 +00:00
elsid
5498c169e3
Cleanup openmw render, physics, world, dialogue, gui, input includes 2022-08-17 18:45:52 +02:00
Evil Eye
4ff12d8945 Make Class::getName return string_view 2022-08-16 21:15:03 +02:00
Evil Eye
51938f9ef7 Use string_view in Interpreter::Context 2022-08-12 19:42:35 +02:00
Evil Eye
685906afdf Make getScript return string_view 2022-08-11 22:51:55 +02:00