Arthur Moore
8be6aefd95
Moved functions from niffile.cpp to where they belong.
...
Also cleaned up some #includes
Removed a few asserts. Vector already throws an out_of_range error.
2014-08-24 13:45:36 -04:00
Arthur Moore
cdfa24e15d
(Re) Wrote a tool to test NIF files in BSAs and on the filesystem.
...
Just give it a set of files, one file per argument, and it will make sure openmw can read them.
On linux/mac you can use "xargs --arg-file=nifs.txt ./niftest" to give it a list of files to check.
2014-08-24 12:09:39 -04:00
scrawl
2b407a9995
Refactor NIF cache
...
- Remove broken cache locking mechanism
This was supposed to unload NIFFiles after a cell transition completes, but it was never working due to a mistake on the line if (--sLockLevel), should have been if (--sLockLevel == 0). Repairing this would increase load times (NIF files would have to be reloaded more frequently), so just removed it for now.
- Decouple cache from NIFFile (now a new nifcache component)
- Add API for future background loading
- Provide a reliable way (SharedPtr) to hold on to loaded NIFFiles. This will be useful to avoid deep copies of keyframe and text key data, which is currently a performance bottleneck.
2014-08-24 02:37:50 +02:00
scrawl
30be59c029
Implement auto-adjusting of particle emit rate
...
This makes ashcloud.nif and blightcloud.nif work properly.
2014-06-24 03:07:10 +02:00
Marc Zinnschlag
c8c45d4923
Merge remote-tracking branch 'lgro/valgrind_fixes'
2014-06-15 10:57:01 +02:00
Lukasz Gromanowski
abeb1d4ab3
Valgrind: Added constructor for KeyListT class, and added initialziation of ver member field in NIFFile class.
...
Signed-off-by: Lukasz Gromanowski <lgromanowski@gmail.com>
2014-06-15 09:39:16 +02:00
scrawl
b158919c4b
Fix uninitialized variable use
2014-06-13 02:26:52 +02:00
scrawl
029e438c11
Don't check mInterpolationType each iteration
2014-06-11 23:57:39 +02:00
Arthur Moore
f9f278f645
Fixed a capitalization error.
...
Changed Interpolations to unsigned.
Also explained what's happening in the comments.
2014-06-06 07:00:04 -04:00
Arthur Moore
b90e4db871
Actually read in XYZ_ROTATION_KEY data instead of discarding it.
2014-06-06 01:26:28 -04:00
dreamer-dead
e772bb88da
Remove RTTI usage in NIF reader.
2014-06-05 20:22:20 +04:00
Arthur Moore
576c06d791
Fix Bug #1371
...
Not properly reading in the NIF file's QuaternionKeyList.
2014-06-01 18:01:44 -04:00
Arthur Moore
50a4d175da
Read NIF interpolation type 4 (XYZ_ROTATION_KEY)
...
Don't actually do anything with it yet, but without this the "MW Containers Animated" mod made containers inaccessible.
Partly implements Feature #1067
2014-05-28 03:42:26 -04:00
scrawl
45d2a00717
Fixes #1293 : Allow interpolation type 0 in case of 0 keys
2014-04-26 11:36:27 +02:00
Bret Curtis
ab224f93c9
remove our stdint.h version that uses boost and force usage of system stdint.h
2014-03-05 17:08:58 +01:00
scrawl
bbd15b185d
Skip inactive controllers. Fixes those bloody bone boots again.
2014-01-31 05:59:58 +01:00
scrawl
254eba350e
Not handling interpolation type should be an error, since it will fail reading the next record if it hasn't read the previous one completely.
2013-12-31 00:56:04 +01:00
scrawl
5931fdcbde
Implement NiBillboardNode. Flags not handled yet.
2013-12-26 20:53:52 +01:00
scrawl
9fcb4fad5c
Implement NiFlipController
2013-12-08 18:51:56 +01:00
scrawl
6b81fd78f1
Particle improvements: Handle LocalSpace flag. Attach particle systems to the base node, since they need to be relative to that when LocalSpace is enabled. Get the bone in emitters/affectors so that resulting particle positions are the same. TODO: Fix Controllers to affect particle systems.
2013-11-25 13:50:33 +01:00
Xethik
9f533dbbe4
Fixed "most vexing parse" issue.
2013-09-22 04:57:01 -04:00
Chris Robinson
fb0ee7f2fc
Improve constness of the Nif RecordPtr structs
2013-07-24 23:58:35 -07:00
Chris Robinson
4cedf0fbab
Avoid colliding with AvoidNodes
...
These are placed under the RootCollisionNode hierarchy, but the shapes they
hold aren't collided with. Their exact function is unknown, but seems to be
related to lava? Maybe damage avoidance info for the AI.
2013-04-28 11:12:55 -07:00
Chris Robinson
1051fa51a7
Recognize NiFlipController
2013-04-19 15:07:08 -07:00
Chris Robinson
36170c5374
Use flag enums instead of hard-coded hex values
2013-04-16 01:20:32 -07:00
Chris Robinson
bf8bc989fc
Recognize and partly handle NiBSParticleNode
2013-04-14 12:52:20 -07:00
Chris Robinson
d26ffe9de0
Move a method to the Node class
2013-04-10 23:19:47 -07:00
Chris Robinson
3970407772
Use actual classes for properties
2013-04-10 20:22:13 -07:00
Chris Robinson
6c6750342c
Specified particle size is actually the radius
2013-04-10 13:37:20 -07:00
Chris Robinson
23097ac9dc
Minor cleanup of NiMorphData
2013-04-08 09:47:03 -07:00
Chris Robinson
c6c67a1bb4
Read NiGravity fields
2013-04-07 18:15:23 -07:00
Chris Robinson
ebcb4c66c3
Properly read and use the NIF root record list
2013-04-06 10:17:09 -07:00
Chris Robinson
f764f243d2
Fix the particle quota
2013-04-06 06:44:34 -07:00
Chris Robinson
41ce5464c9
Recognize NiBSAnimationNode as a record type
...
And don't warn about animated nodes without textkeys
2013-04-06 05:00:19 -07:00
Chris Robinson
bf0ae3ae72
Read NiVisData info
2013-04-05 06:29:14 -07:00
Chris Robinson
ac10c5f05c
Even more particle information
2013-04-04 05:10:52 -07:00
Chris Robinson
2f6ae4a915
Read more particle information
2013-04-04 05:10:51 -07:00
Chris Robinson
ee0a20f9ce
Read some missing particle data from NIFs
2013-04-04 05:10:50 -07:00
scrawl
a9b56eedc3
Support NIF "glow maps", which are basically an emissive channel.
2013-04-03 18:51:40 +02:00
scrawl
5625d73d84
Bump texture support
2013-04-03 17:16:34 +02:00
Nathan Jeffords
d3c1f5e7b2
renamed low-level NIF related files and include guards to conform to naming convention
2013-03-02 10:46:12 -08:00
Nathan Jeffords
0ed2015319
refactored NIFFile parse to get better code/data seperation
2013-03-02 10:07:57 -08:00
Nathan Jeffords
6de6d9ff6e
Factored a NIFStream class out of the NIFFile class.
...
Split NIFFile into two parts, NIFFile which is cached and is a container
for a parsed NIF, and NIFStream which is a class specialized for parsing
NIFs. This required a semi-sweeping change to make all record classes
accept a NIFStream instead of a NIFFile as an agurment to their read
functions.
2013-03-02 09:56:41 -08:00
Chris Robinson
2786cc67f6
Fix loading empty NiTriShapeData records
2013-02-28 13:38:48 -08:00
Sergey Shambir
03ca7f6123
NIF: added NiStencilProperty record handling
...
NiStencilProperty appears in Better Clothes plugin. If it not handled,
some parts of NPCs bodies will be not rendered.
2013-02-27 23:45:09 +04:00
greye
82595e66b2
another missing header for #576
2013-02-21 22:47:18 +04:00
Chris Robinson
b23fcb260c
Use the record index for finding the NiTriShape instead of the name
2013-01-13 08:00:04 -08:00
Chris Robinson
660d73fd88
Store the NIF index in the Record object
2013-01-13 06:56:58 -08:00
scrawl
31e6d28b19
Close NIF file resource after loading it into memory
2013-01-12 06:37:43 +01:00
Nathan Jeffords
d5ebd6654d
cache loaded NIF files to eliminate reloads
...
Created a NIF file caching mechanism to prevent the system from
reloading a NIF during a startup and cell changes.
2013-01-10 21:47:02 -08:00
Nathan Jeffords
0989b44b41
spread some const around NIF loading
2013-01-10 21:32:47 -08:00
Marc Zinnschlag
d684b3ae11
fixed getString function in NIF loader
2012-11-22 10:35:03 +01:00
Marc Zinnschlag
dbcd4a8b5b
compatibility fix
2012-08-05 00:06:19 +02:00
Edmondo Tommasina
20deb97a09
nif_file.hpp: add stdint.h include to fix build
...
It fixes such compile errors as:
* error: ‘uint8_t’ does not name a type
* error: ‘uint16_t’ does not name a type
* error: ‘uint32_t’ does not name a type
2012-08-04 23:14:53 +02:00
Edmondo Tommasina
32b167ce2b
Revert "nif_file.hpp: include type definitions to fix build"
...
This reverts commit b0b3ebe123
.
2012-08-04 23:02:27 +02:00
Edmondo Tommasina
b0b3ebe123
nif_file.hpp: include type definitions to fix build
2012-08-03 22:42:59 +02:00
Chris Robinson
6047dc6a0c
Merge remote branch 'zini/master' into nif-cleanup
...
Conflicts:
apps/openmw/mwrender/animation.cpp
apps/openmw/mwrender/animation.hpp
apps/openmw/mwrender/creatureanimation.cpp
apps/openmw/mwrender/npcanimation.cpp
apps/openmw/mwrender/npcanimation.hpp
components/nifogre/ogre_nif_loader.hpp
2012-07-17 10:57:15 -07:00
guidoj
0549e949ba
Mostly removal of unnecessary #include's and a little clean up
2012-07-17 09:27:12 +02:00
Chris Robinson
63e40d6e92
Fix world transform calculation
2012-07-16 13:16:11 -07:00
Chris Robinson
b1f7fd9f7b
Pre-transform the mesh vertices when there's no skinning or skeleton
2012-07-15 17:00:27 -07:00
Chris Robinson
61f32eca77
Add methods to get a node's local and full transform as a 4x4 matrix
2012-07-15 15:23:49 -07:00
Chris Robinson
9caa264074
Merge remote branch 'zini/master' into nif-cleanup
2012-07-14 17:27:36 -07:00
scrawl
5345d4eeef
fix a warning
2012-07-14 18:45:03 +02:00
Chris Robinson
5a381006e5
Fix parsing of some key lists
...
It seems some still want you to read the interpolation type even when there's
no keys.
2012-07-14 09:20:09 -07:00
Chris Robinson
9436ca4b0c
Use vectors for ShapeData properties
2012-07-13 09:32:58 -07:00
Chris Robinson
ecdd4ee23f
Load NiMorphData and NiKeyframeData using proper key lists
2012-07-12 20:56:47 -07:00
Chris Robinson
386ac56bda
Remove the NIF loader and code to manually transform the vertices
...
This currently breaks just about everything. They should come back as it's all
reimplemented, though.
2012-07-12 20:12:18 -07:00
Chris Robinson
9995dff943
Use a key list for NiColorData
2012-07-12 14:33:50 -07:00
Chris Robinson
3f11b6b1ae
Cleanup a couple unneeded misc component references
2012-07-12 12:01:11 -07:00
Chris Robinson
86b37c6c11
Move the velocity out of the transformation object
2012-07-12 11:21:52 -07:00
Chris Robinson
b292665de9
Use key lists to store some NIF data types
2012-07-12 08:00:26 -07:00
Chris Robinson
b7b9f11333
Add generic classes to help deal with NIF keys
2012-07-12 06:47:38 -07:00
Chris Robinson
645b507ba0
Return a reference to the RecordPtr from operator[] for consistency
...
RecordListT is supposed to be a list of RecordPtrT objects.
2012-07-12 05:37:56 -07:00
Chris Robinson
7e8c146de6
Constify some RecordListT methods
2012-07-11 06:39:03 -07:00
Chris Robinson
8e324c90dc
Constify some RecordPtrT methods
2012-07-11 06:37:17 -07:00
Chris Robinson
395a7600fd
Initialize identify transform when declaring the identity object
2012-07-10 23:13:03 -07:00
Chris Robinson
dddf1b4ee5
Rename getMatrix->getMatrix3 and getVector->getVector3
2012-07-10 04:45:14 -07:00
Chris Robinson
d30f64650a
Make the read_* methods private and remove the generic load() methods
2012-07-10 04:21:47 -07:00
Chris Robinson
930459365b
Rename getShort->getUShort and getByte->getChar
2012-07-10 03:52:01 -07:00
Chris Robinson
95b804a104
Remove NIFFile::getArrayLen
2012-07-10 03:02:37 -07:00
Chris Robinson
ca37706b34
Use Ogre types for Matrix and Vector objects
2012-07-10 02:38:35 -07:00
Chris Robinson
10072f74b4
Remove NIFFile::getType
2012-07-10 00:27:13 -07:00
Chris Robinson
b3aa453f9a
Use Ogre data streams for loading NIFs
2012-07-09 22:02:12 -07:00
Chris Robinson
0143cacd2b
Avoid returning pointers from NIFFile
2012-07-09 21:35:36 -07:00
Chris Robinson
d3a31a24ce
Use proper strings and vectors instead of slice arrays for NIF files
...
Slice arrays use pre-allocated pointers whose memory is managed externally. This is
unnecessary and ultimately detrimental since it prevents any kind of data fixup
(e.g. little endian to big endian, p[adding handling), and it also makes it difficult
to use Ogre data streams.
2012-07-09 21:08:23 -07:00
Chris Robinson
d8d00123ea
Watch for empty children node refs when setting parents
2012-07-03 18:37:04 -07:00
Chris Robinson
832247bff2
Merge remote branch 'zini/master' into nif-cleanup
...
Conflicts:
components/nif/data.hpp
2012-07-03 15:29:18 -07:00
Marc Zinnschlag
c85aaafac2
more include cleanup (most removing Ogre.h)
2012-07-03 15:32:38 +02:00
Chris Robinson
291599c609
Store the parents of NIF's nodes
2012-07-02 22:49:44 -07:00
Chris Robinson
046e9686f9
Cleanup RecordPtrT
...
This moves the index resolution into a separate post method instead of always
checking when access. As a result, it reduces the size of it down to the size
of a pointer, as opposed to 2 pointers + 1 int. The appropriate methods are
added to the various node types to make sure they're resolved.
2012-07-02 21:41:21 -07:00
Roman Melnik
e6c55c144c
Fix tabulation/formatting
2012-03-23 22:15:45 +02:00
Roman Melnik
6d33ad248d
Fix memory leak in getIdentity method
...
Replace static pointer and new() operator with normal static variable
2012-03-23 22:08:02 +02:00
Roman Melnik
ebc49de851
Fix Bug #1 : "Meshes rendered with wrong orientation"
...
Discard the tranformation of the root NiNode when loading nif files
(set the 'identity' transformation instead).
After applying the fix test the following types of interiors:
- Dwemer ruins (the bug was common here before the fix)
- Ancestral tombs (the bug was common here before the fix)
- Daedric shrines
- Caves/grottos
- Dunmer strongholds
- Telvanni, imperial, redoran houses/towers/castles
Also checked exteriors (although it is hard to do without terrain
rendering)
2012-03-22 00:39:19 +02:00
Marc Zinnschlag
5b378e820d
warning level adjustments and some related fixes
2012-03-15 16:01:41 +01:00
Lukasz Gromanowski
8829d46bda
Clean up compilation warnings.
...
Clan up compilation warnings like "variable ... set but not used" introduced
in some older and recent commits.
Signed-off-by: Lukasz Gromanowski <lgromanowski@gmail.com>
2012-02-12 15:45:08 +01:00
Marc Zinnschlag
9b910dda94
clean up
2012-01-17 15:10:53 +01:00
Jason Hooks
0712bba49b
Changing a few things around with handleshapes
2012-01-12 16:03:07 -05:00
Jason Hooks
baa3f51886
Trying to fix errors
2011-12-28 14:48:28 -05:00
Jason Hooks
cef2f5e927
Trying to get code to conform with older c++
2011-12-27 19:19:45 -05:00
Jason Hooks
7bd911b401
Problems with handles
2011-11-24 23:13:34 -05:00
Jason Hooks
e8ec9093f8
More NIFLoader code
2011-11-23 18:18:51 -05:00
Marc Zinnschlag
8446619ac4
Merge branch 'components_namespaces' into next
...
Conflicts:
apps/openmw/mwrender/interior.cpp
components/bsa/bsa_archive.cpp
2011-06-19 20:22:29 +02:00
Lukasz Gromanowski
90985e849e
Mantis: #18 - Move components from global namespace into their own namespace.
...
Moving classes from components/misc into Misc namespace.
Note: Misc namespace introduced conflict with ESM::Misc and MWClass::Misc
classes, so both of them are renamed to ESM::Miscellaneous
and MWClass::Miscellaneous.
Signed-off-by: Lukasz Gromanowski <lgromanowski@gmail.com>
2011-06-19 18:14:03 +02:00
Marc Zinnschlag
0f2df4e2b8
more cleanup
2011-06-15 22:33:31 +02:00
Jason Hooks
d035441876
Reintroducing animation
2011-04-11 20:56:06 -04:00
Jan-Peter Nilsson
a94de76801
Whitespace changes only tabs->spaces and removal of traling space (including mangle and openengline)
2011-04-03 13:20:42 +02:00
gugus
a8ade56c80
Add a bullet Shape Loader
2011-01-13 17:51:50 +01:00
Nicolay Korslund
0eae9d1504
Removed -Werror again
2010-09-10 19:34:38 +02:00
Nicolay Korslund
e30306f7c3
Removed redundant custom exception class
2010-09-02 22:30:39 +02:00
athile
59a2e8dcf7
Merge upstream
2010-06-28 12:44:55 -07:00
athile
819c146ad1
Project clean-up: move 'misc' into the platform lib, update CMake to build 'platform' as a lib, and various fixes for Visual Studio compiler warnings
2010-06-27 18:05:01 -07:00
Marc Zinnschlag
e4f85cb3e6
directory structure reorganisation (still missing the mangle stuff)
2010-06-25 22:28:59 +02:00