Commit Graph

161 Commits

Author SHA1 Message Date
cutealien
df17e52a05 CXMeshFileLoader: initialize normals (and other S3DVertex values ) to 0 when loading
Thanks @sfan5 for patch in Minetest: 0500a7798b
Changed it slightly as more value were not initialized than just normals.
Forum: https://irrlicht.sourceforge.io/forum/viewtopic.php?f=2&t=52819&p=306518#p306518


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6354 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-21 21:11:48 +00:00
cutealien
8fcc572845 CB3DMeshFileLoader: abort if offsets point outside of file
Thanks @sfan5 for patch in Mintest: 195759100f
Forum: https://irrlicht.sourceforge.io/forum/viewtopic.php?f=2&t=52819&p=306518


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6353 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-21 20:50:15 +00:00
cutealien
0317f678fb Fix bounds checking in CMemoryWriteFile::seek
Thanks @sfan5 for patch: a3d848ff8b
Note I also modified the bounds checks for CMemoryReadFile once more to unify it with how Minetest fixed it. 
Due to some strange coincidence I had run into that bug yesterday for CMemoryReadFile and fixed it without realizing a fix was also part of a bunch of patches I had gotten 3 days earlier in the forum:
https://irrlicht.sourceforge.io/forum/viewtopic.php?f=2&t=52819&p=306518#p306518


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6352 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-21 20:39:31 +00:00
cutealien
a48b3a8d00 Fix not properly resizing on macOS due to incorrect window size
Thanks @torleif, Jordach and sfan5 for patch in Minetest: fa7a5dbdef
Forum: https://irrlicht.sourceforge.io/forum/viewtopic.php?f=2&t=52819&p=306518#p306518
Note: Not tested by me, as usual with OSX patches I just apply it as it seems to make sense.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6351 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-21 20:21:56 +00:00
cutealien
4d8d638ce2 Avoid warning
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6350 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-20 22:16:33 +00:00
cutealien
439667b369 Speed up stl format loading, especially with text format.
Loading whole file now in memory (unless it's already a memory file).
And avoiding lots of memory allocations otherwise by buffering token string in class object.
Was a bit unusable before for large files (several minute loading times now down to a second)-

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6349 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-20 22:09:03 +00:00
cutealien
9504b3da21 Prevent CMemoryFile to seek to a point before the start.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6348 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-20 21:57:25 +00:00
cutealien
3f2f98d7bd stl mesh writer can now write 32 bit meshbuffers.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6347 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-20 18:31:03 +00:00
cutealien
28e092673f b3d writer can now write 32-bit meshbuffers.
Still can't read it though - reader needs SSkinMeshBuffer which only supports 16 bit so far
(changes in loader are just spelling fixes in comments)

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6346 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-04-20 17:56:40 +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
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
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
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
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
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
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
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
cutealien
cfb27d9a74 Add some error checking in COSOperator::copyToClipboard
GlobalAlloc and GlobalLock can return NULL

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6292 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-01-08 17:36:20 +00:00
cutealien
9e27a6d4bf Avoid allocating more than 16k on stack in OCT loader.
Also avoid potential heap overwrites in there.
Sadly I have no examples for OCT files and it doesn't seem like a very common format as I couldn't even find any examples online.
So just assuming my changes work.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6291 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-01-08 17:30:06 +00:00
cutealien
98aed6ba67 utf8ToWchar and wcharToUtf8 work with sizeof checks instead of defines now to call correct conversion
Tiny speed hit, but old solution caused warnings. 
And it was not very safe by assuming all non _WIN32 platforms would use 32 bit sizes for wchar_t.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6290 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-01-08 15:19:46 +00:00
cutealien
c2ff824550 Define out unused functions in dmf loader to avoid warnings.
I don't know enough about DeleD from Delgine to fix this. 
But keeping the functions defined out as long as they don't get in the way.
Also I'm a bit suspicious about the license... for use in Irrlicht core only under zlib license?
That's not really zlib license then :-(


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6289 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-01-07 17:24:38 +00:00
cutealien
ed693fddca Avoid some warnings.
gcc does not like mixing enums and numbers


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6288 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-01-07 16:47:56 +00:00
cutealien
3e7a4666d5 Merging r6283 through r6284 from branch releases/1.8 to trunk
- Updating to zlib 1.2.11


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6285 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-01-07 16:23:03 +00:00
cutealien
30b78dab9b Merging r6274 through r6281 from branch releases/1.8 to trunk.
- Updates bzip2 to 1.0.8 (which sadly didn't reduce the amount of compile warnings, but let's hope it still improves something)


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6282 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-01-07 15:45:58 +00:00
cutealien
dadbf64a8c Merging r6274 through r6276 from branch releases/1.8 to trunk
- Security fix for md2 loader


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6277 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-01-02 20:15:24 +00:00
cutealien
e7c7e36347 obj file loader now allows using mtl files with spaces in the filename.
mtllib commands previously used only the first word, now they use the rest of the line.
Different obj format descriptions describe the mtllib command in 2 different ways:
- http://paulbourke.net says it can load several mtl files separated by spaces
- Wikipedia says it can load one mtl file (but there can be several mtllib commands)
We previously loaded 1 file - using the name up to the first space character, so it basically was not correct for either solution. We now go with Wikipedia, because it allows using space in filenames and I tested several other tools and they all handled it like this.

Also COBJMeshFileLoader::copyLine no longer copies the newline character (didn't do that always anyway and we don't need it)


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6275 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-12-22 16:19:59 +00:00
cutealien
2bed22acbb Merging r6270 from branch releases/1.8 to trunk
- Prevent buffer overflow in md2 loader


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6271 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-12-12 13:55:03 +00:00
cutealien
73d562d745 Merging r6266 through r6268 from branch releases/1.8 to trunk
- Spelling fixes
- Makefile adding to CFLAGS instead of replacing them.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6269 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-12-05 20:25:26 +00:00
cutealien
377e9c59df Change _IRR_OVERRIDE to IRR_OVERRIDE also on OSX headers.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6256 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-08-27 19:19:09 +00:00
cutealien
b691098fae Unify VS project files some more.
Trying to clarify comments in irrLegacyDefines.h

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6254 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-08-27 18:09:14 +00:00
cutealien
3d2a55e788 Replace header guards in source folder to avoid using identifiers reserved by c++
Basically fixing original Bug#427 reported by MArkus Elfring.
Unfortunately there are still more defines (in IrrCompileConfig.h) which also are not nice c++
Lots of files touched for very minor cleanup *sigh*

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6253 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-08-27 15:55:04 +00:00
cutealien
0c6385cb92 Replace public header guards to avoid using indentifiers reserved by c++
Usually something like __IRR_SOME_GUARD_INCLUDED__ replaced by IRR_SOME_GUARD_INCLUDED.
Removing underscores at the end wasn't necessary, but more symmetric (probably the reason they got added there as well).
While this touches every header it shouldn't affect users (I hope).

Also a few whitespace changes to unify whitespace usage a bit.
And a bunch of spelling fixes in comments.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6252 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-08-27 15:03:34 +00:00
cutealien
ffd7b63af0 API BREAKER: Replacing defines in irrTypes.h which are conflicting with c++ reserved identifier rules.
C++ has undefined behavior for identifiers starting with __ or with _ followed by an uppercase letter.
We still have many more (in IrrCompileConfig.h and in all header-guards), will likely replace those later as well.
As a workaround for users which might use irrlicht defines in their code, I've added the header irrLegacyDefines.h
Including that allows to continue using old defines for a while - or make it easier to have code which compiles 
with old and new Irrlicht library versions.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6251 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-08-27 12:55:10 +00:00
cutealien
ee180dbd24 Unify VS project files and add a few more headers into them.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6250 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-08-27 10:47:05 +00:00
cutealien
dba40bb36f PACK_STRUCT was likely ignored in ieee654 struct.
clang warned about that and I think warning made sense. Also still works on gcc - will test on VS tomorrow.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6248 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-08-26 21:32:17 +00:00
cutealien
9564827d57 Avoid clang warning.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6247 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-08-26 21:30:44 +00:00
cutealien
8e149ffb40 Avoid gcc warning and fix some indention/whitespace.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6246 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-08-26 21:09:08 +00:00
cutealien
d03881b83a Reworking IRenderTarget interface to avoid constant memory allocations.
setTexture functions for single textures (more or less the usual case) IRenderTarget no longer need memory allocations 
on each call.
Also calling IRenderTarget::setTexture with a nullpointer no longer sets a rendertarget with an array which contains a single nullpointer but clears the array instead.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6243 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-08-26 16:45:20 +00:00
cutealien
a5f38804a3 Fix singular/plural in some variable names used in rendertargets.
Still can't decide on fixing/leaving function names... brr

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6241 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-08-26 14:09:35 +00:00
cutealien
feb3d07466 SIrrlichtCreationParameters::IgnoreInput set to false works again on X11.
Thanks @ Victor Gaydov for report + patch + very good test cases! (bug #401)
This had been broken since Irrlicht 1.6
The reason was that Irrlicht 1.6 wanted to ensure Irrlicht renders to given parent window instead of creating a child window in the parent window. That still works, but only with SIrrlichtCreationParameters::IgnoreInput set to true.
Added a few comments about further improvements as rendering to the given parent Window is likely also possible for this case, but that will need more work.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6237 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-08-25 14:33:22 +00:00
cutealien
4cebe6fbde Remove commented out code.
Forgot to remove that earlier.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6235 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-08-20 16:44:23 +00:00
cutealien
fab0c53b85 Add steer parameter to CSceneNodeAnimatorFollowSpline which allows rotating node toward direction of movement.
Thanks @ Bate for the patch (patch #175 with minor changes).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6234 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-08-20 16:39:37 +00:00
cutealien
54e10d0dbe Fix problem with legacy mipmap code on legacy ATI radeon X cards.
This was patch #285 from Danyal Zia and is about old radeon cards not supporting npot textures despite claiming so I think.
Was never applied as needed some rewrite first (did string-comparisons a bit too often), so got stuck on patch-tracker.
Well, lets hope this fixes it in case anyone ever needs that specific combination ever again ;-)


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6233 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-08-20 14:46:12 +00:00