1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 08:29:56 +00:00
Commit graph

86 commits

Author SHA1 Message Date
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
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
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
clang-format-bot
ddb0522bbf
Apply clang-format to code base 2022-09-22 21:35:26 +03: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
Evil Eye
bee94e2afc Treat commas in scripts as whitespace 2021-11-13 14:06:21 +01:00
Evil Eye
fef902617a Parse integer format arguments as variable names 2021-10-24 17:23:15 +02:00
Evil Eye
5037def3b3 Parse local variables sharing a name with a function as variables 2021-10-06 21:27:08 +02:00
Evil Eye
6d7cb38834 Remove duplicate GetSquareRoot implementation 2021-09-19 19:53:38 +02:00
Evil Eye
c1177d7ffe Allow unquoted string arguments to start with . and - 2021-06-19 11:21:37 +02:00
unknown
71e78c66cd Re-add missing includes removed in 5a824d0333 2020-10-25 14:33:23 +01:00
Bret Curtis
5a824d0333 components/compiler cleanup; also cleaned up related cascading warnings; fixed up final/override issues 2020-10-22 23:57:53 +02:00
Evil Eye
3875b837bc make MenuMode, Random, GetSecondsPassed regular functions 2020-05-17 22:34:54 +02:00
Evil Eye
f0e2ee45fa reuse ImplicitRef and ExplicitRef for enable, disable, getdisabled, startscript; move scriptrunning and stopscript 2020-05-13 21:17:08 +02:00
Andrei Kortunov
34873b6065 Fix dead code 2019-11-13 15:29:18 +04:00
Roman Siromakha
4e5aec5c30
Merge pull request #2539 from Capostrophic/scripting
Try to parse strings as number literals (bug #5097)
2019-10-24 22:12:50 +02:00
Capostrophic
bde4a38181 Cast Random result to float (bug #5175) 2019-10-03 23:20:25 +03:00
Capostrophic
138a7ac434 Expression parser: Try to parse strings as number literals (bug #5097) 2019-09-26 02:54:17 +03:00
Capostrophic
17dce28705 Improve compiler messages 2019-03-29 00:59:26 +03:00
Capostrophic
9bc360267b Ignore stray explicit references for names in expressions 2019-02-26 17:47:18 +03:00
Capostrophic
95aa05e41b Tweaks to script parser messages and pathgrid warnings 2018-09-16 16:47:33 +03:00
MiroslavR
395e97cf40 Remove evil "implicit GetJournalIndex" hack from expression parser 2017-04-03 01:44:26 +02:00
Marc Zinnschlag
ece40b1e96 improved the remaining handling of extra arguments 2016-01-07 16:07:49 +01:00
Marc Zinnschlag
46e32de350 improved handling of extra arguments in DiscardParser 2016-01-07 16:01:01 +01:00
Marc Zinnschlag
f9607a47b3 improved handling of extra arguments in StringParser 2016-01-07 15:54:22 +01:00
Marc Zinnschlag
210c77968a Don't report warning about extra arguments, if there are no extra arguments (Fixes #3133) 2016-01-07 15:38:23 +01:00
scrawl
e695619aa5 ExprParser: Warn about ignored arguments 2016-01-03 00:02:58 +01:00
Marc Zinnschlag
ae54f34f25 removed a redundant else and made unary + work also in the console 2015-09-26 11:30:35 +02:00
Emmanuel Anne
dace7ab706 scripts: recognize '+' also as a unary operator
it fixes the armor sorter in "Blades safe house.esp"
2015-09-25 14:22:57 +02:00
scrawl
67bd6cd708 Remove empty line at the beginning of files
git ls-files -z | xargs -0 sed -i '1{/^$/d}'
2015-08-18 23:06:12 +02:00
Marc Zinnschlag
cbf9f83b85 allow use of IDs as function arguments, even if the ID matches a keyword (Fixes #2830) 2015-08-05 17:20:01 +02:00
dteviot
1d7f3474fa Fixed more MSVC 2013 warnings. 2015-03-15 08:49:03 +13:00
Marc Zinnschlag
057d0913d6 Merge branch 'scriptfixes' 2014-12-18 10:22:07 +01:00
Marc Zinnschlag
b951251572 handle junk in argument lists (Fixes #2206) 2014-12-17 15:03:05 +01:00
Marc Zinnschlag
e4f75267d0 in case of arguments not separated with comma the fist token of the next argument was put back incorrectly 2014-12-13 15:40:24 +01:00
Marc Zinnschlag
19f4c46fe4 alllow (and ignore) explicit references for StopScript and ScriptRunning 2014-07-23 12:33:35 +02:00
Marc Zinnschlag
aa8c0bccb4 added new argument type: z (optional, any) 2014-07-23 09:44:29 +02:00
Marc Zinnschlag
11a2c767cc some argument parsing cleanup 2014-07-21 12:50:29 +02:00
Marc Zinnschlag
35b27ea8cb ignore stray string argument after GetDisabled 2014-07-17 11:29:04 +02:00
scrawl
750d8b5589 Allow garbage integer argument for addSpell (Fixes #1539) 2014-06-23 22:02:22 +02:00
cc9cii
bbe77d656a Minor fixes from static analysis. 2014-05-28 21:15:50 +10:00
Marc Zinnschlag
12fc0aaecb removed an unused parser settings (implicitly fixing a case were this setting was not applied correctly) 2014-05-27 21:08:29 +02:00
Marc Zinnschlag
0d84adb2c6 allow x->(y) instead of (x->y) 2014-02-15 12:50:40 +01:00
Marc Zinnschlag
d213c6c36a fixed a constness-issue 2014-02-14 12:23:00 +01:00
Marc Zinnschlag
2086ebe410 fix for inappropriate disable (2nd attempt) 2014-02-14 08:48:26 +01:00
Marc Zinnschlag
b01c6dad37 Revert "allow disable as an alias for getDisabled (in most cases)"
This reverts commit f7ff4fbd51.
2014-02-14 08:29:18 +01:00
Marc Zinnschlag
f7ff4fbd51 allow disable as an alias for getDisabled (in most cases) 2014-02-13 15:31:07 +01:00
Marc Zinnschlag
309573a3ac allow the use of the keyword end as a variable name in an expression 2014-02-13 14:15:48 +01:00
Marc Zinnschlag
a85d3c7dcb ignore unused explicit references for functions 2014-02-12 13:53:59 +01:00
Marc Zinnschlag
93d4743012 interpret instruction keywords as names within expressions 2014-02-12 09:56:25 +01:00