Commit Graph

14 Commits

Author SHA1 Message Date
cutealien
f06347c8b7 Load top-down bmp images correctly
Previously we handled all sizes as unsigned, but Windows BMP files can have negative height to signal top-down images.
No clue about left-right (would be trivial to swap as well, but found no info so far if that would be correct)

Also casting away some new compile warning in gcc for COBJMeshFileLoader


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6558 dfc29bdd-3216-0410-991c-e03cc46cb475
2023-10-05 21:04:55 +00:00
cutealien
099f83c023 Fix compiler warning in COBJMeshFileLoader
Caused by recent patches for 1.8 - which still had different parameter types in IReadFile::read

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6557 dfc29bdd-3216-0410-991c-e03cc46cb475
2023-10-03 15:55:45 +00:00
cutealien
b6e9202272 Merging r6551 through r6553 from branch releases/1.8 to trunk
All about bounds checks and preventing buffer overruns in b3d and obj files based on sfan5 patches for Minetest


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6554 dfc29bdd-3216-0410-991c-e03cc46cb475
2023-10-03 15:08:40 +00:00
cutealien
7fd0f2b1fb COBJMeshFileLoader: Avoid memory leak when handling files with invalid vertex indices
Thanks @sfan5 for report and patch
Was part of the Minetest commit 80e1609 patch which was applied earlier
(couldn't apply this with the rest as the rest could be fixed in Irrlicht 1.8, while this one is about new Irrlicht 1.9 code)


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6548 dfc29bdd-3216-0410-991c-e03cc46cb475
2023-10-02 21:49:08 +00:00
cutealien
5a6e8c9d65 Merging r6522 through r6546 from branch releases/1.8 to trunk
- Fixing buffer overflows in bmp and obj loaders
- Fixed loading of rle4 encoded bmp images


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6547 dfc29bdd-3216-0410-991c-e03cc46cb475
2023-10-02 21:42:40 +00:00
cutealien
ce1cdd2543 Clean-up include dependencies (scene namespace)
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6527 dfc29bdd-3216-0410-991c-e03cc46cb475
2023-08-14 22:01:22 +00:00
cutealien
920e327d33 Spelling fixes
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6458 dfc29bdd-3216-0410-991c-e03cc46cb475
2023-04-01 15:50:08 +00:00
cutealien
7d2dbdd0c8 Unify & improve log messages
Lots of places where coders did not realize our Printer::log with hint adds a ": " string between message and hint
Which caused uglier messages in a few places (added documentation for that, maybe helps?)
Some added info in a few places
Some whitespace unification
Some spelling unification


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6414 dfc29bdd-3216-0410-991c-e03cc46cb475
2022-06-30 16:23:48 +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
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
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
9147d4ade8 COBJMeshFileLoader using a bit more exact color conversion for 0-1 to 0-255 range
Same now as SColorf::toSColor


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6214 dfc29bdd-3216-0410-991c-e03cc46cb475
2021-05-07 12:41:57 +00:00
engineer_apple
6f8b0cef96 remove source warnings
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6091 dfc29bdd-3216-0410-991c-e03cc46cb475
2020-02-22 22:01:57 +00:00
cutealien
8310a3fbad Avoid warning and make local variable lower-case.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6000 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-12-12 16:32:41 +00:00