Commit Graph

18129 Commits (a9877aea984243bc04cf26b80320a7d96c22124f)

Author SHA1 Message Date
Andreas Stöckel 1583252dd8 Improve sound fading
* Implement a more general SoundBase::setFade that can be used to fade to any desired
volume and not just fading out
* Implement SoundBase::setFadeout by using SoundBase::setFade
* Implement an exponential fade mode
3 years ago
Bo Svensson cd946ea35a
removes unused recordcmp.hpp (#3214)
This PR removes an unused source file.
3 years ago
Bo Svensson 6cf74f7041
refactors ESM::Land (#3213)
With this PR we reduce coupling, simplify code, encapsulate a variable and separate actual `ESM` data from its context.
3 years ago
Bo Svensson 3042c000c6
fixes setActorFade logic errors (#3195)
* resets state updater to apply light settings (#3141)

resets state updater to apply light settings

With this PR we achieve the same effect with fewer lines of code.

* fixes LightSource logic errors

We currently update `LightSource::setActorFade` in `TransparencyUpdater`. There are several logic errors inherent in this approach:
1. We fail to update `LightSource::setActorFade` for off screen actors because their `TransparencyUpdater` cull callback is not invoked.
2. We fail to update `LightSource::setActorFade` in the instant that a `TransparencyUpdater` is removed.
3. We fail to update `setActorFade` when an `mExtraLightSource` is created after calling `Animation::setAlpha`.
With this PR we avoid such issues by updating `LightSource::setActorFade` in `Animation::setAlpha` and `Animation::addExtraLightSource` instead.
3 years ago
glassmancody.info 4c3dd1a964 remove particle node when resetting particle effect 3 years ago
Bo Svensson f684c1da52
fixes assertion (#3215)
This PR fixes an assertion introduced by #3211. For some reason my build originally did not contain assertions despite passing `DEBUG` into cmake, but after deleting `CMakeCache.txt` I have now hit the assertion @glassmancody reported as well.
3 years ago
Bo Svensson fac84b5dd3 restores ESM::Dialogue order (#3209)
With this PR we restore the previous order of `ESM::Dialogue` entries implicitly changed by PR #3197. In the future we may want to consider additional verification and documentation of `mShared` order inconsistencies. We might additionally consider applying this sorting in the particular code that requires it.
3 years ago
psi29a c9f3c27dc7 Merge branch 'phys_perf_test' into 'master'
Help bullet optimize collisions with very complex collision meshes by making small collision tests if possible

See merge request OpenMW/openmw!1317
3 years ago
Bo Svensson 4657c655b1 refactors parentFileIndices (#3211)
This PR aims to start addressing `ESM` design issues that have silenced errors we incorporated into groundcover `ESM` loading approaches.

- We move the resolution of `parentFileIndices` from `ESMStore` to `ESMReader` as suggested in a `TODO` comment.
- We improve a highly misleading comment which downplayed the significance of `parentFileIndices`.
- We document important preconditions.
- We move a user facing error message to the highest level and improve its context.
- We remove an inappropriate `setGlobalReaderList` method. We now pass this reader list into the method that requires it.
- We remove a thoroughly pointless optimisation of `Store<ESM::LandTexture>`'s construction that has unnecessarily depended on `getGlobalReaderList`.

There should be no functional changes for `master`, but this PR should remove an issue blocking PR #3208.
3 years ago
elsid 2b057f5c15
Expect nif node children to have parent 3 years ago
elsid 4e8e8304aa
Avoid mesh allocation when data is invalid 3 years ago
elsid 4631d95739
Add more tests for BulletNifLoader 3 years ago
psi29a 523289c531 Merge branch 'refactor_bullet_shape' into 'master'
Refactor bullet shape

See merge request OpenMW/openmw!1333
3 years ago
psi29a 4ff4afd50b Merge branch 'lua_callback' into 'master'
Refactoring. Lua `Callback` is moved from apps/openmw/mwlua to components/lua.

See merge request OpenMW/openmw!1334
3 years ago
psi29a ea7e83499d Merge branch 'enlightened_skeletons' into 'master'
Allow creatures to use torches

Closes #6376

See merge request OpenMW/openmw!1335
3 years ago
Evil Eye a9106f4d7c Rotate torches by 90 degrees 3 years ago
wareya 940e338453 Constifications 3 years ago
Bo Svensson 213faa6695
restores countRecords optimisations (#3210)
With this PR we restore @elsid 's optimisations of countRecords we have unintentionally discarded in PR #3197. In addition, we give it a more appropriate name and add comments concerning its peculiar background.
3 years ago
psi29a d3b2503111 Merge branch 'distractions' into 'master'
Reduce code duplication in getting the shield model

See merge request OpenMW/openmw!1337
3 years ago
psi29a 9694398b69 Merge branch 'actually_walk_on_the_water' into 'master'
#6373: finish half commited commit

See merge request OpenMW/openmw!1336
3 years ago
Andreas Stöckel a5a895ffd4 Fix #6381
Do not use osg::PI_f
3 years ago
Evil Eye 3660d5cc4c Reduce code duplication in getting the shield model 3 years ago
glassmancody.info 4461366761 settings update and launcher option 3 years ago
fredzio 8c21b0b503 Apply waterwalking even when we skip simulation.
This chunk was supposed to be part of !1324 but somehow got stuck staged in my tree.
3 years ago
Evil Eye 92bdd44e58 Allow creatures to use torches 3 years ago
Petr Mikheev e7ec89573e Refactoring. Lua `Callback` is moved from apps/openmw/mwlua to components/lua. 3 years ago
Evil Eye 3c40935ec1 Fix regression #6375 3 years ago
Bo Svensson 356e9d7cf0
refactors osg::Callback virtual inheritance (#3200)
With this PR we refactor `SceneUtil::KeyframeController` not to require `virtual osg::Callback` inheritance. I suppose such `virtual` overhead is not justified here because it negatively impacts many other classes we derive from `osg::Callback`.
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
glassmancody.info 8c3b00164e soft particles 3 years ago
psi29a 3eb6b658c6 Merge branch 'setpos_strikes_back' into 'master'
#6292 unbreak scripted spells

See merge request OpenMW/openmw!1324
3 years ago
psi29a 740045f7d6 Merge branch 'test_compiler' into 'master'
Add unit tests for the mwscript compiler

See merge request OpenMW/openmw!1325
3 years ago
psi29a 15cb9f886c Merge branch 'launcher_omwscripts' into 'master'
Support *.omwscripts in openmw-launcher

See merge request OpenMW/openmw!1329
3 years ago
Bo Svensson 1329f22186
refactors MWWorld::Store maps (#3197)
With this PR we clean up `MWWorld::Store` maps according to the approach of PR #3184.
3 years ago
Bo Svensson 7d34149adc
consolidates createUnlitMaterial (#3203)
With this PR we remove a few duplicate lines of code by adding a parameter to `createUnlitMaterial`.
3 years ago
Bo Svensson 7e6533f0f3
refactors screenshot360 (#3202)
With this PR we refactor screenshot360 not to manually adjust node masks.
3 years ago
Evil Eye ae08f942d5 Test binary operators 3 years ago
Evil Eye 3c5a50cf90 Add issues from Redmine 3 years ago
Evil Eye 319d30fb85 Add AddTopic testing 3 years ago
Evil Eye b3208f4066 Add more issues and a forum thread 3 years ago
Evil Eye 8e0dfe3a8a Add tests for more issues 3 years ago
Evil Eye b2cdbe2e61 Add tests for certain issues 3 years ago
Evil Eye 3dada0796a Validate integer math 3 years ago
Evil Eye f027acf575 Move boilerplate to separate file 3 years ago
Evil Eye be759e576a Be sure to verify the opcode got executed 3 years ago
Evil Eye 6ad8549163 Allow validation of constant arguments 3 years ago
Evil Eye e1ac871672 Start adding compiler tests 3 years ago
elsid a78dee740a Merge branch 'dead_code' into 'master'
remove dead code and fix changelog entry

See merge request OpenMW/openmw!1330
3 years ago
glassmancody.info f0eb068e4b remove dead code and fix changelog entry 3 years ago
elsid 8e71c246bf
Remove redundant BulletShape getters 3 years ago
elsid b905dd17c3
Use unique_ptr to store btCollisionShape in BulletShape 3 years ago
fredzio 68f4c336ce Rework again SetPos command to make more mods work.
Previous version skipped collision the frame immediately after a call to SetPos. It worked for one-off calls (teleports for instance) and continuous call along a pre-defined path (scenic travel). However, in the case of mod which uses SetPos to simulate a player-controlled movement, it is equivalent to using tcl.
Solution:
1/ skip update of mPosition and  mPreviousPosition to avoid janky interpolation
2/ use back plain moveObject() instead of moveObjectBy() since we don't want physics simulation
3/ rework a little bit waterwalking influence on coordinate because of 1/
3 years ago
wareya 8c0102e1ee Optimize short-trace test to only be done when particularly helpful 3 years ago
elsid 29a772c33f
Rename Resource::BulletShape::CollisionBox fields according to styleguide 3 years ago
Petr Mikheev 37386f417e Support *.omwscripts in openmw-launcher 3 years ago
psi29a e3cfe5d35a Merge branch 'backproj' into 'master'
Move the projectile simulation to the background thread

See merge request OpenMW/openmw!1276
3 years ago
psi29a b189282ba1 Merge branch 'compile_no_evil' into 'master'
Remove dead code

See merge request OpenMW/openmw!1327
3 years ago
psi29a 34b63bf142 Merge branch 'omwscripts' into 'master'
Change format of "*.omwscripts" files

See merge request OpenMW/openmw!1271
3 years ago
Evil Eye 9b565c4cf9 Remove dead code 3 years ago
psi29a b3f84df43c Merge branch 'sky_shaders' into 'master'
Sky shaders

See merge request OpenMW/openmw!1057
3 years ago
fredzio 3750eb9cd8 Move Projectile simulation to the background thread. 3 years ago
fredzio a245981e4e Make interpolateMovement works with PtrHolder instead of Actor 3 years ago
fredzio ad7a810a62 Unify interface for Actor and Projectile 3 years ago
Frederic Chardon 5009b66ef5 Use std::variant in the physics simulation for the different types of objects. For now only support only for actors. 3 years ago
psi29a fb3675d523 Merge branch 'improved_toggleworld' into 'master'
Improved toggle world (#6364)

See merge request OpenMW/openmw!1320
3 years ago
glassmancody.info e436147c10 improved toggle world 3 years ago
Andrei Kortunov 3ee6657768 Early out from LOS check when source and target is the same (bug 5913) 3 years ago
Petr Mikheev 95faeaa9c1 Fix: after reloadlua call onActive for all active scripts 3 years ago
Petr Mikheev 19a0fde278 Filter saves by the first esm/omwgame rather than by the first content file (that can be a universal omwaddon/omwscripts) 3 years ago
Petr Mikheev 47c89567fb Load LuaScriptsCfg from both *.omwscripts and *.omwaddon files. 3 years ago
Petr Mikheev 9adc190209 Redesign LuaUtil::ScriptsContainer to work with ScriptsConfiguration 3 years ago
Petr Mikheev 33d71be81f Add LuaUtil::ScriptsConfiguration 3 years ago
Petr Mikheev 6aab246879 Add ESM records that are needed to store Lua scripts configuration;
Use ptr.getType() (i.e. esm record names) instead of typeid(ptr.getClass()) in apps/openmw/mwlua.
3 years ago
Evil Eye 4ec927829f Give each reflect and spell absorption effect a chance to apply 3 years ago
psi29a c0dca5371b Merge branch 'recalc_mana' into 'master'
Don't wait a frame to recalculate magicka

Closes #3792

See merge request OpenMW/openmw!1323
3 years ago
psi29a 2765bcee5e Merge branch 'serialization' into 'master'
Add helpers for binary serialization

See merge request OpenMW/openmw!1319
3 years ago
glassmancody.info ba4f1921ab overrides 3 years ago
glassmancody.info 07e32c0fa6 remove object shader path 3 years ago
Evil Eye 289e1544d2 Don't wait a frame to recalculate magicka 3 years ago
Bret Curtis 3d0da9b9b2
Merge pull request #3191 from akortunov/warnfix
Fix some MSVC warnings
3 years ago
Bo Svensson 1ff8318a52
refactors premultiplied alpha (#3189)
With this PR we refactor a `premultiplied alpha` user string set by `characterpreview.cpp` into a more flexible mechanism allowing us to assign any state to GUI textures. We can consider these changes more future proof than the previous approach.
3 years ago
Bo Svensson 7f9beac3a7
refactors a case insensitive map (#3184)
This PR aims to spark the retirement of a questionable pattern I have found all over our code base. I will illustrate how this pattern encourages code duplication, lacks type safety, requires documentation and can be prone to bugs.
```
std::map<std::string, Object> mMap; // Stored in all lowercase for a case-insensitive lookup

std::string lowerKey = Misc::StringUtils::lowerCase(key);
mMap.emplace(lowerKey, object);

std::string lowerKey = Misc::StringUtils::lowerCase(key);
mMap.find(lowerKey);

mMap.find(key); // Not found. Oops!
```
An alternative approach produces no such issues.
```
std::unordered_map<std::string, Object, Misc::StringUtils::CiHash, Misc::StringUtils::CiEqual> mMap;

mMap.emplace(key, object);

mMap.find(key);
```
Of course, such an alternative will work for a `map` as well, but an `unordered_map` is generally preferable over a `map` with these changes because we have moved `lowerCase` into the comparison operator. 

In this PR I have refactored `Animation::mNodeMap` accordingly. I have reviewed and adapted all direct and indirect usage of `Animation::mNodeMap` to ensure we do not change behaviour with this PR.
3 years ago
Bo Svensson 6fb376f1cf
templatise ptr.hpp (#3185)
With this PR we consolidate identical logic for Ptr and ConstPtr with the help of a template.
3 years ago
glassmancody.info 9cbbd2fff5 better transitions 3 years ago
Andrei Kortunov 107a9ecb17 Fix variables hiding 3 years ago
elsid a58f1a94e3
Add helpers for binary serialization
To construct serializer from given entities:
* Data source/destination - any value that has to be serialized/deserialized,
  usually already existing type.
* Format - functional object to define high level serialization logic to
  define specific format and data schema. Like order of fields, allocation.
* Visitor - functional object to define low level serialization logic to
  operator on given data part.
  * BinaryWriter - copies given value into provided buffer.
  * BinaryReader - copies value into given destination from provided buffer.
  * SizeAccumulator - calculates required buffer size for given data.
3 years ago
glassmancody.info 1e40d27318 introduce sky shaders 3 years ago
Evil Eye f70a154195 Merge branch 'place' of github.com:akortunov/openmw into master 3 years ago
psi29a 217d17adeb Merge branch 'ugly_rounding' into 'master'
Prevent floating point issues accumulating

See merge request OpenMW/openmw!1306
3 years ago
Bo Svensson c9c8d02332
fixes a crash (#3183)
This PR fixes a crash caused by the improperly ensured lifetime of RigGeometry::mSourceGeometry. mSourceGeometry was not adequate to ensure mSourceGeometry would outlive mGeometry because we extend mGeometrys lifetime beyond this lifetime by passing mGeometry to the draw traversal instead of this.
In addition,

We add important comments.
We detect and prevent generally unsafe operations in high level code.
We add a sprinkling of const to help clarify intentions.
3 years ago
Evil Eye b5c876299d Round to a power of two 3 years ago
wareya e23b0edda4 Add pre-pass to collision trace function that traces over less distance if possible 3 years ago
psi29a 1ffa02b2fd Merge branch 'fix_windows_tests' into 'master'
Fix tests on windows

See merge request OpenMW/openmw!1313
3 years ago
psi29a a4899d72f4 Merge branch 'deduplicate_swim_speed' into 'master'
Deduplicate swim speed formula implementation

See merge request OpenMW/openmw!1310
3 years ago
psi29a ed811176bc Merge branch 'fix_esm_loader' into 'master'
Fix logic expression for not found value in EsmLoader::getModel

See merge request OpenMW/openmw!1308
3 years ago
psi29a 0d810fe41c Merge branch 'init_gmst' into 'master'
Use lambda instead of bool to make sure GMST initialized once

See merge request OpenMW/openmw!1309
3 years ago
Alexei Kotov 156f2a471a Merge branch 'self_target' into 'master'
Apply on self effects on projectiles to the target instead

Closes #6321

See merge request OpenMW/openmw!1312
3 years ago
elsid b5f0057ac9
Fix tests on windows 3 years ago
Evil Eye 63fa6d3b7c Apply on self effects on projectiles to the target instead 3 years ago
Evil Eye 31a7c83cc7 Fix a regression involving default arguments 3 years ago