1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 20:49:56 +00:00
Commit graph

17363 commits

Author SHA1 Message Date
elsid
d122e184cc
Report navmesh change for not posted tiles
Corresponding recast mesh tiles can be updated but navmesh tiles may never
appear for them. Report back zero navmesh version to allow oscillating recast
objects detection to work. This version is always less than any generated
navmesh tile version so any report for generated navmesh will override it.
If zero navmesh version is reported after recast mesh tile got report about
generated navmesh tile it is a no-op since generated version is always greater
than zero.
2021-05-27 12:40:00 +02:00
Mads Buvik Sandvei
d906ec773a Fix hangup on savegame after manual screenshots. 2021-05-24 17:57:39 +00:00
psi29a
dff4b83d9d Merge branch 'stop_threading' into 'master'
Stop osg viewer threading before destructing engine

See merge request OpenMW/openmw!901
2021-05-22 08:52:44 +00:00
elsid
375372981c
Stop osg viewer threading before destructing engine
To avoid rendering while engine parts are destructing.
2021-05-21 23:16:15 +02:00
elsid
105cd5b06f
Add more checks to NavMeshTilesCache tests 2021-05-21 19:33:42 +02:00
fredzio
b13afd758c Remove both racy and useless code.
Actor's position can be determined in 3 ways:
1/ as a result of physics simulation
2/ after a script require a relative position change (SetPos, Move)
3/ absolutely set from games mechanics event (teleport) or script
(PositionCell)

In case 1/, RefData::mPosition is updated with the physics simulation result
In case 2/, when RefData::mPosition is updated, physics simulation is informed of the change and update accordingly
In case 3/, when RefData::mPosition is updated, the physics simulation state is reset

In all 3 cases, we don't need to check the RefData::mPosition to get a
correct behaviour.

TSAN reported the following data race:
  Read of size 4 at 0x7b50005b75b0 by thread T12 (mutexes: write M656173, write M84859534346343880):
    #0 ESM::Position::asVec3() const /build/openmw/openmw/master2/.build/freebsd/TSAN/../../.././components/esm/defs.hpp:55:27 (openmw+0xb809d5)
    #1 MWPhysics::Actor::updateWorldPosition() /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwphysics/actor.cpp:131:59 (openmw+0xb809d5)
    #2 MWPhysics::Actor::setPosition(osg::Vec3f const&) /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwphysics/actor.cpp:177:5 (openmw+0xb809d5)
    #3 MWPhysics::PhysicsTaskScheduler::updateActorsPositions() /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwphysics/mtphysics.cpp:524:28 (openmw+0xb91ac0)
    #4 MWPhysics::PhysicsTaskScheduler::afterPostStep() /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwphysics/mtphysics.cpp:614:13 (openmw+0xb915e7)
    #5 MWPhysics::PhysicsTaskScheduler::worker()::$_5::operator()() const /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwphysics/mtphysics.cpp:498:45 (openmw+0xb915e7)
    #6 void Misc::Barrier::wait<MWPhysics::PhysicsTaskScheduler::worker()::$_5>(MWPhysics::PhysicsTaskScheduler::worker()::$_5&&) /build/openmw/openmw/master2/.build/freebsd/TSAN/../../.././components/misc/barrier.hpp:30:21 (openmw+0xb915e7)
    #7 MWPhysics::PhysicsTaskScheduler::worker() /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwphysics/mtphysics.cpp:498:31 (openmw+0xb915e7)
    #8 MWPhysics::PhysicsTaskScheduler::PhysicsTaskScheduler(float, btCollisionWorld*, MWRender::DebugDrawer*)::$_0::operator()() const /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwphysics/mtphysics.cpp:162:45 (openmw+0xb92630)
    #9 decltype(std::__1::forward<MWPhysics::PhysicsTaskScheduler::PhysicsTaskScheduler(float, btCollisionWorld*, MWRender::DebugDrawer*)::$_0>(fp)()) std::__1::__invoke<MWPhysics::PhysicsTaskScheduler::PhysicsTaskScheduler(float, btCollisionWorld*, MWRender::DebugDrawer*)::$_0>(MWPhysics::PhysicsTaskScheduler::PhysicsTaskScheduler(float, btCollisionWorld*, MWRender::DebugDrawer*)::$_0&&) /usr/include/c++/v1/type_traits:3899:1 (openmw+0xb92630)
    #10 void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, MWPhysics::PhysicsTaskScheduler::PhysicsTaskScheduler(float, btCollisionWorld*, MWRender::DebugDrawer*)::$_0>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, MWPhysics::PhysicsTaskScheduler::PhysicsTaskScheduler(float, btCollisionWorld*, MWRender::DebugDrawer*)::$_0>&, std::__1::__tuple_indices<>) /usr/include/c++/v1/thread:280:5 (openmw+0xb92630)
    #11 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, MWPhysics::PhysicsTaskScheduler::PhysicsTaskScheduler(float, btCollisionWorld*, MWRender::DebugDrawer*)::$_0> >(void*) /usr/include/c++/v1/thread:291:5 (openmw+0xb92630)

  Previous write of size 8 at 0x7b50005b75b0 by main thread:
    #0 memcpy /wrkdirs/usr/ports/devel/llvm-devel/work-default/llvm-project-3f6753efe1990a928ed120bd907940a9fb3e2fc3/compiler-rt/lib/tsan/../sanitizer_common/sanitizer_common_interceptors.inc:827:5 (openmw+0x55a057)
    #1 MWWorld::RefData::setPosition(ESM::Position const&) /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwworld/refdata.cpp:216:19 (openmw+0xa3de1c)
    #2 MWWorld::World::moveObject(MWWorld::Ptr const&, MWWorld::CellStore*, float, float, float, bool) /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwworld/worldimp.cpp:1130:26 (openmw+0xa57300)
    #3 MWWorld::World::moveObject(MWWorld::Ptr const&, float, float, float, bool, bool) /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwworld/worldimp.cpp:1253:16 (openmw+0xa580c8)
    #4 MWWorld::World::doPhysics(float, unsigned long long, unsigned int, osg::Stats&) /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwworld/worldimp.cpp:1530:17 (openmw+0xa5af8f)
    #5 MWWorld::World::updatePhysics(float, bool, unsigned long long, unsigned int, osg::Stats&) /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/mwworld/worldimp.cpp:1862:13 (openmw+0xa61a7c)
    #6 OMW::Engine::frame(float) /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/engine.cpp:333:42 (openmw+0xcce9e7)
    #7 OMW::Engine::go() /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/engine.cpp:935:14 (openmw+0xcd86ed)
    #8 runApplication(int, char**) /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/main.cpp:296:17 (openmw+0xcbffac)
    #9 wrapApplication(int (*)(int, char**), int, char**, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../components/debug/debugging.cpp:205:15 (openmw+0x1335442)
    #10 main /build/openmw/openmw/master2/.build/freebsd/TSAN/../../../apps/openmw/main.cpp:308:12 (openmw+0xcc008a)
:wqa
2021-05-20 20:46:44 +02:00
psi29a
3920477618 Merge branch 'moving_lighting_method_to_graphics' into 'master'
Moving Lighting Method from Advanced -> Visuals to Graphics -> Lighting

See merge request OpenMW/openmw!883
2021-05-19 05:09:24 +00:00
psi29a
c4fde03542 Merge branch 'ObjectPagingMergeIssue' into 'master'
Share state

See merge request OpenMW/openmw!879
2021-05-19 05:08:12 +00:00
Thunderforge
4a15868c0e Moving Lighting Method from Advanced -> Visuals to Graphics -> Lighting
The plan is to add additional options to this new tab, and since it's of similar status as the Shaders settings, it makes sense to put them next to them on the Graphics page.
2021-05-18 18:05:54 -05:00
CedricMocquillon
d11a6bd92c Share state 2021-05-18 17:57:47 +02:00
Atahualpa
3a1243a5d0 Rebased branch, reduced code duplication, added comments, adjusted formatting. 2021-05-18 17:53:00 +02:00
Atahualpa
ca80aeaaea Fix vertex calculation for cell-border drawing. 2021-05-18 15:05:26 +02:00
Atahualpa
356efa15a2 Fixes #6035 (circle brush selects outside of circle) and #6036 (some corner vertices not selected). 2021-05-18 15:04:01 +02:00
Atahualpa
7be891b440 Directly use Geometry instead of Geode; fix for loop; add size_t type-cast. 2021-05-18 14:56:03 +02:00
Atahualpa
73949d5bd0 Updating the CMake file isn't a bad idea either... 2021-05-18 14:56:03 +02:00
Atahualpa
6c49074765 Remove old references to Cell class. 2021-05-18 14:56:03 +02:00
Atahualpa
008bf64dd9 Second step toward fixing terrain selection issues. 2021-05-18 14:56:03 +02:00
Atahualpa
18ea4d8eb2 First step toward fixing terrain selection issues. 2021-05-18 14:56:02 +02:00
Bret Curtis
373f8636b7
Merge pull request #3092 from akortunov/master
Do not trigger in-game bindings via mouse buttons when controls are disabled
2021-05-18 10:47:45 +02:00
psi29a
ae66afb219 Merge branch 'less_verbose' into 'master'
Make the code less verbose.

See merge request OpenMW/openmw!874
2021-05-18 08:30:50 +00:00
psi29a
e9fbd76e9b Merge branch 'windows_tests' into 'master'
Support running tests and benchmarks for windows

See merge request OpenMW/openmw!839
2021-05-18 08:12:22 +00:00
psi29a
4bc7012104 Merge branch 'pack-default-settings' into 'master'
Pack default settings

Closes #5925

See merge request OpenMW/openmw!822
2021-05-18 08:11:13 +00:00
elsid
3ef1b27099
Add missing includes 2021-05-18 01:21:42 +02:00
psi29a
f1f1703441 Merge branch 'fix_navmesh_wait' into 'master'
Fix redundant waiting until navmesh is generated

See merge request OpenMW/openmw!861
2021-05-17 10:54:23 +00:00
Andrei Kortunov
c11774f278 Do not trigger in-game bindings via mouse buttons when controls are disabled (bug #6047) 2021-05-17 12:23:56 +04:00
AnyOldName3
c2e4eda825 Merge branch '6013-fix' into 'master'
Retain draw callback

Closes #6013 and #5967

See merge request OpenMW/openmw!875
2021-05-16 17:30:38 +00:00
madsbuvi
f3e17e7c52 Don't redundantly call notify on every frame. 2021-05-16 18:09:48 +02:00
Frederic Chardon
62c7adc87b Merge branch 'no_at_boundaries' into 'master'
Don't use at() instead [] when length is checked/known

See merge request OpenMW/openmw!866
2021-05-16 11:58:14 +00:00
Frederic Chardon
38db2f8810 Merge branch 'includes_mwgui' into 'master'
Remove some useless includes from apps/openmw/mwgui

See merge request OpenMW/openmw!870
2021-05-16 11:46:13 +00:00
madsbuvi
5b9a2b73b0 Retain final draw callback as a member variable in ScreenshotManager, and do not call setFinalDrawCallback after init. 2021-05-16 13:04:30 +02:00
Frederic Chardon
807c7a2025 Merge branch 'useless_includes_mwmechanics' into 'master'
Remove some useless headers in apps/openmw/mwmechanics

See merge request OpenMW/openmw!871
2021-05-16 10:51:43 +00:00
fredzio
5b63019719 Embed actor velocity inside its class. It makes the code simpler. 2021-05-16 12:42:17 +02:00
fredzio
c55db790f3 Make the code less verbose / more readable using for range loop and
structured binding.

No functional changes.
2021-05-16 12:42:16 +02:00
Frederic Chardon
730f1fe2a7 Merge branch 'useless_includes_mwphysics' into 'master'
Remove some useless includes in apps/openmw/mwphysics

See merge request OpenMW/openmw!872
2021-05-16 10:37:33 +00:00
jvoisin
9373e4ada7 Remove some useless includes in apps/openmw/mwphysics 2021-05-15 23:13:46 +02:00
jvoisin
9522a64e7d Remove some useless includes from apps/openmw/mwgui 2021-05-15 22:15:46 +02:00
jvoisin
1cd15613a6 Remove some useless headers in apps/openmw/mwmechanics 2021-05-15 22:14:08 +02:00
psi29a
3d61d7ec9a Merge branch 'optimize_initial_load' into 'master'
Optimize engine initial loading time

See merge request OpenMW/openmw!867
2021-05-15 18:48:17 +00:00
Evil Eye
6cb6461cba Merge branch 'const_ref_it' into 'master'
Use const references when possible in for loops

See merge request OpenMW/openmw!869
2021-05-15 18:47:03 +00:00
jvoisin
7deb6a6ffd Use const references when possible in for loops
No need for useless copies.
2021-05-15 19:50:01 +02:00
jvoisin
c1e3869f25 Remove an unused struct 2021-05-15 19:49:15 +02:00
elsid
1e2aae8095
Use stable sort+unique to collect RefIDs for ESMStore records counting
The idea is to avoid std::map lookup for each CellRef. Instead generate a
sequence of added and removed RefNums into a vector then order them by RefNum
using a stable sort that preserves relative order of elements with the same
RefNum. RefIDs are stored in a different vector to avoid std::string move ctor
calls when swapping elements while sorting. Reversed iteration over added and
removed RefNums for each unique RefNum is an equivalent to what map-based
algorithm produces. The main benefit from sorting a vector is a data locality
that means less cache misses for each access. Reduces ESMStore::countRecords
perf cycles by 25%.
2021-05-15 18:45:22 +02:00
elsid
9938af2289
Use unordered_map for ref count
Reduces ESMStore::countRecords time by 8%.
2021-05-15 18:45:22 +02:00
elsid
6248dc72cb
Convert to lower case only when needed 2021-05-15 18:45:21 +02:00
elsid
f2188d2533
Reduce temporary allocations on ESM loading
By moving objects instead of copying when possible.
2021-05-15 18:45:21 +02:00
Bret Curtis
8a315b01ae
Merge pull request #3089 from xyzz/fix-journalbooks-ub
Fix out-of-bounds access in JournalBooks::createCyrillicJournalIndex
2021-05-15 17:25:47 +02:00
Ilya Zhuravlev
13f060623f Fix out-of-bounds access in JournalBooks::createCyrillicJournalIndex 2021-05-15 10:45:39 -04:00
jvoisin
690d85d0e9 Don't use at() instead [] when length is checked/known 2021-05-15 15:38:17 +02:00
Andrei Kortunov
b63f53f5bb Disable shield animation when we launch a torch one (bug #6043) 2021-05-15 11:31:08 +04:00
AnyOldName3
5d83de189a Merge branch 'insert_or_assign' into 'master'
Use insert_or_assign() instead of hand rolled version.

See merge request OpenMW/openmw!862
2021-05-14 22:57:07 +00:00