Commit Graph

27 Commits (d0703a5a3af4625bf1bdc865e970abd80a63deec)

Author SHA1 Message Date
Kim Kulling 3476c79801
Static code analysis fixes (#5447)
* Static code analysis fixes

- Fix warning in LOW

* Fix possible out of bound access.

* Add default to class declaration
2024-01-31 09:30:54 +01:00
Kim Kulling c08e3b4abb
Add bounds checks to the parsing utilities. (#5421)
* Add bounds checks to the parsing utilities.

* Fix merge conflicts in ACLoader.

* Fix loaders

* Fix unittest of AC-Loader.

* Remove dead code.

* Md5Parser fixes

* Fix md5-parsing

* Fix Merge conflict

* Fix merge conflicts.

* Md5: Fix warning: missing return statement.
2024-01-30 14:32:41 +01:00
Kim Kulling 8cf2d6e588 Refactoring: Some cleanups 2023-11-12 21:09:33 +01:00
PencilAmazing 0bacc7134d Remove debugging code, clean up some notes 2023-07-02 14:32:17 -04:00
PencilAmazing 19da9cc84d Port mesh loading to pugixml. Untested. 2023-07-02 14:32:12 -04:00
dog 3e1fd74940 Fix up scene loading. pugixml is a breadth-first parser while irrxml is
a depth first. This only parses scene structure, no mesh loading yet.
2023-07-02 14:30:54 -04:00
PencilAmazing 537b445a59 Apply clang-format to files 2023-07-02 14:17:52 -04:00
Krishty 36305cf987 Tidy Up Constructors and Destructors
This commit does not add or remove c’tors or d’tors, so it is *not* ABI-breaking.

If a c’tor/d’tor does nothing else than the default behavior, this commit replaces it with “= default”.

If an initializer list entry does nothing else than the default behavior, this commit removes it. First and foremost, remove default c’tor calls of base classes (always called by the compiler if no other base c’tor is explicitly called) and c’tor calls of members with complex types (e.g. “std::vector”).

In a few instances, user-defined copy c’tors / move c’tors / assignment operators / move assignment operators were replaced with “= default”, too. I only did this if I had a clear understanding of what’s going on.
2023-01-16 21:47:11 +01:00
Aaron Gokaslan d635bc6914 Fix some indentation 2022-11-08 11:19:12 -05:00
Aaron Gokaslan ccfb175460 Apply various clang-tidy checks for smartprs and modern C++ types 2022-11-08 11:03:55 -05:00
Aaron Gokaslan 6fa21dcc6e Explicitly default all empty dtors 2022-08-25 11:32:59 -04:00
Kim Kulling 05746acb07 Merge branch 'new-file-detection' of https://github.com/krishty/assimp into krishty-new-file-detection 2022-01-16 20:41:24 +01:00
Kim Kulling 50c7301a38 Update copyrights 2022-01-10 21:13:43 +01:00
Krishty 5895c0c22c more const in format detection
BaseImporter::SearchFileHeaderForToken() expected a pointer to a non-const token list. This was probably an oversight, as nobody would realistically expect the function to change the list. Furthermore, it prevented token lists from being compiled to read-only memory, in some cases even causing the compiler to generate thread-safe initialization.

The list is now const and all callers declare their token lists static const, thus compiling them to read-only memory.
2021-09-11 23:23:05 +02:00
Jason C 98f586c8d4 [irr] Fail if file could not be parsed.
Fail instead of returning empty scene.

Partially addresses #3888.

TODO: Propagate XML error detail through exception (depends on #3881).
2021-05-05 17:48:44 -04:00
Krishty b79b84d34e Merge branch 'master' into new-file-detection 2021-05-05 00:09:42 +02:00
Krishty 0f3e6e2941 replaced std::size() with AI_COUNT_OF for pre-C++20 compilers 2021-05-05 00:08:54 +02:00
Krishty b00de10eb3 Simplified importer search and fixed a few bugs
The search for a matching importer had a few issues, see #3791. There were two different mechanisms to determine whether an importer accepts a specific file extension:
1. `aiImporterDesc::mFileExtensions`, which was forwarded to the UI via `BaseImporter::GetExtensionList()`.
2. `BaseImporter::CanRead()` when called with `checkSig == false`, which determines whether to actually use that importer.
Both were redundant and got out of sync repeatedly. I removed 2. completely and replaced it with 1., thereby syncing UI/import and shortening all `BaseImporter::CanRead()` implementations.

Further bugfixes:
- fixed glTF2 importer throwing exceptions when checking whether it can load a file
- removed `BaseImporter::SimpleExtensionCheck()` because it is no longer used and had a bug with case sensitivity

Since the `checkSig` parameter in `BaseImporter::CanRead()` is now useless, it can be removed completely. I’m not sure if this would break ABI compatiblity, so I’ll submit it with a later pull request.
2021-04-24 00:17:50 +02:00
Krishty f761dc72f4 style fix - initializing and assigning empty std::string properly
std::string s(""); s = ""; calls the copy constructor, which in turn calls strlen(), … assigning a default-constructed string generates fewer instructions and is therefore preferred.

With C++11 uniform initialization, you’d simply write s = { } instead.
2021-04-16 23:43:56 +02:00
Kim Kulling 9e8dbd0ca5 Update copyrights to 2021. 2021-02-28 12:17:54 +01:00
Kim Kulling 73fa2cbe88 Fix memory handling of xml-nodes in the parser. 2020-09-01 21:48:50 +02:00
Kim Kulling 77b705048b fix merge issues. 2020-07-04 13:42:23 +02:00
Kim Kulling b1369d0912 next steps. 2020-07-02 15:18:59 +02:00
Kim Kulling fb20e15163 start to migrate colladat and amf 2020-06-27 15:57:06 +02:00
Kim Kulling 6205af4efb replace NULL and avoid ai_assert with more than 2 tests. 2020-06-23 21:05:42 +02:00
Kim Kulling 2be731d1bf Merge branch 'master' into pugi_xml 2020-05-22 10:09:46 +02:00
Kim Kulling f8e6512a63 Move format importer and exporter into its won folder. 2020-05-02 15:14:38 +02:00