Commit Graph

228 Commits

Author SHA1 Message Date
cutealien
57bcc52ca1 Add IVertexBuffer::setValue. Add comments.
Same as in IIndexBuffer. Needed as replacement for non const operator[] which can't be done for this interface (as type is dynamic).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6344 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-20 10:38:26 +00:00
cutealien
dd36699ad2 Set default for MeshLoader IndexTypeHint to EITH_OPTIMAL.
Did some tests and the overhead speed cost on loading and rendering where both not really measurable even in a pretty huge scene.
While some Irrlicht parts might still have a problem with 32-bit meshes (octree for example, also some meshmanipulator functions), it's probably still less of a problem than having broken meshes and just a nicer default. Also the troubling parts in Irrlicht can be improved over time.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6343 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-19 21:44:50 +00:00
cutealien
3ce2f0c0dd stl meshloader can now load 32 bit buffers (with corresponding hint)
Thanks @Foaly for the patch (https://irrlicht.sourceforge.io/forum/viewtopic.php?f=9&t=51441)
Applied with some minor changes.
Also mesh-type in that loader now set to EAMT_STATIC (was EAMT_OBJ before, probably some copy-pasting going on).


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6342 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-19 21:32:11 +00:00
cutealien
a2bb74096d IVertexBuffer and IIndexBuffer reallocate functions now pass through canShrink parameter to array
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6341 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-19 15:43:39 +00:00
cutealien
24f2a1e9ab Rename IMeshLoader::setPreferredIndexType to setIndexTypeHint and give it a new enum.
Giving the loader it's own enum allowed me to add more options. 
EITH_OPTIMAL which reduces buffers back to 16-bit if they don't need 32-bit.
Using that in obj loader.
Also 32-bit meshes with EMT_PARALLAX_MAP_SOLID material should now work in obj loader (untested as I got no test-case)


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6340 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-19 13:10:16 +00:00
cutealien
d484711f2e CVertexBuffer no longer re-allocates stuff when type doesn't change
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6339 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-19 12:21:44 +00:00
cutealien
49616fd438 CIndexBuffer no longer re-allocates stuff when type doesn't change
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6338 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-19 12:18:15 +00:00
cutealien
fc1e2c3b91 Rename some internal/unused draw2DImage function in COpenGLDriver to draw2DImageQuad to avoid warnings.
Also added a bit documentation about what it's purpose seems to be (hope I got it right...).


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6336 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-15 18:36:56 +00:00
cutealien
c5b349ddb0 Add IMeshBufffer::clone for buffer copies, use it in CMeshManipulator::createMeshCopy
CMeshManipulator::createMeshCopy creates new meshes which have copies of the actual meshbuffers instead of copying everything into SMeshBuffers (which didn't support 32 bit or any of the other special features).



git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6335 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-14 16:54:06 +00:00
cutealien
8447d3f531 obj writer can now write 32 bit buffers
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6334 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-14 14:39:31 +00:00
cutealien
c58afe8038 IMeshLoader can now set hints to prefer 16/32 bit buffers. Obj loader can now load 32 bit buffers.
- IMeshLoader::setPreferredIndexType and getPreferredIndexType allow setting hints for the loaders if users prefer 16 or 32 bit meshbuffers. Loaders are free to ignore those hints (all but .obj will do that for now).
- obj meshloader loads now 32-bit buffers when setPreferredIndexType is set to EIT_32BIT.
NOTE: It's 16 bit meshes use now also an IDynamicMeshbuffer instead of an SMeshBuffer.
That will break the code of people who accessed meshbuffer before by casting to SMeshBuffer*
And might even be somewhat slower (lot's of virtual functions...), but shouldn't really matter and can maybe be a bit improved.
Sorry about that, I considered keeping SMeshBuffer for 16-bit (still considering it), but it would add some overhead in code and I don't think it's worth that. If there are any complains I'll maybe consider it again.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6333 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-14 14:03:39 +00:00
cutealien
456bf86e66 Add missing IRR_OVERRIDE in some functions.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6332 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-12 21:58:35 +00:00
cutealien
f9c85f380d Adding comments.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6331 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-12 16:04:56 +00:00
cutealien
71e9798d2a Add IMeshBuffer::getType
Allows to find out which class a meshbuffer has.
I used the same kind of style as ISceneNode::getType. So using four CC codes and virtual functions (instead of type variable).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6330 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-11 14:36:49 +00:00
cutealien
64fc9113fc Split CNullDriver::checkImage into 2 functions to avoid some memory allocations in addTexture
Avoid creating dummy arrays when we work with non array images.
Just a minor speed improvement.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6329 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-06 20:20:36 +00:00
engineer_apple
2ddd6f5355 typo
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6328 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-04 16:37:55 +00:00
cutealien
3dc5f8fd9f Replace more getSize() with getOriginalSize() calls in tests.
Textures involved had all power of two sizes anyway, so no real difference in this case, just a bit cleaner.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6326 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-30 21:52:26 +00:00
cutealien
3aac180dc7 Print out colorformat when screenshot test fails
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6325 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-30 16:54:46 +00:00
cutealien
5785b73d47 Add documentation that sourceRect of draw2dImage is based on the OriginalSize
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6324 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-30 10:49:13 +00:00
engineer_apple
8e2e2886a9 for using correct subimage tex-coordinates in the gui texture->getOriginalSize has to be used
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6323 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-30 08:11:58 +00:00
cutealien
ddb2028231 Add another screenshot test
Drawing the screenshot itself before taking final result to see if the problem is in the render or the screenshot
Note: Test-images for software-drivers show some other problems there which this test wasn't about.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6322 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-29 20:24:24 +00:00
cutealien
aa839d45a1 Stop linking to libs which the tests Makefile does not seem to need
Tests seem to work fine without -Xext and -Xcursor so kicking those out for now.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6321 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-28 22:11:26 +00:00
cutealien
044fe29f3d Slow down switching drivers in orthoCam test.
Add 2 missing test-files to c::b project file.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6320 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-28 19:52:00 +00:00
cutealien
71d952acfc Add version 130 requirement to cubeMapReflection.frag
Thanks @juozas for reporting the bug: https://irrlicht.sourceforge.io/forum/viewtopic.php?f=7&t=13869&start=390


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6319 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-27 19:27:19 +00:00
cutealien
da77810fb5 Comment fixes in example 25
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6318 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-25 18:25:33 +00:00
cutealien
f0c890d3ff Minor improvements and cleanup for example 24.CursorControl
- ESC now also makes cursor visible again (probably first key users press in panic usually)
- Bunch of spelling fixes
- Let all words in UI elements start with upper-case

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6317 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-25 17:54:28 +00:00
cutealien
60538c3646 Fix comment.
(Did I have a stroke when I was typing the old one?)


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6316 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-24 22:24:13 +00:00
cutealien
f013a95a0e Improve UI behavior in resizing in example 22.MaterialViewer
Also a bit better defaults for sizes and positions of nodes&camera

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6315 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-24 21:32:12 +00:00
cutealien
3f13323e60 Allow switching between cube/sphere in example 22.MaterialViewer
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6314 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-24 21:14:37 +00:00
cutealien
669ad7860a Add new cube mesh type ECMT_1BUF_24VTX_NP. CubeSceneNodes can now use different cube mesh types.
1 Meshbuffer with 24 vertices, so each side has it's own vertices.
Normals perpendicular to the cube-sides.
CubeSceneNode accepts now a ECUBE_MESH_TYPE
CubeSceneNode::clone now also clones rotation and scale (not sure why it didn't do that before - hope there was no reason, but can't think of any).
ISceneManager::addCubeSceneNode accepts now a ECUBE_MESH_TYPE and passes it through.
Example 22.MaterialViewer using new cube type. Also a few more beauty fixes there.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6313 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-22 22:08:33 +00:00
cutealien
f61b8614ab Cleanup example 22.MaterialViewer
Using default light values which work a bit better with cube.
But really needs another cube-type (which Irrlicht has not yet, needs single material with 24 vertices)
as a cube with vertex normals which average connected sides is horrible with vertex-lighting
(the problem is that the light get's behind the plane formed by the vertex-normal this way which is super confusing).
Will probably add another cube-type soon.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6312 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-20 19:09:40 +00:00
cutealien
73247f4a21 Make UI in example 22.MaterialViewer a bit nicer.
Less black on grey text.
Prevent controlling light and ui-elements same time.
Bit more compact code in a few places.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6311 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-19 16:07:38 +00:00
cutealien
8254c0848c Minor cleanup and comment fixes in example 21
Mostly spelling stuff. 
Only real code change is that Irrlicht has by now a function to fill images, so no more extra code for that needed.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6310 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-17 20:12:40 +00:00
cutealien
3035e27e67 Remove unused variable in example 19
Added that one accidentally in my last commit (leftover from a failed experiment)

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6309 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-17 19:16:28 +00:00
cutealien
713018cae1 Minor update for example 19.MouseAndJoystick.
Don't move the mouse anymore when the mouse hasn't moved.
This was sometimes confusing because events are only caught inside the window (at least on Windows),
which lead to the node moving seemingly randomly when the mouse was outside.
Also added a few more comments to mention CursorControl as an alternative.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6308 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-16 20:59:43 +00:00
cutealien
e50adc3066 Add tiny UI to SplitScreen example and some minor cleanup.
Just to show that GUI can be used print usable keys on screen.
Also ESC can be used now to quit.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6307 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-15 19:31:04 +00:00
cutealien
d31b7aa261 Minor comment changes in example 16
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6306 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-14 17:59:47 +00:00
cutealien
530ddbf32f line2d::intersectWith now using f64 instead of f32 internally
Avoid losing precision when working with line2d<f64>

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6305 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-14 15:11:05 +00:00
cutealien
709cbe9df6 Avoid some more warnings when working with CMatrix4<f64>
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6304 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-10 12:51:10 +00:00
cutealien
c5fd5bc4cd Avoid warnings when working with CMatrix4<f64>
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6303 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-10 12:24:03 +00:00
cutealien
c20d3d08b6 Cleanup code & documentation of Example 14 a bit.
Note: Turns out we never got rendering into 2 OpenGL Windows same time working.
Not going to look into this for now as it's not a new bug (never seems to have worked).
If anyone has more information (like maybe it's not possible?) be nice and tell us in the forum.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6302 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-09 18:26:23 +00:00
cutealien
3ad07543be Add IGUIImage::flip to allow flipping/mirroring images.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6301 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-03-08 18:44:23 +00:00
cutealien
3da5987f4b IVideoDriver::setMaterialRendererName now using u32 for index like other similar functions
Other functions like getMaterialRendererName got switched to u32 in the past. I can see no reason why this one was left out, so changing it to be same as the rest.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6300 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-02-09 19:28:45 +00:00
cutealien
19b003a840 IBillboardSceneNode got functions to access meshbuffers.
So uv-coordinates can now be modified directly (previously only possible via texture matrix).


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6299 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-02-08 21:00:12 +00:00
cutealien
57f518737d vector3d scalar operator/ and operator/= no longer multiply by the inverse but use the expected division.
That was a bad case of premature optimization.
Multiplication is indeed faster, but when working with floats this can introduce some rather unexpected inaccuracies.
Like x/x suddenly no longer being 1.0 (something guaranteed by division). 
If someone really needs this back, then please add some new function which makes it clear we don't just have a typical division here.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6298 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-02-03 14:47:41 +00:00
cutealien
42c0b17435 Relax test a bit. Minor example cleanup.
Invisible difference, probably some mip-mapping pixel.
Getting rid of some unnecessary global in example 14


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6297 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-01-22 16:42:12 +00:00
cutealien
0fb6891267 Avoid some warnings from static code analysis.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6296 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-01-22 15:54:43 +00:00
cutealien
62cf8296b1 Bugfix: XML reader no longer drops last character in strings after certain character replacments
Due an off-by-one error it went wrong where there a special character replacement for the second-last character going on.
So something like "&lt;X" became "<" instead of "<X".

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6295 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-01-11 14:45:08 +00:00
cutealien
31f5da289f Remove CPPFLAG -I/usr/X11R6/include in all example Makefiles
None uses X11 directly, this is only needed in the Library itself.
Also this was even added on all platforms while many don't even have X11.
Thanks @Isomorphix noticing something off about that once (a long time ago...): https://irrlicht.sourceforge.io/forum/viewtopic.php?f=1&t=49033


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6294 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-01-09 15:50:41 +00:00
cutealien
1dbab53e5a Prefer static_cast to reinterpret_cast where possible.
Just safer. Could probably do in a lot more places... another time.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6293 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-01-08 18:22:20 +00:00