Commit Graph

599 Commits (master)

Author SHA1 Message Date
Alexei Dobrohotov 46ec40fa92 Make sure NIFLoader avoids working further with empty geometry 4 years ago
Alexei Dobrohotov 1e6156e04a Turn all NIF records into structs 4 years ago
Alexei Dobrohotov c0b9823372 Read BSShaderProperty and handle NiGeometry properties 4 years ago
Alexei Dobrohotov 42226533d8 Handle BSLODTriShape
Its levels of detail are currently not handled
4 years ago
Alexei Dobrohotov 8fd45d85ec Unify NiGeometry/NiGeometryData handling 4 years ago
Alexei Dobrohotov 8ca324af0a Handle emissive TexEnv creation in one place 4 years ago
Alexei Dobrohotov 5310dd6807 Clean up particle vertex handling 4 years ago
Alexei Dobrohotov 1c83e4936d Read BSShaderTextureSet and NiColorInterpolator
Accept boolean-based and 4D vector-based NiInterpolators in ValueInterpolator constructor
4 years ago
Alexei Dobrohotov db9c174ca8 Make NIF particle node handling more generic 4 years ago
Andrei Kortunov 8084a336b5 Replace zeroes and nulls by nullptrs 4 years ago
AnyOldName3 86fad60c7d Merge branch 'roots' into 'master'
Handle multiple root nodes (bug #5604)

Closes #5604

See merge request OpenMW/openmw!428
4 years ago
Alexei Dobrohotov 5b6377b061 Handle multiple root nodes (bug #5604) 4 years ago
Nelsson Huotari f78a5d795c Separate keyframes logic to provide basis for osgAnimation integration. 4 years ago
Alexei Dobrohotov 8a6d3d1b4f Minor fixes
Fix extra semicolon
Disable collision avoidance if AI is disabled
4 years ago
Evil Eye 94c89e6d5e check ValueTs 4 years ago
Evil Eye d8897c4509 remove inline and use enable_if_t 4 years ago
Evil Eye d8d4351962 fix MSVC2017 builds 4 years ago
Alexei Dobrohotov a46699fb1e Handle NiGeomMorpherController interpolator list 4 years ago
Alexei Dobrohotov f3f5dcb016 Read a few more NIF types
NiFloatInterpolator, NiPoint3Interpolator, NiTransformInterpolator, NiBoolInterpolator
Update a few existing controller records
Update NiSkinInstance
4 years ago
Alexei Dobrohotov c79f509652 Misc NIF loader improvements
Bullet NIF loader cleanup
Collect all extra records of a node
Remove code duplication in geometry type detection in OSG-side NIF loader
4 years ago
Alexei Dobrohotov 53f91a3aa5
Merge pull request #3018 from akortunov/emplace
Use emplace_back instead of push_back
4 years ago
Alexei Dobrohotov 7e521788e9 Try to fix build 4 years ago
Alexei Dobrohotov 4fc5e22e9e NIF fixes and cleanup
Get rid of NodeIndexHolder
Use unsigned 32-bit type for NIF record index
Fix calculation of the number of UV sets
4 years ago
Alexei Dobrohotov 71056c6014 Clean up palettized NiPixelData loading 4 years ago
Andrei Kortunov 065ed5138e Use emplace_back instead of push_back 4 years ago
Andrei Kortunov 8ca3c3b123 Mark overrided methods by override keyword 4 years ago
Alexei Dobrohotov 9f08dc9968 Revert "Merge branch 'skinning' into 'master'"
This reverts merge request !327
4 years ago
Alexei Dobrohotov 6be808e301 RigGeometry: convert some pairs to structs 4 years ago
Alexei Dobrohotov 302d8eed27 Clean up Roll- and FlipController implementation 4 years ago
Alexei Dobrohotov 29ccb09da5 Introduce some extended NIF definitions 4 years ago
AnyOldName3 a338e8c561 Actually set the uvSet value
This got lost when uvSet was made into a local variable.
4 years ago
AnyOldName3 b2cb98d30e Fix NiFlipController
NiFlipControllers *always* affect the base texture, even if no base
texture is bound. When no base texture is bound, they default to UV set
zero and to having wrapped UV coordinates, instead of using the settings
for the disabled base texture.
4 years ago
Bret Curtis 05a19f4f93
Merge pull request #2984 from Capostrophic/optimizer
Avoid optimizing animated shapes once again (regression #5565)
4 years ago
Capostrophic aa131262ea Implement quadratic interpolation for scalars and vectors 4 years ago
Capostrophic 35de34c019 Don't clamp GeomMorpherController recovered weight value
Seems that Morrowind doesn't do it.
4 years ago
Capostrophic 8c213cbfb1 Avoid optimizing animated shapes once again (regression #5565) 4 years ago
Capostrophic 3d31d21bc2 Don't encapsulate NIF transformation changes
Currently that causes issues
4 years ago
Capostrophic 46825e8a4d Move NIF record index back to a separate user object
This makes sure it's never erroneously optimized out. NodeIndexHolders don't need to be cloned as their record index is never supposed to be changed.
4 years ago
Capostrophic f93655e803 Encapsulate NIF transform changes in NifOsg::MatrixTransform 4 years ago
Capostrophic ad87289d59 Fix NifOsg::MatrixTransform constructor inheritance 4 years ago
Capostrophic a61267f57d Replace NodeUserData with a custom transform node 4 years ago
Capostrophic 4c9cefefdd Get rid of NifOsg::CollisionSwitch 4 years ago
Bret Curtis 0c2fea8254
Merge pull request #2932 from elsid/replace_open_threads
Replace OpenThreads by std types
5 years ago
Frederic Chardon f268bc13f1 Do not set particle lifetime to 0 (#5472) 5 years ago
elsid 40ad87bc4d
Replace OpenThreads by std types 5 years ago
bzzt lost a hitlab login 26ab176389 profiling
Signed-off-by: Bret Curtis <psi29a@gmail.com>
5 years ago
bzzt lost a hitlab login f12879a04c allow statesetupdater as cullcallback = faster + works in paging
Signed-off-by: Bret Curtis <psi29a@gmail.com>
5 years ago
Capostrophic 7aca18f92b Handle NiLines (feature #5445) 5 years ago
Capostrophic 74a74209ac Allow junk (data-less) NiParticleColorModifiers 5 years ago
Capostrophic 7a9403aeed Remove unnecessary casts 5 years ago
Capostrophic fc9a10ba48 Streamline node controller handling
Reduce code duplication
Allow non-animated nodes controlled by NiVisController to be optimized out
5 years ago
Capostrophic 89a2c69a61 Support particle node transformations 5 years ago
elsid a59e25e093
Optimize MWRender::Animation::hasAnimation
Use a set to check for group start existence.
Reduce time taken from 2.6% to 0.08% and
MWMechanics::MechanicsManager::update from 7% to 5%
in relative CPU time usage for a scene with ~100 actors.
5 years ago
Capostrophic b665fed8f2 Introduce NiGeometry abstraction 5 years ago
Capostrophic 30558c2434 Try to resolve CI concerns 5 years ago
Capostrophic 915ffe2241 Handle non-node roots more gracefully (bug #5416) 5 years ago
Capostrophic 30fc2e3e5e Add basic NiPathController support (movement only) 5 years ago
Capostrophic b91d0d889f Fix warning
/home/travis/build/OpenMW/openmw/components/nifosg/nifloader.cpp:615:42: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
                    if (hasVisController |= (ctrl->recType == Nif::RC_NiVisController))
                        ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/travis/build/OpenMW/openmw/components/nifosg/nifloader.cpp:615:42: note: place parentheses around the assignment to silence this warning
                    if (hasVisController |= (ctrl->recType == Nif::RC_NiVisController))
                                         ^
                        (                                                             )
5 years ago
Capostrophic 1bf2ddac4d Cleanup
Move static variable declaration out of the loop
Remove redundant boolean argument from applyDrawableProperties()
Improve HeightCullCallback class formatting
5 years ago
Bret Curtis f51476a3c5
Merge pull request #2816 from Capostrophic/switchlod
CollisionSwitch and Switch/LOD node fixes
5 years ago
Bret Curtis bf6daa7269
Merge pull request #2811 from Capostrophic/emitter
Allow particle emitters to be attached to an arbitrary node
5 years ago
Capostrophic 63fe02b1ba CollisionSwitch and Switch/LOD node fixes
Properly apply transformations to both switch and LOD nodes
Allow both NiSwitchNode and NiLODNode to be the root node
Properly add CollisionSwitch into the scene graph
5 years ago
Capostrophic 89282d14aa Fix collision switch node mask (again) 5 years ago
Capostrophic f516178ec9 Fix particle processor cloning
Extend emitter handling comment in NIF loader
5 years ago
Capostrophic c08f9e13af Allow emitters to be attached to nodes after particle systems 5 years ago
Capostrophic 3b7fb9ec09 Use pipe-equal operator 5 years ago
Capostrophic bbd15cccd5 Fix hidden node with NiVisController optimization 5 years ago
Bret Curtis 68549828b4 create static functions to set/get hidden node mask; compromise on magic numbers to make things easier to understand 5 years ago
Bret Curtis e1a5435531 Merge commit '8a8107e8' 5 years ago
Chris Djali 71c46204ec
Merge pull request #2781 from mp3butcher/partsysfix
Particle System shading and lighting (fixing bug#3676 and #4949)
5 years ago
Julien Valentin 886fd5efc9 enable particle shading and force particle normal to (0.3,0.3,0.3)
and update changelog
5 years ago
Bret Curtis 8a8107e837 as it says; revert vismask and uncomplicate openmw 5 years ago
Capostrophic c3cc8ee1e1 Disable specular lighting for 4.0.0.2 and earlier files 5 years ago
Julien Valentin 6e2a651252 fix particle alpha 5 years ago
Capostrophic e1d635cd71 Make extra sure groups with special behavior aren't optimized out 5 years ago
Capostrophic 80239235d3 Always create NiGeometry nodes as MatrixTransform 5 years ago
Capostrophic 7319eda54e Correct drawable property apply order (bug #5313) 5 years ago
Capostrophic 2b3ecff004 Remove broken fixed function pipeline support
Added by mistake
5 years ago
Capostrophic 6999f1fd28 Add an option to apply lighting to environment maps 5 years ago
Capostrophic 19a7245251 Add bump mapping support 5 years ago
Andrei Kortunov 8c177f0306 Take in account transformations of NiCollisionSwitch 5 years ago
Bret Curtis c907cd98c8
Merge pull request #2704 from akortunov/collisionswitch
Handle NiCollisionSwitch node
5 years ago
Andrei Kortunov 77d6fe46ca Handle NiCollisionSwitch node 5 years ago
Andrei Kortunov 7b5ec76db4 Fix regression in the NiVisController 5 years ago
Andrei Kortunov 84979fa8b7 Move VisMask to components 5 years ago
Capostrophic e363d5df21 Some more minor NIF support fixes 5 years ago
Alexei Dobrohotov 234fdfefb7
Revert "Don't apply 1.6 magic value to NiGravity decay factor (#5266)" 5 years ago
Capostrophic dcafe719a5 Don't apply 1.6 magic value to NiGravity decay factor (#5266) 5 years ago
capostrophic 32caab663f Enumerate interpolation types properly 5 years ago
capostrophic e654a52b70 More NIF adjustments
Constant interpolation support
5 years ago
Andrei Kortunov c41562fa27 Make TextureProperty warnings more informative 5 years ago
Capostrophic 909c8ef0ea Avoid working with empty controller data (bug #5229) 5 years ago
Andrei Kortunov 5b5c52d92e Handle NiKeyframeController for NiTriShape (feature #5224) 5 years ago
Andrei Kortunov eec82f676a
Merge pull request #2602 from elsid/clang_tidy
Fix clang-tidy issues
5 years ago
Andrei Kortunov 1b98fe4395 Fix GCC9 warnings about implicit declarations 5 years ago
elsid 8d358eeb7d
Avoid virtual call in ParticleSystem ctor 5 years ago
Alexei Dobrohotov ef138e9afc
Merge pull request #2592 from akortunov/switchnode
Use transformations of NiSwitchNode
5 years ago
Andrei Kortunov af41e9acc1 Initialize variables to avoid undefined values 5 years ago
Andrei Kortunov 51cfd070c6 Use transformations of NiSwitchNode 5 years ago
Capostrophic 8056107c6e More minor NIF improvements 5 years ago
Capostrophic 83f61d1636 Support target color in NiMaterialColorController (bug #5159) 5 years ago
Capostrophic 8baddefdbd Refactor extra data and particle modifier handling
Objects no longer inherit from extra data class
"Controlled" harmful abstraction no longer exists
Introduced NiParticleModifier/NiParticleCollider abstractions
Extra data size reading moved into the base read() method
5 years ago
Capostrophic c0438a0c6b Avoid using getPtr on empty geometry data 5 years ago
Alexei Dobrohotov 64fde2d7c2
Fix crash when NiGeometry lacks NiGeometryData 5 years ago
capostrophic 9c7474f88c Implement NiPalette support (feature #4882) 5 years ago
capostrophic efa463af8f Fix non-tiling textures clamp mode (bug #5137) 5 years ago
Alexei Dobrohotov 3668473d6d
Fix comment 5 years ago
Alexei Dobrohotov eaedf34975
Fix ventriloquism 5 years ago
Alexei Dobrohotov 307e9ba666
Merge pull request #2413 from akortunov/weapon
Refactor weapon types behaviour
5 years ago
Andrei Kortunov f0cef772fa Refactor weapon types behaviour
1. Move weapon types behaviour from switches to the table (should allow
us to de-hardcode weapon types later)
2. Gereralize bones injection to actors skeletons (instead of using the
hardcoded xbase_anim_sh.nif)
5 years ago
capostrophic 9e93c9ecd2 Fix multiple-strip NiTriStrips loading 5 years ago
capostrophic 93f73fe87b Fix comparison 5 years ago
capostrophic 7fc3153f62 Reduce code duplication further 5 years ago
capostrophic 91efdf18a9 Reduce Bullet part code duplication 5 years ago
capostrophic ed154f0e2c Fix typo and replace failsave with an assert 5 years ago
capostrophic 7cc70ffb50 Reduce skinned shape code duplication 5 years ago
capostrophic bd6c455fd4 Reduce code duplication for non-skinned shapes 5 years ago
capostrophic b4f54651f8 Make sure strips have valid size 5 years ago
capostrophic adb06913f7 Add basic NiTriStrips rendering (no physics yet) 5 years ago
capostrophic 8efbdeaa57 Load NiTriStrips/NiTriStripsData (don't do anything yet) 5 years ago
capostrophic 6928adcee1 Prevent front() and operator[] from causing undefined behavior 5 years ago
AnyOldName3 bb72ed9744 Merge branch '9' into 'master'
IMPORTANT!! racingcrashfix #4766

See merge request OpenMW/openmw!119
6 years ago
Capostrophic e06178bf0f Make sure shadow shapes aren't visible (bug #5063) 6 years ago
Capostrophic 7c8360d0f3 Use NiSwitchNode initial index field 6 years ago
bzzt ffe8bbd2dd racingcrashfix #4766 6 years ago
Andrei Kortunov 861d41f4a4 Native graphics herbalism support (feature #5010) 6 years ago
Andrei Kortunov 7995a92672 Initialize missing variables 6 years ago
bzzt a567111400 Use emplace instead of find-assign 6 years ago
Bret Curtis d4564a9be7
Merge pull request #2180 from akortunov/includes
Remove redundant includes
6 years ago
Andrei Kortunov 3032b177a1 Remove redundant includes 6 years ago
Andrei Kortunov 60f112d11c Add support for NiRollController (feature #4675) 6 years ago
Chris Djali cb5a57e41b
Merge pull request #1547 from AnyOldName3/osgshadow-test-vdsm
Shadows
6 years ago
Andrei Kortunov 058e289162 Do not create a redundant parent node for LOD and Switch nodes (bug #4837) 6 years ago
Bret Curtis f4313c02e1
Merge pull request #2153 from akortunov/glowing_windows
Native glowing windows support
6 years ago
Andrei Kortunov 60c9806d62 Share RigGeometry node data 6 years ago
Andrei Kortunov 9e4a339ad3 Daytime node switch support (feature #4836) 6 years ago
Bret Curtis e748abde7d
Merge pull request #2147 from akortunov/uvcontroller
Apply UVControllers only for given UV Set
6 years ago
Andrei Kortunov 87598f9419 Fill Switch and LOD nodes names 6 years ago
Andrei Kortunov b2126c2b6b Apply UVControllers only for given UV Set (bug #4827) 6 years ago
AnyOldName3 8482236a82 Merge remote-tracking branch 'upstream/master' into osgshadow-test-vdsm 6 years ago
Andrei Kortunov 2c38e337ae Support NiSwitchNode (feature #4812) 6 years ago
Andrei Kortunov 39c4a7833c Fix out of range exception when try to load a particle node with empty sizes array (bug #4804) 6 years ago
Andrei Kortunov 8e6fd348d1 RigGeometry optimization: optimize geometry optimization 6 years ago
Andrei Kortunov 254f01b89d RigGeometry optimization: vector iteration is more cheap than map iteration 6 years ago
AnyOldName3 3785ba6aa0 Merge upstream/master 6 years ago
Andrei Kortunov 41e90bd56c Unify random generator usage 6 years ago
AnyOldName3 474770eca8 Switch shadow map rendering to a specialised, simplified shader. 6 years ago
Andrei Kortunov e06f0b797a Replace all NULLs to nullptr 6 years ago
Andrei Kortunov 87394f2ebb Revert "Take in account transformations of NiTriShape and NiSkinData in skinning (bug #4437)"
This reverts commit 09427d3f5e since the
fix is not entirely correct.
6 years ago
Andrei Kortunov 09427d3f5e Take in account transformations of NiTriShape and NiSkinData in skinning (bug #4437) 6 years ago
Andrei Kortunov 7e2bda459b Check if there are textures in FlipController to avoid division by zero (bug #4614) 6 years ago
Andrei Kortunov 1452684d9e Use new logging system for components 6 years ago
Andrei Kortunov 7d6e3673e0 Implement advanced logging system (feature #4581) 6 years ago
Capostrophic 85208eff7f Revert untextured shapes rendering changes 6 years ago
Capostrophic bda23c6ad6 Fix nodemask 6 years ago
Capostrophic a1e3b2e586 Don't render NiTriShapes without NiTexturingProperty (bug #4483) 6 years ago
Andrei Kortunov 469bb29621 Do not try to handle shape controllers as node controllers 7 years ago
Andrei Kortunov 7e0df01c83 Do not optimize animated shapes (bug #3950) 7 years ago
Andrei Kortunov 2fada94879 Improve MRK NiStringExtraData handling (bug #4419) 7 years ago
tri4ng1e d4d1703bcf
Some PVS-Studio and cppcheck fixes
cppcheck:
[apps/esmtool/record.cpp:697]: (performance) Prefer prefix ++/-- operators for non-primitive types.
[apps/esmtool/record.cpp:1126]: (performance) Prefer prefix ++/-- operators for non-primitive types.
[apps/esmtool/record.cpp:1138]: (performance) Prefer prefix ++/-- operators for non-primitive types.
[apps/niftest/niftest.cpp:36]: (performance) Function parameter 'filename' should be passed by reference.
[apps/niftest/niftest.cpp:41]: (performance) Function parameter 'filename' should be passed by reference.
[apps/opencs/model/prefs/boolsetting.cpp:25]: (warning) Possible leak in public function. The pointer 'mWidget' is not deallocated before it is allocated.
[apps/opencs/model/prefs/shortcuteventhandler.cpp:52]: (warning) Return value of std::remove() ignored. Elements remain in container.
[apps/openmw/mwstate/quicksavemanager.cpp:5]: (performance) Variable 'mSaveName' is assigned in constructor body. Consider performing initialization in initialization list.

PVS-Studio:
apps/opencs/model/filter/parser.cpp  582  warn  V560 A part of conditional expression is always true: allowPredefined.
apps/opencs/view/world/referencecreator.cpp  67  warn  V547 Expression '!errors.empty()' is always false.
apps/opencs/view/world/referencecreator.cpp  74  warn  V547 Expression '!errors.empty()' is always false.
apps/opencs/view/doc/loader.cpp  170  warn  V560 A part of conditional expression is always true: !completed.
apps/opencs/view/doc/loader.cpp  170  warn  V560 A part of conditional expression is always true: !error.empty().
apps/opencs/model/tools/pathgridcheck.cpp  32  err  V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 32, 34.
apps/opencs/model/world/refidadapterimp.cpp  1376  err  V547 Expression 'subColIndex < 3' is always true.

apps/openmw/mwgui/widgets.hpp  318  warn  V703 It is odd that the 'mEnableRepeat' field in derived class 'MWScrollBar' overwrites field in base class 'ScrollBar'. Check lines: widgets.hpp:318, MyGUI_ScrollBar.h:179.
apps/openmw/mwgui/widgets.hpp  319  warn  V703 It is odd that the 'mRepeatTriggerTime' field in derived class 'MWScrollBar' overwrites field in base class 'ScrollBar'. Check lines: widgets.hpp:319, MyGUI_ScrollBar.h:180.
apps/openmw/mwgui/widgets.hpp  320  warn  V703 It is odd that the 'mRepeatStepTime' field in derived class 'MWScrollBar' overwrites field in base class 'ScrollBar'. Check lines: widgets.hpp:320, MyGUI_ScrollBar.h:181
apps/openmw/mwmechanics/actors.cpp  1425  warn  V547 Expression '!detected' is always true.
apps/openmw/mwmechanics/character.cpp  2155  err  V547 Expression 'mode == 0' is always true.
apps/openmw/mwmechanics/character.cpp  1192  warn  V592 The expression was enclosed by parentheses twice: ((expression)). One pair of parentheses is unnecessary or misprint is present.
apps/openmw/mwmechanics/character.cpp  521  warn  V560 A part of conditional expression is always true: (idle == mIdleState).
apps/openmw/mwmechanics/pathfinding.cpp  317  err  V547 Expression 'mPath.size() >= 2' is always true.
apps/openmw/mwscript/interpretercontext.cpp  409  warn  V560 A part of conditional expression is always false: rank > 9.
apps/openmw/mwgui/windowbase.cpp  28  warn  V560 A part of conditional expression is always true: !visible.
apps/openmw/mwgui/journalwindow.cpp  561  warn  V547 Expression '!mAllQuests' is always false.
apps/openmw/mwgui/referenceinterface.cpp  18  warn  V571 Recurring check. The '!mPtr.isEmpty()' condition was already verified in line 16.
apps/openmw/mwworld/scene.cpp  463  warn  V547 Expression 'adjustPlayerPos' is always true.
apps/openmw/mwworld/worldimp.cpp  409  err  V766 An item with the same key '"sCompanionShare"' has already been added.
apps/openmw/mwworld/cellstore.cpp  691  warn  V519 The 'state.mWaterLevel' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 689, 691.
apps/openmw/mwworld/weather.cpp  1125  warn  V519 The 'mResult.mParticleEffect' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1123, 1125.
apps/openmw/mwworld/weather.cpp  1137  warn  V519 The 'mResult.mParticleEffect' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1135, 1137.

apps/wizard/unshield/unshieldworker.cpp  475  warn  V728 An excessive check can be simplified. The '(A && B) || (!A && !B)' expression is equivalent to the 'bool(A) == bool(B)' expression.
apps/wizard/installationpage.cpp  163  warn  V735 Possibly an incorrect HTML. The "</p" closing tag was encountered, while the "</span" tag was expected.

components/fontloader/fontloader.cpp  427  err  V547 Expression 'i == 1' is always true.
components/nifosg/nifloader.cpp  282  warn  V519 The 'created' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 278, 282.
components/esm/loadregn.cpp  119  err  V586 The 'clear' function is called twice for deallocation of the same resource. Check lines: 112, 119.
components/esm/cellref.cpp  178  warn  V581 The conditional expressions of the 'if' statements situated alongside each other are identical. Check lines: 175, 178.
components/esmterrain/storage.cpp  235  warn  V560 A part of conditional expression is always true: colStart == 0.
components/esmterrain/storage.cpp  237  warn  V560 A part of conditional expression is always true: rowStart == 0.
7 years ago
scrawl c920f95d1e
Don't incorrectly discard root node transformation (Fixes #4272) 7 years ago
scrawl 03554b2f4b Fix some style issues flagged by cppcheck 7 years ago
scrawl 5d524a6a10 Add custom version of MorphGeometry replacing osgAnimation
Double buffering, custom bounding box and the update in the cull visitor (instead of update) are now all handled internally rather than needing hacks and/or callbacks.
7 years ago
scrawl 209e139aa8 Move double buffering implementation inside RigGeometry
The double buffering is an implementation detail so it should be handled as such, rather than mandating the scene graph to be structured in a certain way.

Override accept(NodeVisitor&) instead of using callbacks.
7 years ago
scrawl 45f7563a55 Revert "Revert "Check for a Geometry node when attaching bodyparts""
Issue with shaders has been fixed with b9931fb71c

This reverts commit a1e3fb7604.
7 years ago
scrawl a1e3fb7604 Revert "Check for a Geometry node when attaching bodyparts"
This reverts commit 3fc8634206.
7 years ago
scrawl 3fc8634206 Check for a Geometry node when attaching bodyparts (Fixes #3957) 7 years ago
scrawl bc82c6a35d Use white color if told to use nonexisting vertexcolors (Fixes #3833) 7 years ago
scrawl 5d2fe5e887 Implement lightmode/vertmode of NiVertexColorProperty 7 years ago
scrawl 40dc1dd6f5 Fix checking a variable before it's assigned (Bug #3950) 8 years ago
Bret Curtis d785344fad purge all instances of <boost/shared_ptr.hpp>, clean up unused headers 8 years ago
Bret Curtis 07f75e1104 replace boost::shared_ptr in extern and components 8 years ago
scrawl 45d9e38616 Fix check for default material 8 years ago
Allofich ff3e307059 Pass parameters by const reference 8 years ago
scrawl 29556a1802 More consistent wording of errors/warnings
A Warning indicates a potential problem in the content file(s) that the user told OpenMW to load. E.g. this might cause an object to not display at all or as intended, however the rest of the game will run fine.

An Error, however, is more likely to be a bug with the engine itself - it means that basic assumptions have been violated and the engine might not run correctly anymore.

The above mostly applies to errors/warnings during game-play; startup issues are handled differently: when a file is completely invalid/corrupted to the point that the engine can not start, that might cause messages that are worded as Error due to the severity of the issue but are not necessarily the engine's fault.

Hopefully, being a little more consistent here will alleviate confusion among users as to when a log message should be reported and to whom.
8 years ago
scrawl 1402e0b872 Don't optimize billboard nodes (Fixes #3774) 8 years ago
scrawl 9b27ec4945 Remove redundant and ambiguous NiNode::makeBone()
Ambiguous because a skeleton can have multiple skinned meshes, with their own bone weights/bind matrix each.
8 years ago
scrawl aba3c471a9 nifloader: fix setting of dataVariance for non-controlled bones and refactor the code 8 years ago
scrawl 4e5a1e6123 nifloader: improve setting of DataVariance 8 years ago
scrawl 6e996bf2a3 Create TriShapes with an identity transform as a Group 8 years ago
scrawl 6e5d9efa93 Remove NifLoader::optimize, to be replaced with something better 8 years ago
scrawl c45013c983 Fix particle systems not being rendered in their first frame 8 years ago
scrawl aa8459b5c7 Revert "Remove redundant allocations for NIF meshes"
This reverts commit a7c5beb7c5.

Conflicts:
	components/nif/data.cpp
	components/nifbullet/bulletnifloader.cpp
	components/nifosg/nifloader.cpp
8 years ago
scrawl 6a37909ee7 Revert "Fix race conditions caused by Array <-> GLBufferObject interactions (Bug #3580)"
This reverts commit 115e563a7a.
8 years ago
scrawl 892d1b162d nifloader: ignore nodes named 'bounding box' (Fixes #3650) 8 years ago
scrawl 4d53ab6c32 nifloader: attempt to remove redundant root node when a Skeleton is added 8 years ago
scrawl 2a42c4781e nifloader: override animflags instead of accumulating them 8 years ago
scrawl 0187f2ce4c nifloader: combine animFlags and particleFlags (Bug #2100) 8 years ago
scrawl bccfd6cef8 nifloader: handle textures with no image that are later assigned in a FlipController
As found in vurt's trees (Bug #2100)
8 years ago
scrawl 33e654f94d Add explicit handling of most commonly used nodes to NodeVisitors to avoid excessive virtual function calls 8 years ago
scrawl f3045331f1 Fix regression in handling of NiZBufferProperty 8 years ago
scrawl 851f61ac82 Always assign osg::Material when a material controller is used 8 years ago
scrawl 9180089a3b Add sharing for more State Attributes, most notably BlendFunc and AlphaFunc, to improve the state tracking in osg::State and reduce the number of GL calls 8 years ago
scrawl 960d4a96c3 Reduce the number of osg::Material state by setting the default state on the graph root 8 years ago
scrawl e399e10607 Add missing lock in shareMaterial 8 years ago
scrawl 115e563a7a Fix race conditions caused by Array <-> GLBufferObject interactions (Bug #3580)
The first part of the fix is to assign VBO/EBO's upon loading the array in the Nif reader. This avoids triggering the 'addVertexBufferObjectIfRequired' code path in osg::Geometry which has the race condition when two threads add the same Array at the same time. Essentially, we want the Arrays to be 'const' when they come out of the Nif reader.

The second part of the fix is to make sure not to create empty arrays in the Nif reader (importantly, not assigning a VBO to the empty array). This empty array would be deleted when the NIFFile is cleaned up, and the detachment of the VBO assigned to it (which is still in use by other arrays) would cause threading issues.

This rare crash bug was first introduced with commit a7c5beb7c5. When using OSG dev version 3.5 the crashes were a little more prevalent, because 'addVertexBufferObjectIfRequired' in osg::Geometry is now used even when VBO's are disabled (as part of the VAO support changes).
8 years ago
scrawl aafff1deb6 Fix memory leak 8 years ago
MiroslavR 99bcf47167 Implement NiSphericalCollider (Closes #3644) 8 years ago
Allofich 6ec37b5cfb Fix shadowing warnings 8 years ago
scrawl cd4b182091 Merge pull request #1051 from Allofich/textures
Use spell effect particle textures
8 years ago
Allofich a8e9f2df67 Cleanup 8 years ago
Allofich be96ff1fd1 Remove redundant parameter 8 years ago
scrawl 8f5347b79b Update comment, osgAnimation::RigGeometry is no longer used 8 years ago
Allofich a033ba3bd2 Override spell textures by NiTexturingProperty 8 years ago
scrawl a5da3a269e Fix shadowing warnings 8 years ago
scrawl 341e3846c0 Use initial particle state to compute the initial bounding box (Fixes #3500) 8 years ago
scrawl 513e1da8a3 Remove unneeded casts 8 years ago
scrawl 33d27a2285 Use ref_ptr 8 years ago
MiroslavR 721fa28c1e Fix assertion failure with NiTextureEffect missing source texture 9 years ago
MiroslavR 9c6739f1b3 Fix doubled particle spawn range 9 years ago
MiroslavR 2a987b6857 Do not skip inactive keyframe controllers (Bug #1942) 9 years ago
scrawl 62018e802b Minor fix to particle system AutoPlay flag handling
The previous commit broke some magic effects (e.g. shield). The controller's emit start/stop times should control the emitter, while the absence of the ParticleSystem's autoplay flag should freeze the whole particle system if no valid controller source gets assigned. This revised version works for both the Shield effect and the "dagoth ur death sparkles" effect.
9 years ago
scrawl 7202072196 Freeze particle systems on construction if the AutoPlay flag is missing 9 years ago
scrawl 0c08f705c5 Make the ParticleSystemController freeze the particle system instead of the emitter (Bug #3390) 9 years ago
scrawl e30bb31a79 Handle the particle node's AutoPlay flag (Bug #3390) 9 years ago
scrawl bc36269617 When a controller is present more than once in the same keyframe file, pick the first one (Fixes #2719) 9 years ago
scrawl aae43dbff5 Set the MorphGeometry vertex buffer object usage to GL_DYNAMIC_DRAW 9 years ago
scrawl 84b8da7a09 Share the osg::Material on drawables
Reduces the number of GL calls / frame by ~4%.
9 years ago
scrawl abcfe9bcee Don't add empty text key objects 9 years ago
scrawl 02d23564dc Include cleanup 9 years ago
scrawl f898bf493f Don't use Geodes 9 years ago
scrawl 82b792f808 Eliminate dynamic_cast in BillboardCallback 9 years ago
scrawl dd2fbfc0a2 Fix windows build 9 years ago
scrawl 6e7c6fdd7e Implement NiTexturingProperty::DecalTexture 9 years ago
scrawl 30d06bfe0e Add comment 9 years ago
scrawl 64636bd85a Improve error reporting 9 years ago
scrawl cdccf03228 Fix mismatched delete 9 years ago
scrawl 5f4ace1bc2 Implement support for sphere map NiTextureEffects (Fixes #1827) 9 years ago
scrawl 90a99991d1 Use empty() instead of !size() 9 years ago
scrawl 8bd16e4d5a Don't compute the world matrix multiple times 9 years ago
scrawl 055d35a2b0 Revert "Warn about particle emitters that have multiple parent node paths"
Not working correctly because osg won't ignore camera nodes.

This reverts commit 1667c807be.
9 years ago
scrawl 1667c807be Warn about particle emitters that have multiple parent node paths 9 years ago
scrawl 8f81df2bd3 Cleanup 9 years ago
scrawl e647ee5424 Support RGB and RGBA embedded textures in NIF files (Fixes #2295) 9 years ago
scrawl 606758d72f NifLoader: create the BumpTexture slot, but don't use it yet 9 years ago
scrawl 4cd4131da9 NifLoader: assign a name to created textures
This name will tell the shader visitor how to handle that texture.
9 years ago
scrawl 50e92c8136 NifLoader: move texture property handling to a separate function 9 years ago
scrawl acf44fd9e5 NifLoader: handleTextureControllers outside of the NumTextures loop 9 years ago
scrawl 5824619a95 Clean up includes 9 years ago
scrawl 8b596dfcbe Remove support for OSG 3.2
Since commit e8662bea31, we're using OSG functionality that contains an unfixed crash bug in version 3.2. The bug is fixed in version 3.4 (OSG commit 6351e5020371b0b72b300088a5c6772f58379b84)
9 years ago
scrawl be6ea3d607 Account for UV coordinate flip in UVController (Fixes #3203) 9 years ago
scrawl 9f729667fb Remove debug output 9 years ago
scrawl 9e53e12c70 More renaming of TextureManager -> ImageManager 9 years ago
scrawl f99f403dda Rename TextureManager to ImageManager 9 years ago
scrawl 6ef848b7c5 Remove TextureManager::getTexture2D
Instead use getImage and let the caller create the Texture. Sharing of textures is then handled in post by the SharedStateManager.

This is closer to what the OSG serializer does.

Streamlines the TextureManager and will make it easier to multithread.
9 years ago
scrawl 5b972ee777 Move texture filtering settings to SceneManager
Practical benefits:

- Filter settings are now applied to native OSG format models. These models do not use TextureManager::getTexture2D since the model itself specifies a Texture.
- The GUI render manager will be able to use its own separate textures, making it easier to turn off filtering for them.
9 years ago
scrawl 2eda495f89 Build fix for OSG 3.2 9 years ago
scrawl 06ed20abf8 Use the initial pose of a MorphGeometry for object placement (Fixes #3136) 9 years ago
scrawl 6b48acaf0e Don't optimize TriShapes with controllers (Fixes #3143) 9 years ago
scrawl daa94cc50e Fix cppcheck warnings 9 years ago