Commit Graph

131 Commits (0d9b1a579522fa96c3257bc8df364387c7b1a743)

Author SHA1 Message Date
elsid 89bb04e8fd
Exit with fatal error on duplicated instruction code
Instead of causing SIGABRT which is more confusing.
6 months ago
Evil Eye 5491512905 Use string_view in more places and reduce the number of empty string literals 2 years 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
elsid b8525e8e3d
Fix code format 2 years ago
fall-leaf cc7e29c9a2 opensuse build fix 2 years ago
Evil Eye 8d2b5ed8ee Combine initializer_lists 2 years ago
Evil Eye d3bc79e9b2 Reduce code duplication 2 years ago
Evil Eye 32ac7406ab Fix global variable replacement in dialogue 2 years ago
elsid d4ab1101eb
Change Interpreter type aliases to be fixed size types
Remove no longer relevant comment for float type.
2 years ago
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.
2 years ago
elsid 60eede6a1d
Fix variable naming styleguide 2 years ago
elsid 0ab3090385
Make Runtime::getPC and setPC inline 2 years ago
elsid 46b4427d2e
Remove user defined constructor for Runtime 2 years ago
elsid 9c8df09475
Remove user defined constructors for Interpreter 2 years ago
florent.teppe 42e45723b7 Fixes issue in MW script compilation that would silently produce the wrong bytecode
Fixes issue when fetching MyGui values that were stored as RefId but fetched as String

Removed some uncessary copies, fixed issues with lowercase and uneeded changes
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
florent.teppe 874ff88288 In the interpretter, the id is no longer passed by vallue, but as a const reference instead.
In getMembersLocal(, a reference to a reference wrapper is used, because the id can change, bu all we need to do is change a pointer.No need to change the value
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
clang-format-bot ddb0522bbf
Apply clang-format to code base 2 years ago
Evil Eye 0df45a90b3 Use string_view in the remaining Class methods and push string_views closer to the MyGUI boundary 2 years ago
Evil Eye 51938f9ef7 Use string_view in Interpreter::Context 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 ba69146ced
Use std::string_view to avoid redundant std::string construction 2 years ago
Evil Eye ac78b537d2 Address feedback 3 years ago
Evil Eye 15fda78ddf Include string 3 years ago
Evil Eye e79f803402 Change includes 3 years ago
Evil Eye c6ca0e78c9 Make getStringLiteral return a string_view 3 years ago
ζeh Matt 1832ed6a48
Use pop_back to shrink the stack 3 years ago
Matt 34723c8ea8 Cleanup interpreter code a bit 3 years ago
Evil Eye 751e8cf76b Do a bounds check before calling functions defined in cctype 3 years ago
Evil Eye 6d7cb38834 Remove duplicate GetSquareRoot implementation 3 years ago
jvoisin 9db7d0278a Sprinkle some const ref 4 years ago
jvoisin aec3c74fa5 Sprinkle some [[noreturn]] where possible 4 years ago
Evil Eye 67c8d73fe0 Allow scripts to fail per target 4 years ago
Andrei Kortunov f9d42ed396 Fix MSVC's C4267 warnings 4 years ago
Andrei Kortunov 6d351b2bdd Fix MSVC 4706 warnings 4 years ago
Andrei Kortunov 8084a336b5 Replace zeroes and nulls by nullptrs 4 years ago
Andrei Kortunov 8ca3c3b123 Mark overrided methods by override keyword 4 years ago
Capostrophic e0ecbc08df Give new opcodes to old functions made custom 5 years ago
Evil Eye 3875b837bc make MenuMode, Random, GetSecondsPassed regular functions 5 years ago
Evil Eye f0e2ee45fa reuse ImplicitRef and ExplicitRef for enable, disable, getdisabled, startscript; move scriptrunning and stopscript 5 years ago
unknown 3b4782959e Allow targeting non-unique actors with StartScript (bug #2311) 5 years ago
fredzio 916a9641fc Delete support for 2-arguments opcodes - it was never used 5 years ago
Alexei Dobrohotov f3e8fbfded Merge branch 'range-safety' into 'master'
Make script literal lookup functions safer

See merge request OpenMW/openmw!113
5 years ago
Capostrophic bde4a38181 Cast Random result to float (bug #5175) 5 years ago
Phillip Andrews dee72e9430 Make script literal lookup functions safer
Assert isn't really the right way to range check these, since in theory we could have a malformed compiled script.  This should make it safer with zero performance overhead.
6 years ago
Andrei Kortunov 3032b177a1 Remove redundant includes 6 years ago
Andrei Kortunov 0937f02598 Get rid of unnecessary string streams 6 years ago
Andrei Kortunov 2961f0d810 Allow to use the %Name for creatures (bug #4644) 6 years ago
Capostrophic 363516049d Actually fix General number formatting 6 years ago