Commit Graph

516 Commits (master)

Author SHA1 Message Date
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 1dd0b4338e Bugfix: IrrlichtDevice::isWindowMinimized no longer returns true when it's maximized on Windows.
SW_SHOWMINIMIZED isn't a bitflag as was probably assumed.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5827 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-07-03 13:53:13 +00:00
cutealien c89676d042 Ignore degenerated faces in obj file loader when they would generate triangles where 2 vertices use identical indices.
This mostly happens because we merge vertices by position in the meshloader. But such triangles tend to cause troubles and won't render, so kick them out.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5826 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-06-24 10:13:09 +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 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 c87c63f31e Add IMemoryReadFile interface which allows direct access to memory block used as file.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5799 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-03-30 13:51:44 +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 5a9423648c Bugfix: OpenGL prevented completely removing a texture when it was used in the actively set material.
Basically the destructor tried to call a function to drop() itself, but that certainly prevented the constructor from being called in the first place as there still was a reference.
No need to backport to 1.8, this was caused by some rewrites in Irrlicht 1.9 back when TextureCache for active materials got added to the driver.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5777 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-02-27 13:13:35 +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 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 c310a8d6ae Bugfix: CCameraSceneNode resets the IsOrthogonal flag to false now when it recalculates a projection matrix.
Note: It would likely be nicer if it wouldn't switch back to a projection matrix at all but stay with ortho-matrix. But until I get to that - this will at least return the correct flag.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5767 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-02-21 14:37:03 +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 fc2e1bcfd7 Remove code to read boundingbox element in Collada reader as it's not in Collada specification.
We also did just read that box and then dropped the info immediately, so it wasn't used anyway. Not sure what that code was about, I hope it was just accidental and not about support for some strange Collada files in the wild.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5759 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-02-11 22:02:21 +00:00
cutealien abee25857f .dae/Collade reader now converts from Collada's right-handed to Irrlicht's left handed coordinate system.
It already worked correct when Z_UP was set (we switched x/z in that case which also flips coordinate system)
But for the default (Y_UP) it had been wrong before (that one is still right-handed in Collada).
We do now convert all z to -z (so z coordinates do change, but it prevents objects from showing up mirrored).
Note: For readLookAtNode I also added code to regard Z_UP, but have no test-case yet.
Note: I have no test-case for readSkewNode, so not sure about that one.
Note: No fix for readBboxNode as I'm going to kick that out next.
I tested with Blender (which has no textures) and Collada (which needs manual adaptions in .dae files as Irrlicht can't read libraries order independent, but that's another problem).


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5758 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-02-11 21:54:31 +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 39bf558a78 Fix .dae/Collada writer to export a right-handed coordinate system as expected by Collada.
Note: Right now our Collada loader can no longer load the files we write correctly as it also has to be fixed.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5709 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-30 15:16:36 +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 4edf23c775 Add serialization for ToolTip to IGUIElement. Thanks @chronologicaldot for fix.
Forum: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=2&t=52374


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5642 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-09-12 09:47:38 +00:00
cutealien 10a3f02aa6 Try recovering lost device in D3D9 for 3 seconds when device reset fails after resizing Window.
The device becomes useless if we don't recover it, so it's worth giving it a few more shots at that point as it might take a while until it can be recovered. The 3 seconds are just a number which seems to make some sense, could be it would be worth waiting even longer?

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5640 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-09-04 14:20:34 +00:00
cutealien b44b6891a6 Add typedefs like value_type and size_type to array, list and map like std containers have.
Thanks @SLC for idea (http://irrlicht.sourceforge.net/forum/viewtopic.php?f=1&t=52363)


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5639 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-08-23 09:52:13 +00:00
cutealien 09767f2541 Merge branch releases/1.8 revisions 5529-5631 into trunk:
- Add comment to Makefile about MinGW compilation
- Fix serialization of OverrideTextColorEnabled flag in CGUITab

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5632 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-07-24 20:11:37 +00:00
cutealien 438fb2a0ac Remove unused enum E_LOST_RESOURCE
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5630 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-07-19 20:25:34 +00:00
cutealien 2246895ae1 CGUIComboBox uses now EGDS_SCROLLBAR_SIZE instead of EGDS_WINDOW_BUTTON_WIDTH for the width of the listbox button to allow changing that without changing window topbar height.
It also changes now directly when the value is changed in the skin.
Thanks @LunaRebirth for reporting. 
Forum-link: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=1&t=52297&p=303682#p303682


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5620 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-06-17 19:31:14 +00:00
cutealien 9d315a9354 CGUIListbox, CGUITreeView and CGUITable now resize scrollbars when EGDS_SCROLLBAR_SIZE in the skin changes without having to re-create the elements.
This also fixes the problem that drawing looked wrong when this value got changed after the elements were created.
Thanks @LunaRebirth for reporting. (Forum: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=1&t=52297&p=303682#p303682)

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5619 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-06-16 22:27:08 +00:00
cutealien a7a90ff191 Add IVideoDriver::swapMaterialRenderers to allow swapping the renderer used to render a certain material.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5613 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-05-17 15:04:43 +00:00
cutealien 144123beab IMeshManipulator functions createMeshWith1TCoords, createMeshWith2TCoords and createMeshWithTangents no longer weld vertices while converting meshes. Use IMeshManipulator::createMeshWelded if you need that welding.
Main reason is that this wasn't exactly the expected or documented behavior.
While this welding was faster than calling createMeshWelded, we can still optimize createMeshWelded.
And it slowed down mesh-conversion in all cases where welding was not needed (for example some loaders already do that). 
It also increased memory consumption because the welding did allocate more memory for vertices than meshes needed (it allocated 1 vertex per index).


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5611 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-05-16 21:12:54 +00:00
cutealien a8b9071f96 Add ITerrainSceneNode::setFixedBorderLOD to handle connecting terrain nodes without gaps. Thanks @diho for the bugreport, testcase and a patch proposal.
Forum: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=9&t=51220


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5610 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-05-14 21:03:11 +00:00
cutealien 1d99bd8ff2 PLY loader now works with files which use "st" instead of "uv" for texture coordinates. Thanks @JLouisB for patch.
This fixes loading from files generated by Blender or Assimp. 
Forum: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=9&t=52261


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5609 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-05-12 15:31:01 +00:00
cutealien fb39389bb8 STL writer does now also write binary files when EMWF_WRITE_BINARY flag is used. Based on patch from JLouisB. (Forum: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=9&t=52261)
(EMWF_WRITE_COMPRESSED also still works for downward compatibility)

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5608 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-05-12 15:24:33 +00:00
cutealien 2757651d10 Improved PLY exporter. Thanks for Patch from JLouisB.
Forum discussion: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=9&t=52261
- Support for UV and vertex colors.
- Support for binary PLY files export with the EMWF_WRITE_BINARY flag
- Fix for the meshes with 32 bits index


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5607 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-05-12 14:36:10 +00:00
cutealien f02f226712 Fix wrong colors on big endian platforms with burnings renders. Thx @kas1e for reporting and @curaga for the patch (#318).
Note: this patch just removes some old #ifdef __BIG_ENDIAN__ code, so it's slightly suspicious. But it does fix the
wrong color problems on big-endian platforms. 
See http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=52177 for the discusssion.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5602 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-02-18 16:03:52 +00:00
cutealien 803250affc Fix bug #440 where OpenGL driver enabled second texture for single-texture materials when setMaterial was called twice. Thx@ "number Zero" for bugreport and test-case.
This problem was introduced in Irrlicht 1.7. The cause was that material renders can change chache-values which were then not reflected in the internal LastMaterial of the OpenGL driver.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5595 dfc29bdd-3216-0410-991c-e03cc46cb475
2017-12-31 20:24:55 +00:00
cutealien 12cab21629 Irrlicht icon now loaded with LR_DEFAULTSIZE to better support larger icon requests. Thx@ luthyr for report and bugfix.
Forum-thread: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=51422&p=298400#p298400


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5594 dfc29bdd-3216-0410-991c-e03cc46cb475
2017-12-20 21:28:56 +00:00
cutealien cd876e4fe7 Cursor on X11 behaves now like on Win32 and doesn't try to clip positions to the window.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5593 dfc29bdd-3216-0410-991c-e03cc46cb475
2017-12-19 23:00:31 +00:00
cutealien c4247febe5 IImage::copyToWithAlpha has a new parameter to allow combining alpha value instead of replacing them.
This uses new blitters called BLITTER_TEXTURE_COMBINE_ALPHA. 
Thx @chronologicaldot for providing this patch and @burningreggae for his feedback.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5590 dfc29bdd-3216-0410-991c-e03cc46cb475
2017-12-06 20:54:57 +00:00
cutealien e6cf90d594 The new EGET_ELEMENT_REMOVED event got... removed.
Sorry, it had sounded like a good idea when I coded it, but the original reason for asdding it (allowing the gui-enviornment to notice when elements are removed) never worked out anyway. And now I learned about other problems this can cause. Just too risky to use the event-system for this, have to find another solution some day.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5581 dfc29bdd-3216-0410-991c-e03cc46cb475
2017-11-17 15:16:43 +00:00
cutealien 9c0cd04730 Add _IRR_COMPILE_WITH_PARTICLES_ to control compilation of particle system
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5566 dfc29bdd-3216-0410-991c-e03cc46cb475
2017-11-06 14:18:17 +00:00
cutealien a03af926e9 Add IGUIImage::setDrawBackground to allow disabling background drawing even when no texture is set.
I considered also adding more flags to allow background drawing when a texture is set, but couldn't 
really find a good use-case for that, so keeping it simple (also that case could be done 
otherwise with a second element and disabling background drawing for top-element completely).


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5563 dfc29bdd-3216-0410-991c-e03cc46cb475
2017-11-03 22:34:46 +00:00
cutealien a4c3a251f1 Revert the part of last check-in where I tried to remove focus when EGET_ELEMENT_REMOVED was called on a focused element.
Found a crash for that. Might give it another try some day, but giving up for now.
EGET_ELEMENT_REMOVED can stay - still should be useful (users can find out when elements got removed).


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5560 dfc29bdd-3216-0410-991c-e03cc46cb475
2017-11-01 21:13:14 +00:00
cutealien e2ca877234 Add gui event EGET_ELEMENT_REMOVED. Remove active focus now from elements which got removed from the gui graph.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5559 dfc29bdd-3216-0410-991c-e03cc46cb475
2017-11-01 20:57:10 +00:00
cutealien bb74f9034a Fix: IGUIContextMenu now raises sub-menu when they would otherwise be displayed below bottom-border of root gui element.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5558 dfc29bdd-3216-0410-991c-e03cc46cb475
2017-11-01 15:21:48 +00:00
cutealien a2e51ecf80 Reduce log-messages for "loaded texture" and "loaded mesh" from ELL_INFORMATION to ELL_DEBUG.
In larger projects those tend to spam the default log too much.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5547 dfc29bdd-3216-0410-991c-e03cc46cb475
2017-10-21 19:28:05 +00:00
cutealien 92799fded9 Add IGUIButton::setOverrideColor to allow overriding text-color (same function as statictexts and editboxes have).
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5546 dfc29bdd-3216-0410-991c-e03cc46cb475
2017-10-21 14:56:19 +00:00