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

645 commits

Author SHA1 Message Date
elsid
aa77e727b8
Fix build with clang and libc++
libc++ does not have such function:

apps/openmw_test_suite/esm3/testesmwriter.cpp:73:30: error: no member named 'view' in 'std::ostringstream'
            EXPECT_EQ(stream.view().size(), size);
                      ~~~~~~ ^
2023-04-08 13:41:28 +02:00
elsid
794050df63
Fix and add tests for ESM3ExteriorCellRefId serialization and text representation 2023-04-08 01:06:11 +02:00
elsid
5b14ff4470
Add tests to verify RefId size written to ESM file 2023-04-08 01:06:11 +02:00
elsid
fd9f652f43
Add CurrentContentFormatVersion to Esm3SaveLoadRecordTest parameters 2023-04-07 20:18:02 +02:00
elsid
e3944f741e
Test save/load for all ESM::CellRef fields 2023-04-07 20:18:00 +02:00
florent.teppe
0d17e20490 Implements serialize/deserialize
fixes test compilation.
2023-04-03 18:41:25 +02:00
florent.teppe
21bd28542a Applies review advice
2d coord hash moved to hash.hpp file
format version adds suffix to be more coherent
don't use ESM::RefId::sEmpty
RefId equality with string_view, conversion to refId unecessary
action teleport remove test that mCellId is empty
removes some const references, when copy is enough
invalid refid => empty refid
removes useless change
2023-04-03 14:17:35 +02:00
florent.teppe
d782d37ee2 Make sure Vec2iRefId is trivially copyable on GCC 11.3
std::pair<int, int> isn't trivially copyable on some compilers
so a specific struct is defined, it's an int pair, but it should be recognised by GCC 11.3 as trivially copyable

Vec2iRefId => ESM3ExteriorCellRefId

more explcit name and use mX,mY instead of pair
renamed files and enum
2023-04-03 14:17:31 +02:00
florent.teppe
c2182c2fcc Get Rid of ESM::CellId almost everywhere
it was a competing concept from using RefIds for cell.
There is almost no point to it now, except to load older data.
2023-04-03 14:16:05 +02:00
florent.teppe
fb6701ac1a ESM::CellId is no longer stored on saves. 2023-04-03 14:16:05 +02:00
florent.teppe
6c6dbccd0a fix crash on reset
fix tests
2023-04-03 14:16:04 +02:00
florent.teppe
9f597ecfea No more Cellid used by ESM4 cells
and that also means it is no longer used by MWWorld::Cell
fixes tests
2023-04-03 14:16:04 +02:00
florent.teppe
36502eaf75 ESM3 Cells have an Id.
Store<ESM::Cell> is updated to use it.
2023-04-03 14:16:03 +02:00
psi29a
ee970db9e0 Merge branch 'player_cell_id_test' into 'master'
Test more ESM::Player records

See merge request OpenMW/openmw!2888
2023-04-02 22:41:36 +00:00
psi29a
0a791528bc Merge branch 'fix_index_ref_id_hash' into 'master'
Shift record type value for IndexRefId hash

See merge request OpenMW/openmw!2885
2023-04-02 21:52:29 +00:00
elsid
9162eaa019
Test more ESM::Player records 2023-04-02 19:58:27 +02:00
elsid
171a25645a
Make sure there are tests for all RefId types 2023-04-02 15:46:21 +02:00
elsid
258aec223a
Shift record type value for IndexRefId hash 2023-04-02 15:00:03 +02:00
elsid
f8cc929f9a
Use approximate equality for btBvhTriangleMeshShape triangles 2023-03-30 21:41:40 +02:00
elsid
452d1e7e49
Store original string id for Dialogue records 2023-03-26 19:07:32 +02:00
elsid
d6c8c54dc5
Generate test cases for all ESM3 format versions since MaxStringRefIdFormatVersion 2023-03-26 19:07:25 +02:00
elsid
90ed24f4c9
Split type traits for ESM4, ESM3 and unite common 2023-03-26 19:07:23 +02:00
elsid
b7fdca0fe6
Use serialized ESM::RefId for Lua records 2023-03-25 18:19:46 +01:00
elsid
cd4027ffd6
Do not use ESM::RefId::getRefIdString for spell id 2023-03-24 01:57:35 +01:00
Andrei Kortunov
302c331559 Add field initialization 2023-03-23 14:31:45 +04:00
psi29a
db1b260323 Merge branch 'gmst_l10n' into 'master'
Support links to GMSTs in l10n files; extract Morrowind-specific l10n files to a separate directory

See merge request OpenMW/openmw!2822
2023-03-22 20:47:53 +00:00
elsid
d1e8e56619
Make QuickKey type a fixed size enum class 2023-03-21 20:53:04 +01:00
elsid
2135eba103
Fix loading ESM3 QuickKeys 2023-03-21 20:44:42 +01:00
elsid
e6cf516e12
Support index RefId as pair of record type and std::uint32_t 2023-03-19 17:20:48 +01:00
elsid
86293af084
Support generated RefId as std::uint64_t 2023-03-19 17:20:48 +01:00
elsid
0992624c8b
Support reading and writing typed ESM::RefId to ESM 2023-03-19 17:20:48 +01: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
elsid
e032214fcb
Use common info ordering implementation for engine and editor 2023-03-13 21:57:41 +01:00
psi29a
6d8f3c7bce Merge branch 'cs_unit_tests' into 'master'
Introduce unit tests for editor

See merge request OpenMW/openmw!2821
2023-03-13 09:37:32 +00:00
elsid
55ebd97949
Remove misleading part of the function name 2023-03-12 15:14:38 +01:00
Petr Mikheev
58fdd687a8 Support links to GMST in l10n files 2023-03-12 13:12:13 +01:00
elsid
6f6e452dfa
Add executable to run CS tests 2023-03-12 12:06:33 +01:00
psi29a
efebb8efd8 Merge branch 'cmake_fixes' into 'master'
Formatting and coverage related CMake files fixes

See merge request OpenMW/openmw!2811
2023-03-12 11:03:06 +00:00
elsid
9c780efe50
Add ESMStore tests for loading dialogue and info records 2023-03-12 01:52:20 +01:00
elsid
1857d8a68c
Use target_compile_options to add --coverage 2023-03-10 15:34:08 +01:00
Alexei Dobrohotov
562461a659 Unify collision shape transformations 2023-03-10 00:12:12 +03:00
Alexei Dobrohotov
2277bdc1ae Improve btTriangleMesh abuse (bug #6027, part 2) 2023-03-08 06:13:32 +03:00
Evil Eye
724c6ec425 Match unit test to Morrowind.exe behaviour 2023-03-05 20:27:07 +01:00
Petr Mikheev
e70ab80b90 Ignore duplicated preferred l10n locales 2023-03-04 10:20:03 +01:00
elsid
cd6a5b5a0e
Support asymmetric comparison between ESM::RefId and std::string_view 2023-03-03 15:44:18 +01:00
elsid
6f329f3d40
Add tests for ESM::RefId 2023-03-03 15:44:18 +01:00
elsid
eb17f0ba06
Use ESM::RefId as key in TestInterpreterContext::mMembers 2023-03-03 15:41:56 +01:00
elsid
dfcea389be
Add helper functions for string comparison to RefId 2023-03-03 00:39:55 +01:00
psi29a
340a2aa826 Merge branch 'ref_id_cmp_string_view' into 'master'
Support RefId comparison with std::string_view

See merge request OpenMW/openmw!2784
2023-03-02 12:49:28 +00:00
elsid
2fcb94064d
Support RefId comparison with std::string_view 2023-02-28 23:04:48 +01:00
Alexei Kotov
7fd9b27b54 Don't combine static node collision geometry (bug #6027) 2023-03-01 00:41:04 +03:00
Petr Mikheev
b0a6e4e510 [Lua] Add memory usage test 2023-02-26 19:59:53 +01:00
Cody Glassman
ac4787aeec shade refactor 2023-02-25 11:03:39 -08:00
psi29a
0f331a4fc5 Merge branch 'lua_callback' into 'master'
Fix potential memory leak in LuaUtil::Callback

See merge request OpenMW/openmw!2733
2023-02-18 21:05:07 +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
28f7a89530
Reuse dtNavMeshQuery
To avoid redundant allocations.
2023-02-17 15:05:25 +01:00
Petr Mikheev
eceeb15ee5 Fix bug in lua_ui/content.lua: getmetatable(ui.content{}) shouldn't return a global mutable table 2023-02-14 21:08:19 +01:00
Petr Mikheev
65885d994f Don't expose LuaUtil::Callback to lua 2023-02-14 21:08:19 +01:00
Petr Mikheev
71ba7b88e2 Move asyncpackage from apps/openmw/mwlua to components/lua 2023-02-14 20:03:32 +01:00
elsid
80e6d6cbe3
Support variable size strings in ESM3 2023-02-13 10:18:32 +01:00
elsid
beb017e699
Do not truncate too long strings on writing ESM 2023-02-13 10:18:32 +01:00
elsid
12d36fb1d7
Add missing include 2023-02-13 10:02:30 +01:00
elsid
1e9e7b7607
Add tests to save and load some ESM3 records 2023-02-11 16:20:10 +01:00
elsid
2e64155c0f
Use signed type for left record and files size in ESM3 reader context
Otherwise reading some of the records like ESM::CellRef without a subrecord
after could lead to underflow of ESM_Context::leftRec which makes
ESM::ESMReader::hasMoreSubs to return true and load hangs for a while trying to
read the same subrecord many times.

Fix ESM::Variant tests since it's now required to have a record for any ESM
data. Add 16 (size of record header) to all expected data sizes.
2023-02-11 16:09:14 +01:00
elsid
080700f8fe
Name all custom ESM format versions and add tests 2023-02-10 19:54:15 +01:00
florent.teppe
dc961e3189 Adds the light into the scene.
Common struct for ESM3 and ESM4 light
2023-02-07 10:07:59 +01:00
psi29a
4032c447e9 Merge branch 'load-ESM4-Cell' into 'master'
Can load and coc into an interrior oblivion cell

See merge request OpenMW/openmw!2647
2023-02-06 08:56:23 +00:00
psi29a
68b3b90255 Merge branch 'ui_content_leak' into 'master'
Move implementation of UI Content to Lua (#7155)

See merge request OpenMW/openmw!2661
2023-02-01 22:51:47 +00:00
uramer
e96681151c Get rid of the LuaUI::Content namespace 2023-02-01 17:18:50 +01:00
uramer
d24c506b0e Move metatable protection asserts to tests 2023-02-01 16:34:32 +01:00
uramer
bbbef96087 Switch to loadInternalLib 2023-01-31 19:50:33 +01:00
uramer
c17eedd348 Documentation and API fixes (part of !2529) 2023-01-30 10:13:26 +00:00
uramer
259f104311 Clean up 2023-01-29 19:40:13 +01:00
uramer
3618b3f409 Fix Content::View::remove 2023-01-29 18:52:18 +01:00
uramer
fc1430af95 Move implementation of UI Content to Lua 2023-01-29 17:07:38 +01:00
florent.teppe
562e129bd0 encapsulations of esm3 cell and esm4 cells. 2023-01-26 22:37:31 +01:00
florent.teppe
a4137e941c std::string_view can be used in map and unordered map
This avoids some unecessary dynamic allocations.
Also applies some review advice.
2023-01-21 19:19:26 +01:00
florent.teppe
150e2ba885 Revert "Use ESM::RefId for worldspace in detournavigator"
This reverts commit b4ab153418.

# Conflicts:
#	apps/navmeshtool/worldspacedata.cpp
2023-01-21 18:39:57 +01:00
elsid
cf1d8544e3
Check agent bounds on adding agent to navigator
Do not add agent bounds which are not supported by recastnavigation with given
settings and log such events.

To avoid reaching navmesh tile generation to find out it can't be generated for
such agent bounds.
2023-01-18 12:00:48 +01:00
elsid
1cbe295030
Extend navigator tests for update with big object
Check for the number of generated recast mesh tiles and navmesh tiles.
2023-01-15 17:25:13 +01:00
psi29a
dc3ec1a0a0 Merge branch 'mwscript' into 'master'
Multiple mwscript optimizations and some refactoring

See merge request OpenMW/openmw!2600
2023-01-15 15:59:30 +00:00
elsid
44429f0393
Limit NavMeshManager update range by player tile and max tiles
Object AABB may be much larger than area currently covered by navmesh. In this
case all tiles beyond covered range should be ignored. Attempt to iterate over
them will not result in any new tile updates but can take quite a while. At
maximum this can be pow(INT_MAX - INT_MIN, 2) iterations.

Use arbitrary time limit to check for update call to finish in the test.
2023-01-15 04:46:29 +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
psi29a
83718878b2 Merge branch 'Load_ESM4' into 'master'
Loading ESM4 data and storing them in the ESMStore

See merge request OpenMW/openmw!2557
2023-01-07 22:17:17 +00:00
elsid
2bbed8cc06
Fix gcc warning: array subscript 5 is outside array bounds of ‘const char [5]’
In function ‘bool ESM::operator==(const FixedString<capacity>&, const T* const&) [with long unsigned int capacity = 5; T = char; <template-parameter-1-3> = void]’,
    inlined from ‘testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = ESM::FixedString<5>; T2 = const char*]’ at /home/elsid/dev/googletest/build/gcc/release/install/include/gtest/gtest.h:1358:11,
    inlined from ‘static testing::AssertionResult testing::internal::EqHelper::Compare(const char*, const char*, const T1&, const T2&) [with T1 = ESM::FixedString<5>; T2 = const char*; typename std::enable_if<((! std::is_integral<_Tp>::value) || (! std::is_pointer<_Dp>::value))>::type* <anonymous> = 0]’ at /home/elsid/dev/googletest/build/gcc/release/install/include/gtest/gtest.h:1377:64,
    inlined from ‘virtual void {anonymous}::EsmFixedString_equality_operator_for_not_convertible_to_uint32_with_const_char_pointer_Test::TestBody()’ at apps/openmw_test_suite/esm/test_fixed_string.cpp:165:9:
components/esm/esmcommon.hpp:134:19: warning: array subscript 5 is outside array bounds of ‘const char [5]’ [-Warray-bounds]
  134 |         return rhs[capacity] == '\0';
      |                ~~~^
apps/openmw_test_suite/esm/test_fixed_string.cpp: In member function ‘virtual void {anonymous}::EsmFixedString_equality_operator_for_not_convertible_to_uint32_with_const_char_pointer_Test::TestBody()’:
apps/openmw_test_suite/esm/test_fixed_string.cpp:164:20: note: at offset 5 into object ‘other’ of size 5
  164 |         const char other[5] = { 'a', 'b', 'c', 'd', '\0' };
      |                    ^~~~~
2023-01-06 22:09:07 +01:00
elsid
c80ba92ab7
Add more tests for ESM::FixedString 2023-01-06 21:00:29 +01:00
elsid
7c60905266
Put ESM::FixedString tests into unnamed namespace 2023-01-06 21:00:29 +01:00
florent.teppe
400d51c099 Fix compile MSVC 2023-01-04 14:19:12 +01:00
florent.teppe
b88eee08c2 Store display's the ESM4's RecnameInt when not found 2023-01-04 14:07:47 +01:00
florent.teppe
631fa26872 Applies review advice. 2023-01-04 12:22:16 +01:00
florent.teppe
e80dbd7c95 Moved the test to test_store.cpp where it belongs 2023-01-04 00:17:45 +01:00
elsid
b4ab153418
Use ESM::RefId for worldspace in detournavigator 2022-12-29 23:49:49 +01:00
psi29a
80e2cd79ec Merge branch 'boat_closer_to_todd' into 'master'
Ignore special characters preceding script commands

Closes #6807

See merge request OpenMW/openmw!2555
2022-12-28 11:21:24 +00:00
psi29a
7827d3ae8f Merge branch 'fix_hour_modulo' into 'master'
Fix hour modulo expression (#7121)

Closes #7121

See merge request OpenMW/openmw!2556
2022-12-28 10:33:20 +00:00
elsid
25ead80d8b
Fix hour modulo expression
Round result of std::fmod(hours, 24) to the nearest float below 24 on double to
float conversion when it is not. Add special type and conversion function along
with tests to be used in all places where such conversion happens.

To avoid producing hours equal to 24 due to double to float precision loss.
2022-12-28 00:04:04 +01:00
florent.teppe
30a020883e Avoids unecessary copies
Fixed issue with lowerCase

Oups fixed compialtion on openMW_test_suite
2022-12-27 19:15:57 +01:00
florent.teppe
b61d5d8123 Some RefId == ESM::RefId::StringRefId('constString') still existed 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
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
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
Evil Eye
b19ad079c2 Ignore special characters preceding script commands 2022-12-27 14:59:56 +01:00
elsid
0b399a9d1a
Fix detournavigator tests
d40c09c18c changed the logic in parallel with
15e8f0b53c making this check invalid.
2022-12-23 19:26:15 +01:00
elsid
15e8f0b53c
Check input and report errors via RecastContext
Recast functions have preconditions for arguments they don't validate. This may
produce garbage data which may lead to crash. Check arguments and log when they
are invalid.

Do not throw exceptions when these function calls fail, capture Recast reported
errors via RecastContext inherited from rcContext and log them.
2022-12-19 19:46:45 +01:00
Petr Mikheev
55db95d4cf Update Lua profiler; add ability to run OpenMW with old LuaJit that doesn't allow custom allocator (Lua profiler will be disabled in this case) 2022-12-03 16:58:03 +01:00
Petr Mikheev
6fa65e4729 Track memory and CPU usage per script in LuaUtil::LuaState 2022-11-30 00:06:14 +01:00
uramer
b13a4f6b01 Lua coroutine crash tests 2022-10-18 21:11:31 +02:00
psi29a
e16c451d08 Merge branch 'l10n' into 'master'
Separate l10n manager from lua

See merge request OpenMW/openmw!2451
2022-10-10 07:34:18 +00:00
elsid
843753da14
Remove unused includes 2022-10-09 16:44:18 +02:00
Petr Mikheev
3697c9266b Separate l10n manager from lua 2022-10-07 17:19:04 +02:00
elsid
063fff7fa4
Fix and prevent -Wextra-semi warning 2022-10-06 00:26:43 +02:00
elsid
d2e1f18924
Add tests for NifOsg::Loader 2022-09-24 19:10:39 +02:00
elsid
4b760e8846
Do not add redundant nullptr parent
There are no failed tests after this, so this is not really needed.
2022-09-24 19:10:31 +02:00
elsid
83bb2195b0
Move init functions for Nif nodes to a separate file
This will be used in other tests.
2022-09-24 19:10:25 +02:00
elsid
f2fb3d6de8
Separate NIFFileReader from NIFFile
NIFFile might not always be created from a file or stream containing NIF data.
Basically there are 2 different responsibilities for this class:
1. Read NIF file
2. Provide input for nifosg and bulletnifloader.

Remove no longer needed NIFFileMock since the state of NIFFfile can be
initialized independently from reading NIF file.
2022-09-24 19:10:14 +02:00
clang-format-bot
ddb0522bbf
Apply clang-format to code base 2022-09-22 21:35:26 +03:00
Project579
b82176410b Use std::filesystem for unit tests temporary files path. 2022-09-19 21:42:18 +02:00
elsid
5b1d6917ef
Add comments to prevent line splitting on formatting 2022-09-12 21:00:51 +02:00
elsid
6ae15f08e0
Avoid chained operator() calls to prevent formatting issues 2022-09-12 16:48:15 +02:00
Project579
5456ef1d50 Add new functions and overloads to support std::u8string and std::filesystem::path. 2022-09-11 14:41:20 +02:00
Project579
928b131564 Implement std::filesystem::path conversion tests. 2022-09-11 14:41:20 +02: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
864112b5db Fixed Windows build when using MSVC 14.26 and MacOS build. 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
Project579
cf0af87c80 Revert changes from "4c8e1ccf - Fixed windows build and updated tests to reflect changes of escape character from "&" to "\"" in "apps/openmw_test_suite/openmw/options.cpp" 2022-09-11 02:19:07 +02:00
Project579
cd229a965b Fixed windows build and updated tests to reflect changes of escape character from "&" to "\" 2022-09-11 02:19:07 +02:00
Project579
4bb07282c9 Replace all remaining occurrences of boost::filesystem with std::filesystem. 2022-09-11 02:19:00 +02:00
elsid
22ee592dd3
Lock TileCachedRecastMeshManager once per changing a cell
To save time on locking mutex and prevent AsyncNavMeshUpdater to use RecastMesh
for a tile in the middle of objects loading.
2022-09-08 11:06:35 +02:00
elsid
d15e1dca84
Use R-tree for objects to be used for navmesh generation
Instead of storing a set of objects per tile.
2022-09-07 22:51:56 +02:00
psi29a
fcd9b78cac Merge branch 'REFACTOR_STORE' into 'master'
Refactoring the ESM store to better support many new ESM4 types

See merge request OpenMW/openmw!2161
2022-09-07 20:22:29 +00:00
elsid
180d609e0d
Check "wait until min distance to player" only for requiredTilesPresent wait condition
allJobsDone should wait even if "wait until min distance to player" is 0.
2022-09-06 21:51:48 +02:00
elsid
204ab6fea3
Use version instead of generation and revision for recast mesh 2022-09-06 21:51:48 +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
elsid
e2d566b89d
Store changed tiles in TileCachedRecastMeshManager 2022-09-05 11:49:39 +02:00
Evil Eye
02bbb0be45 Improve format workaround and add unit tests 2022-08-26 19:43:57 +00:00
elsid
948e2f5db9
Do not use collision shapes with visual only collision to generate navmesh
These collision shapes are not used for actors movement physics simulation.
2022-08-25 00:56:03 +02:00
Evil Eye
0df45a90b3 Use string_view in the remaining Class methods and push string_views closer to the MyGUI boundary 2022-08-23 22:14:27 +02:00
elsid
5dc612aa54
Replace ciCompareLen with ciStartsWith where possible
`ciCompareLen(a, b, b.size()) == 0` expression is an equivalent of checking for
equality of `a` prefix with size `b.size()` with `b`.

`ciCompareLen(a, b, a.size()) == 0` is also the same thing but `a` is a prefix
`b` should start with.
2022-08-22 09:32:22 +02:00
elsid
e1bed86d7e
Do single navigator update per frame
Primarily for crossing cell border case. Each Navigator::update call has a cost.
Doing it multiple times per frame increased frame duration on cell loading.

Call Navigator::wait only when cell has changed but do not use
Scene::hasCellChanged because it doesn't always indicates it.
2022-08-20 19:15:55 +02:00
Evil Eye
51938f9ef7 Use string_view in Interpreter::Context 2022-08-12 19:42:35 +02:00
psi29a
bb9884c024 Merge branch 'split_stringops' into 'master'
Split components/misc/stringops.hpp into multiple headers

See merge request OpenMW/openmw!2233
2022-08-09 18:06:40 +00:00
cody glassman
ac4b29be08 cleanup default shaders and remove confusing main shader 2022-08-07 06:42:48 -07:00
psi29a
00f8c9760a Merge branch 'fixed_string_tests' into 'master'
Replace deprecated std::is_pod

See merge request OpenMW/openmw!2239
2022-08-04 09:55:51 +00:00
elsid
8e4f6fc4e4
Use FetchContent to get googletest 2022-08-04 01:12:11 +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
da0a1ac9ba
Do compile time checks in compile time instead of tests 2022-08-03 21:47:00 +02:00
elsid
c42c0dcbc9
Replace deprecated std::is_pod
apps/openmw_test_suite/esm/test_fixed_string.cpp:99:23: warning: ‘template<class _Tp> struct std::is_pod’ is deprecated: use is_standard_layout && is_trivial instead [-Wdeprecated-declarations]
   99 |      ASSERT_TRUE(std::is_pod<ESM::NAME>::value);
      |                       ^~~~~~
2022-08-03 21:47:00 +02:00
Andrei Kortunov
888f4d2ac1 Add a post processing API to work with fog 2022-07-30 21:44:18 +04:00
Andrei Kortunov
c36c28e8f9 Move NIF implementation to cpp files 2022-07-21 15:54:52 +04:00
elsid
9398e97600
Avoid manual memory management for VFS archives 2022-07-16 15:30:14 +02:00
Petr Mikheev
8b8c304953 Treat empty RootCollisionNode in NIF as NCC flag and generate CameraOnly collision shape 2022-07-10 00:46:11 +02:00
elsid
bef15edf0b
Remove redundant ostream, istream, iostream and sstream includes
* Replace by std::to_string and operator+ where possible.
* Move the code requiring to include <sstream> from .hpp to .cpp files.
2022-07-05 01:41:28 +02:00
elsid
e074ebde96
Fix C4389 msvc warning
'==': signed/unsigned mismatch
2022-07-01 18:47:47 +02:00
elsid
2eae3227ba
Fix C4305 msvc warning
'argument': truncation from 'double' to 'float'
2022-07-01 18:47:46 +02:00
elsid
8544aa481c
Fix C4459 msvc warning
declaration of 'navMeshVersion' hides global declaration
2022-07-01 18:47:40 +02:00
elsid
7e6c13630a Use target_precompile_headers for the most expensive headers 2022-07-01 14:05:17 +00:00
elsid
10fbf170a2
Reduce number of includes for boost/program_options 2022-06-25 18:32:10 +02:00
Alexei Kotov
e673f9fa76 Clean up NIF flags 2022-06-22 01:58:16 +03:00
elsid
1a12c453d6
Support different agent collision shape type for pathfinding
Actors may have different collision shapes. Currently there are axis-aligned
bounding boxes and rotating bounding boxes. With AABB it's required to use
bounding cylinder for navmesh agent to avoid providing paths where actor can't
pass. But for rotating bounding boxes cylinder with diameter equal to the front
face width should be used to not reduce of available paths. For example rats
have rotating bounding box as collision shape because of the difference between
front and side faces width.

* Add agent bounds to navmesh tile db cache key. This is required to distinguish
  tiles for agents with different bounds.
* Increase navmesh version because navmesh tile db cache key and data has changed.
* Move navmesh version to the code to avoid misconfiguration by users.
* Fix all places where wrong half extents were used for pathfinding.
2022-06-21 12:57:32 +02:00
Petr Mikheev
3bf18c601c Better fog 2022-06-21 02:21:20 +02:00
psi29a
9c1970dce4 Merge branch 'lua_esm' into 'master'
Advanced Lua scripts configuration in omwaddon

See merge request OpenMW/openmw!1947
2022-06-11 18:48:23 +00:00
psi29a
c7449dc272 Merge branch 'bullet_includes' into 'master'
Clean up bullet includes

See merge request OpenMW/openmw!1974
2022-06-05 10:17:57 +00:00
Petr Mikheev
a70d5831c5 Lua scripts configuration in omwaddon 2022-06-05 01:36:39 +02:00
jvoisin
72a6d1f69f Clean up bullet includes 2022-06-04 20:15:10 +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
Petr Mikheev
709d186b8d Put tests output files to a separate dir 2022-05-30 01:34:23 +02:00
jvoisin
cb226e00f9 Remove some more of boost:: 2022-05-25 21:16:26 +02:00
psi29a
499e688289 Merge branch 'fix_navigator_tests' into 'master'
Increase precision error for navigator tests (#6770)

Closes #6770

See merge request OpenMW/openmw!1909
2022-05-24 17:19:43 +00:00
psi29a
a737b05d84 Merge branch 'faster_toLower' into 'master'
Improve the speed of toLower

See merge request OpenMW/openmw!1889
2022-05-24 07:53:01 +00:00
jvoisin
998f1c960e Improve the speed of toLower
This significantly improves the speed of my fuzzer,
by something like 15%.
2022-05-23 21:24:17 +02:00
elsid
87073e26f2
Increase precision error for navigator tests 2022-05-23 17:18:00 +02:00
cody glassman
6093cb5f2c postprocessing lua api extensions 2022-05-22 18:53:38 -07:00
psi29a
f17d7fc00b Merge branch 'string_view' into 'master'
Make getStringLiteral return a string_view

See merge request OpenMW/openmw!1896
2022-05-22 20:50:04 +00:00
Evil Eye
ac78b537d2 Address feedback 2022-05-22 09:29:03 +02:00
elsid
5269ba6f3c Fix warning: -Wunused-lambda-capture 2022-05-21 18:17:36 +00:00
Evil Eye
c6ca0e78c9 Make getStringLiteral return a string_view 2022-05-21 01:21:55 +02:00
psi29a
d3f331793e Merge branch 'sol' into 'master'
Update sol. Replace combined sol.hpp with loose files.

See merge request OpenMW/openmw!1851
2022-05-18 07:57:32 +00:00
ζeh Matt
18f16eac4c
Refactor DetourNavigator to pass prng along, use world prng for AiWander 2022-05-17 20:37:15 +03:00
psi29a
f092d8da9a Merge branch 'post_malone' into 'master'
Post Processing

See merge request OpenMW/openmw!1124
2022-05-16 14:51:13 +00:00
Petr Mikheev
d16fa553c8 Fix LuaUtil::Callback 2022-05-15 21:34:48 +02:00
cody glassman
04843fed6d moddable post-processing pipeline 2022-05-15 10:03:58 -07:00
elsid
a75c7c49f0
Disable writes to navmeshdb on database is locked error
Simultaneously writing to sqlite3 database is not possible. Process exclusively
locks the database for this. Another process will fail to perform any request
when database is locked. Alternatively it can wait. Handling this situation
properly requires complexity that is not really needed. Users are not expected
to run multiple openmw processes simultaneously using the same navmeshdb.

Before this change running multiple openmw processes using the same navmeshdb
can lead to a crash when first transaction fails to start because there is
exception thrown and not catched.

Remove use of explicit transactions from DbWorker. Handling all possible
transaction states due to different errors brings unnecessary complexity.
Initially they were introduced to increase time between flushes to disk. This
makes sense for navmeshtool because of massive number of writes but for the
engine this is not an issue.
2022-05-09 22:54:46 +02:00
Petr Mikheev
c7ab67c2c1 Allow relative paths in openmw.cfg; support --replace=config. 2022-04-28 00:39:41 +02:00
madsbuvi
dc3045c970 mono-only version of the shader linking system introduced in the stereo MR 2022-04-26 19:54:24 +02:00
Petr Mikheev
eae1e87081 [Lua] Update openmw.storage 2022-04-23 18:55:12 +02:00
psi29a
f99f818c0c Merge branch 'esm4_cleanup' into 'master'
ESM4 cleanup

See merge request OpenMW/openmw!1792
2022-04-23 15:27:28 +00:00
elsid
d71a1efa92
Rename components/esm4/acti.hpp -> components/esm4/loadacti.hpp 2022-04-23 00:40:45 +02:00
elsid
94c1d0cced
Use unique_ptr to store istream 2022-04-22 18:27:17 +02:00
psi29a
c14796fc57 Merge branch 'ncc' into 'master'
#6496 Handle NCC flag in Nif files

See merge request OpenMW/openmw!1516
2022-04-17 20:29:41 +00:00
fredzio
d05a2facf3 Handle NCC flag in Nif files. Objects with this flag will collide only with camera.
Expose objects with NC flag to be used by Lua mods.
2022-04-17 20:03:00 +02:00
Evil Eye
86d7f5a988 Fix tests 2022-04-16 22:58:08 +02:00
elsid
fbc853804d
Fix recover from errors in Files::getHash 2022-04-15 21:43:54 +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
4447ab0ed7
Remove ESM:: namespace qualifier in components/esm3/ and tests 2022-04-12 02:04:24 +02:00
elsid
5eb8c4aebe
Avoid redundant conversion to const char* and use make_shared 2022-04-10 22:33:08 +02:00
Benjamin Winger
21ffbcc4b4 Lua i18n updates 2022-04-10 07:57:02 +00:00
psi29a
fc5605fc7f Merge branch 'navmeshtool_binary_log' into 'master'
Send status of navmeshtool to launcher using type binary messages

See merge request OpenMW/openmw!1630
2022-04-06 23:40:45 +00:00
Matt
49e21e121a Revert "Merge branch 'refactor/6677-2' into 'master'"
This reverts merge request !1733
2022-04-04 17:09:52 +00:00
psi29a
ca77ae336f Merge branch 'refactor/6677-2' into 'master'
Introduce IndexedVector

See merge request OpenMW/openmw!1733
2022-04-04 13:56:20 +00:00
Matt
21e4c10fa9 Introduce IndexedVector 2022-04-04 13:56:19 +00:00