Commit Graph

148 Commits (35561450f1f9d4c2136d379dfc5d15fb117e517b)

Author SHA1 Message Date
Andrei Kortunov 35561450f1 Do not copy osg::ref_ptr when possible 10 months ago
Mads Buvik Sandvei 364f2a98e9 Use refnum instead of slot for items during spellcast 10 months ago
Evil Eye 7573004efc Implement the NegativeLight flag 10 months ago
elsid 6e8dcc16c6
Use settings values for Game settings 11 months ago
Evil Eye 73c2387708 Merge schools into skills 11 months ago
Evil Eye 9947a41c37 Combine magic school properties into structs 11 months ago
Petr Mikheev f1beaa7b8c Put ESMStore to Environment 1 year ago
Andrei Kortunov 74126953fc Do not use a rendering node position as a hit position (bug 7298) 1 year 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
1 year ago
fteppe c8bb733360 removed clear() function, the only way to change the Id from the outside is from the assignment operator
replaced ciEqual with == operator
1 year 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!
1 year ago
elsid 843753da14
Remove unused includes 2 years ago
clang-format-bot ddb0522bbf
Apply clang-format to code base 2 years ago
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 2 years ago
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
2 years ago
florent.teppe 3a62ef3a99 Store added storespecialization to cmakelist, and removed the captial first letter 2 years ago
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
2 years ago
Evil Eye 8d66b2e75d Remove redundant params 2 years ago
Evil Eye 2b9d475e50 Fix #6959 2 years ago
unknown 827a2f0b77 Use string_view in animation code 2 years ago
Evil Eye a547608289 Preserve effect indices when applying AoE and targeted spells 2 years ago
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.
2 years ago
elsid ce263af393
Use existing functions and objects to call correctMeshPath etc
Remove WindowManager wrappers.

It's not safe to use WindowManager in all places and it's not required.
Environment stores resource system providing VFS required to call these
functions. In the case of ObjectPaging it's available from the member variable.
Also ObjectPaging::createChunk may access WindowManager when it's already
destructed when exiting the game because it's destructed before CellPreloader
finishes all background jobs. Engine::mResourceSystem is destructed after all
other systems so it's safe to use it.
2 years ago
uramer fd7965d77f Use correctMeshPath instead of string constants 2 years ago
elsid 4509b05bc8
Use std::make_shared instead of new
make_shared allocates single storage for ref counter and the object.
std::shared_ptr<T>(new T) allocates 2 storages.
2 years ago
Bret Curtis d1fb854521 move most of the files from esm to esm3, keep common code in esm; this is make space for a future with esm4
esm typo

esm typo
2 years ago
Alexei Dobrohotov b918135b4b Factor race weight into magic projectile speed (bug #6343) 3 years ago
psi29a 4c81518abb Merge branch 'puddle' into 'master'
Give each reflect and spell absorption effect a chance to apply

Closes #6255 and #6253

See merge request OpenMW/openmw!1279
3 years ago
fredzio 3750eb9cd8 Move Projectile simulation to the background thread. 3 years ago
Evil Eye 4ec927829f Give each reflect and spell absorption effect a chance to apply 3 years ago
Bo Svensson b2af81bc18
converts remaining osg::NodeCallback (#3147)
With this PR we convert remaining instantiations of the deprecated osg::NodeCallback in Open MW to SceneUtil::NodeCallback.
3 years ago
Evil Eye dc1fe62dde Overhaul magic effects to work with onApply and onEnd events 3 years ago
fredzio 0bce6c09e1 Change projectile behaviour to be like in vanilla wrt. water plane:
- enchanted arrow explode upon hit the water plane
- non enchanted arrow disappear (or more accurately, they hit nothingness)
- enchanted arrow shot underwater explode immediately
- non enchanted arrow disappear immediately

Also, solve a bug that occured previously and could theoritically still happens where we use the last tested collision position for instead of the last registered hit:
Use the hit position as saved inside Projectile::hit() instead of the last position saved inside the callback.
If a projectile collides with several objects (bottom of the sea and water surface for instance), the last collision tested won't necessarily be the impact position as we have no control over the order in which the tests are performed.
3 years ago
fredzio 07fa1803f7 Use btCollisionObject* instead of MWWorld::Ptr inside of Projectile
collision handling and castRay() to avoid calling getPtr(). It is a step forward
removing the mutex inside of PtrHolder.

Do the same for DeepestNotMeContactTestResultCallback. It is used
only for not-ranged combat for now, but do it anyway for parity with all
other callback. This way, once the PtrHolder mutex is gone one will not
have to worry about wether it is safe to use the callback in a specific
context.

To avoid use-after-free with projectile / projectile collision, defer deletion of projectile.
Since instead of storing a copy of target Ptr we have a pointer to its collision object,
we can't delete projectiles until after we finished iterating over the loops.
3 years ago
Alexei Dobrohotov 1fc7cb8191 Don't use FreezeOnCull for any particle system (#4744) 3 years ago
jvoisin 1123dc46ee Add a ton of const refs 3 years ago
jvoisin 8695b6fbc5 Use operator[] instead of at() when the idx is checked 3 years ago
jvoisin 998cc97a4f And done! 3 years ago
Max 2cd96e56d5 create constant and use constant in other parts of the code base 3 years ago
Alexei Dobrohotov 2bfee281fd Merge branch 'restore_caster' into 'master'
Restore projectile caster from savegame (#5860)

See merge request OpenMW/openmw!616

(cherry picked from commit d595c7adb0fb45eafed6d3d0403ad640a91411ed)

c5426bec In the savegame, projectile caster is identified by its actor id. When
3 years ago
fredzio 6e969ca3fa Use mesh collision box instead of node bounding sphere for projectile
size. The bounding sphere is much bigger than the mesh.
3 years ago
Evil Eye a2171875a0 Prevent nullptr access 3 years ago
fredzio 1f4c85520f Use convexSweepTest for projectile movement to solve any
imprecision issue with projectile collision detection.
Simplify the mechanics: manage hits in one spot.
Give magic projectiles a collision shape similar in size to their visible
model.

Rename the 2 convex result callback to clearly state their purpose.
3 years ago
fredzio b39437dfb6 Don't allow projectiles to stand still when they hit an ally.
When an NPC fire a projectile, it should affect only its targeted actor.
To this end, after a hit is detected the target is checked against the
list of AI targets and reactivated if necessary.
Problem occurs when the hit occurs as a result of a friendly actor going
into the projectile (detected in ClosestNotMeConvexResultCallback):
while the projectile is inside the friend's collision box, it is
deactivated, just to be immediately reactivated. Effectively, the
projectile does nothing until the actor moves out.

Add a check inside the ClosestNotMeConvexResultCallback before declaring
a hit.
Since the necessary data is not safely accessible from the async thread,
maintain a copy inside the Projectile class.
3 years ago
fredzio 4fbe1ed12c Ignore caster collision shape. Sometimes the magic bolt get launched
inside too near its caster.
4 years ago
fredzio 66fe3b0d38 Modify projectile collision to work with async physics 4 years ago
Andrei Kortunov dc7b48e92e Generate physics collisions for projectiles (bug #3372)
Remove redundant now mHit field
4 years ago
psi29a ba3aad31c1 Merge branch 'hitdebug' into 'master'
Visualize hits in the debug overlay

See merge request OpenMW/openmw!379
4 years ago
Alexei Dobrohotov 53f91a3aa5
Merge pull request #3018 from akortunov/emplace
Use emplace_back instead of push_back
4 years ago
fredzio e8c0a7bec0 Visualie projectile hits 4 years ago