Commit Graph

1227 Commits (master)

Author SHA1 Message Date
cutealien 0096ba7c7d Fix compilation with SDL device enabled and Windows device disabled.
Thanks @kas1e for reporting (http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=52083&p=304892#p304892)
Also did change some indention for readability.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5861 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-08-30 15:16:17 +00:00
cutealien ea7efdde45 Fix comment.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5860 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-08-29 22:31:48 +00:00
cutealien 3c31fb4730 Allow to override MaterialType in SOverrideMaterial.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5859 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-08-26 14:42:44 +00:00
cutealien 004d250e8f Adding a few const's and relaxing the Irrlicht.ruleset.
No more checking for all the VS specific annotation stuff in code analysis (we don't use this anyway).
Also less const checks (arguably make code nicer, but not really helping finding suspcious code places, just lots of noise).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5857 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-08-21 17:37:28 +00:00
cutealien eb02bd0c56 Code cleanup.
Mainly making a few variables const and declaring variables at each place where they are used instead of once at top.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5856 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-08-17 20:19:00 +00:00
cutealien ede858d56f Make S3DVertex::getType a static instead of const function. Same for other vertex classes.
Hopefully this makes it more obvious that we're not dealing with a virtual function here (like all the other getType() functions in Irrlicht).
Should maybe be renamed (classType or classTypeId?).
Also vertexbuffers can now use it without having to create an object first.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5855 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-08-17 18:09:07 +00:00
cutealien 32585c5ed0 Cleanup: Make some variables const.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5854 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-08-17 17:52:32 +00:00
cutealien 5ff51c947e Cleanup: Avoid using identical variable names in outer and inner scopes.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5853 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-08-17 16:30:41 +00:00
cutealien b5f139f8a7 Use _IRR_OVERRIDE_throughout.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5850 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-08-17 14:00:50 +00:00
cutealien c5286d77ac Fix signed/unsigned conversion warnings.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5848 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-08-17 09:55:07 +00:00
cutealien f78e7b17f8 Avoid using identical variable name in inner and outer scope in SOverrideMaterial
Wasn't a bug in this case, but I just got lucky.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5847 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-08-16 13:02:10 +00:00
cutealien 1b4444e044 Remove E_GPU_SHADING_LANGUAGE in IGPUProgrammingServices.
Thx @greenya for noticing this is no longer needed as it was only ever used for the CG shader language which we kicked out already.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5846 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-08-15 20:43:50 +00:00
cutealien 8a33852395 SOverrideMaterial can now override layers, textures and the layer-flags can now be for more than just first layer.
Just completing SOverrideMaterial somewhat (some values still can't be set as they have no flags...).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5844 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-08-15 16:27:17 +00:00
cutealien fd155bead0 Add operator[] to vector2d and vector3d
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5841 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-07-23 15:30:50 +00:00
cutealien 56a037ff14 Fix wrong index used in CMatrix4<T>::transformVec4
Thx @Thomas Alten for reporting.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5831 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-07-04 20:13:49 +00:00
cutealien 29b2fa974e Documenation fixes. Thx @ greenya.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5825 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-06-23 15:47:34 +00:00
cutealien 7d92f4c514 Set old values as default values in IGUIElement::deserializeAttributes.
Thx @ chronologicaldot for reporting that this was missing (http://irrlicht.sourceforge.net/forum/viewtopic.php?f=2&t=52370)


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5824 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-06-15 09:59:35 +00:00
cutealien cb1d2f7706 Fix typos. Thanks @ greenya
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5822 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-06-06 13:39:58 +00:00
cutealien 949a1de2f2 Make aabbox3d::isValid const
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5821 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-05-31 13:33:41 +00:00
cutealien 5c10d53a20 Add aabbox3d::isValid() function to check if MaxEdge > MinEdge
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5820 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-05-31 13:31:40 +00:00
cutealien 294da48122 Add CMatrix4::transformVec4 to transform vectors with 4 elements
Thx @devsh for noting this was missing.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5819 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-05-31 13:05:59 +00:00
cutealien 1a6d8e2913 Replace polygon offsetting in SMaterial with a new implementation.
Deprecate PolygonOffsetFactor and PolygonOffsetDirection in SMaterial.
Replace it by PolygonOffsetDepthBias and PolygonOffsetSlopeScale.
Old values still work for now (as well as they did), but will be removed after Irrlicht 1.9.
The old implementation was based a lot on the way Direct3D8 had worked.
- We only had values -1 and 1 for the slope bias before, but sometimes other values are necessary.
- An int value for PolygonOffsetFactor couldn't worked for Direct3D9 which (unlike D3D8) uses a value range of -1 to 1. 
Thx @ Criss and devsh for implementing some code which showed that different slope scaling is sometimes needed.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5817 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-05-29 19:48:08 +00:00
cutealien b3a156b1bb Add ITexture::getOriginalColorFormat to access color format of images used to create a texture.
We already had the variable, just no access function.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5809 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-04-30 15:59:41 +00:00
cutealien 040aa5043a Add compileflags to allow removing specific scene-nodes from the engine.
Following flags got added: 
_IRR_COMPILE_WITH_OCTREE_SCENENODE_
_IRR_COMPILE_WITH_TERRAIN_SCENENODE_
_IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_
_IRR_COMPILE_WITH_BILLBOARD_SCENENODE_
_IRR_COMPILE_WITH_WATER_SURFACE_SCENENODE_
_IRR_COMPILE_WITH_SKYDOME_SCENENODE_
_IRR_COMPILE_WITH_CUBE_SCENENODE_
_IRR_COMPILE_WITH_SPHERE_SCENENODE_
Also the corresponding _NO_IRR_COMPILE_WITH... flags certainly.
More such flags might be added in future, but will test first if it really makes a difference for WebGL apps which were the main reason to add this.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5805 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-04-23 20:05:09 +00:00
cutealien 6b7b5204d1 Sorry, forgot to add new header IMemoryReadFile.h in last check-in.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5800 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-03-30 13:58:38 +00:00
cutealien 0408c9eb52 Add IReadFile::getType() interface to all users to find out what kind of class implements that interface.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5798 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-03-30 13:38:19 +00:00
cutealien 39e5fdc3e7 Merge branch releases/1.8 revisions r5633 through r5796 into trunk.
- Fix for SViewFrustum::clipLine


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5797 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-03-29 17:39:29 +00:00
cutealien 917379f453 Collada loader now handles texture-names with escape characters.
Names like "my%20texture.png" will now load "my texture.png". Collada filenames are in xs:anyURI format.
xs:anyURI is used in more places, but we don't support any other file-loading inside Collada so far, so that was the most important place to fix.
Also added/fixed a few comments.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5793 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-03-25 22:32:32 +00:00
cutealien 31652f6577 Add function string::insert.
(more overloads for it can be added later).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5788 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-03-15 13:03:03 +00:00
cutealien ed6d0d58fc IContextManager::activateContext can now also be used to reset the context.
The reset was prevented before, likely to make the use in beginScene easier. But it's necessary for using an OGL context from another thread.
Only implemented for WGL so far, GLX implementation will follow soon.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5784 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-03-14 16:18:03 +00:00
cutealien 0026ec7cdc Fix SViewFrustum::setFrom once more. SViewFrustum constructor with matrix also adapted.
Last change (in r5766) fixed GL and messed up D3D. This needs to use a parameter to tell what the matrix does.
Thx @DevSH for reporting.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5776 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-02-25 15:50:08 +00:00
cutealien db89bbc2ce Fixing SViewFrustum::recalculateBoundingBox once more.
Sorry, missed some points in last fix.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5775 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-02-25 14:44:36 +00:00
cutealien d1bddcc1a2 Fixing SViewFrustum::recalculateBoundingBox and CMatrix4::transformPlane.
SViewFrustum::recalculateBoundingBox no longer includes camera position in the bounding-box. Only using frustum corners now. Thx @DevSH for bugreport & patch.
CMatrix4::transformPlane was calculating the wrong plane-normal before. It added the matrix translation and also didn't normalize the normal.
planeMatrix tests had been checking for wrong results (did check calculations by hand now, so hopefully I got it right, anyone double-checking it for me would certainly be cool...)


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5773 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-02-22 18:03:34 +00:00
cutealien 0a2ee246c3 Fix error in calculation in new opengl versions of matrix4::buildProjectionMatrixPerspective functions.
Sorry, forgot some brackets around addition earlier on :-(

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5771 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-02-21 17:36:42 +00:00
cutealien 45be145f9a Add a flag to buildProjectionMatrixPerspective functions to allow creating OpenGL style matrices.
Can now have target range of -w to w instead of only 0 to w.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5769 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-02-21 16:39:51 +00:00
cutealien 49b2e6fee1 buildProjectionMatrixOrthoLH and buildProjectionMatrixOrthoRH have a new parameter to allow creating OGL style matrices.
Old projection matrices always projected z from 0 to 1. For OpenGL we want a -1 to 1 target instead.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5768 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-02-21 15:42:43 +00:00
cutealien 3283b96087 Fix SViewFrustum::setFrom for OGL projection matrices.
SViewFrustum::setFrom now sets the correct near clipping plane when the projection matrix doesn't use a target depth range of 0 to z, but for example -z to z.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5766 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-02-20 18:55:37 +00:00
cutealien 93c597a72d Remove the #undef's for standard functions.
isdigit, isspace and isupper had #undef's before them. But our own replacement implementations are in a namespace, so there shouldn't be any conflicts. And if there are compile conflicts they should show that the wrong implementation is used, so we would want to see them.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5728 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-02-02 16:52:29 +00:00
cutealien b5c99752aa Fix compiling on MinGW/gcc.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5727 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-02-02 16:25:20 +00:00
cutealien 47cebab98f Add IColladaMeshWriter::setUnit to allow exporting a unit-to-meter-ratio and name.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5723 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-02-01 15:52:29 +00:00
cutealien 9f7be6e42d Fix compile warning.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5720 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-31 19:40:58 +00:00
cutealien 9a04806c45 Add irr::string::eraseTrailingFloatZeros to kick out trailing 0's for strings generated from floats.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5719 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-31 19:02:14 +00:00
cutealien 8a5b18ac23 Spelling fix.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5701 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-29 15:35:08 +00:00
cutealien 43f75cbd9f Add function IColladaMeshWriter::SetParamNamesUV.
A workaround for broken Collada importers which insist on specific names. 
Seems SketchUp insists on UV's being called "S" "T" or it won't show textures.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5695 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-28 16:05:39 +00:00
cutealien 2f127c2773 Switch Collada writer to utf8 xml's.
Reasons are that it's more typical to use utf8 for xml's and that it allows SketchUp (which doesn't support xml's with wide-chars) can import our Colladas now.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5693 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-25 20:57:39 +00:00
cutealien 391dd912bd Add IXMLWriterUTF8 to allow writing utf8/ansi XML's.
utf8 is usually the default for XML anyway.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5692 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-25 19:35:53 +00:00
cutealien f6da59daf3 IColladaMeshWriter::writeScene got an additional flag to decide if root should be written.
Default stays as it was - a roots is written when it's not the SceneManager root.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5691 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-24 15:39:45 +00:00
cutealien 957d34ff0e Switch Irrlicht to 8 textures per Material as default by increasing value of _IRR_MATERIAL_MAX_TEXTURES_.
Reason is that 4 haven't been enough anymore for even pretty common graphic pipelines for a while now. 
8 might still not be enough, but let's see first if people are happy with it.

This has some costs for people not needing more textures, as we have fatter Materials now. 
- Memory usage increases by 64 bytes per SMaterial.
- Serialization files for the irr-format are now larger. 
- Slight speed cost, thought mainly in debug

For people who don't need this and want to avoid some of the costs there is a new variable irr::video::MATERIAL_MAX_TEXTURES_USED which can be set to the maximal number of textures a project will need
before creating any device. This avoids pretty much all speed-costs involved with this change.

Software drivers are not much affected as they use their own texture-limits (2).

I did a few speed-comparison with varying numbers of _IRR_MATERIAL_MAX_TEXTURES_. The numbers displayed are FPS, so higher is better. I had 2 tests - one which forced many material changes and the other used a single material for all nodes. When there are 2 numbers in a result then I got different (generally lower) FPS when forcing material changes. The test used a simple model with 500 polygons and rendered it 4500 times.
OLD means - before working on all changes related to increasing texture-numbers and without changing materials (found a bunch of places to decrease the impact of this change which also sometimes did speed up Irrlicht generally). 1.8 refers to Irrlicht 1.8 with same test. All tests done on Windows/VisualStudio.

Max.textures    4       8       16      64      64 MATERIAL_MAX_TEXTURES_USED=4
GL/debug        50/68   44/58   35/45
GL/release      117     117     117     80/100  117	
D3D9/debug	51/56	45/49	37/39				
D3D9/release    168     168     152/168 90/87   168
OLD GL/debug    63
OLD GL/release  117
OLD D3D9/debug  44
OLD D3D9/rel    168
1.8 GL/debug    23/29
1.8 GL/release  94/117
1.8 D3D9/debug  59/63
1.8 D3D9/rel    142/152

Take all results with a grain of salt, it probably often is limited by fill-rate and doesn't even notice the texture-number changes (especially in release). 

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5682 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-17 15:34:57 +00:00
cutealien abd0fa9dec Fix several problems with SMaterial serialization.
SMaterial.ZWriteFineControl only using 1 bit now.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5679 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-17 14:19:18 +00:00
cutealien f34b03f4bd Add MATERIAL_MAX_TEXTURES_USED to allow setting a limit of used textures in materials.
CD3D9Driver::setTransform limits no longer to MATERIAL_MAX_TEXTURES, but to MaxTextureUnits.
COpenGLCoreFeature::TextureUnit renamed to COpenGLCoreFeature::MaxTextureUnits (same as Direc3D names it and slightly better description)
Limiting used texture numbers with MATERIAL_MAX_TEXTURES_USED is currently not making a big speed difference. But it has a more noticable effect when we increase _IRR_MATERIAL_MAX_TEXTURES_ soon. It allows software which doesn't need more textures to mostly keep old speed.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5678 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-16 21:18:43 +00:00