Skip to content

Add read flags: include info, include data, objects only#37

Merged
foxtacles merged 12 commits intomasterfrom
read-flags
Nov 22, 2025
Merged

Add read flags: include info, include data, objects only#37
foxtacles merged 12 commits intomasterfrom
read-flags

Conversation

@foxtacles
Copy link
Member

@foxtacles foxtacles commented Aug 13, 2025

This adds flags to the Read functions, in order to allow parsing meta information from a SI file:

  • IncludeData: reads data of objects
  • IncludeInfo: writes to the info object
  • ObjectsOnly: reads objects only, excludes everything else

Reading ISLE.SI

  • with IncludeData + IncludeInfo (default): 314MB
  • with IncludeInfo: 17MB
  • with ObjectsOnly: 5.6MB
    (3.2MB was the test program itself in memory)

Close #34

@foxtacles foxtacles requested a review from itsmattkc August 13, 2025 20:52
@foxtacles foxtacles changed the title Add read flags: headers only and no info Add read flags: no info, no data, objects only Aug 15, 2025
@foxtacles foxtacles changed the title Add read flags: no info, no data, objects only Add read flags: include info, include data, include objects Oct 24, 2025
@foxtacles foxtacles changed the title Add read flags: include info, include data, include objects Add read flags: include info, include data, objects only Oct 24, 2025
@foxtacles foxtacles requested a review from madebr October 24, 2025 19:17
Copy link
Contributor

@madebr madebr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forwarding the thorough review to @itsmattkc

@madebr madebr mentioned this pull request Nov 20, 2025
@madebr
Copy link
Contributor

madebr commented Nov 20, 2025

@foxtacles
Is this patch correct for isle-portable to work with this branch?

--- a/extensions/src/siloader.cpp
+++ b/extensions/src/siloader.cpp
@@ -242,10 +242,10 @@ bool SiLoader::LoadFile(const char* p_file)
 
        MxString path = MxString(MxOmni::GetHD()) + p_file;
        path.MapPathToFilesystem();
-       if (si.Read(path.GetData(), si::Interleaf::ObjectsOnly | si::Interleaf::NoInfo) != si::Interleaf::ERROR_SUCCESS) {
+       if (si.Read(path.GetData(), si::Interleaf::ObjectsOnly) != si::Interleaf::ERROR_SUCCESS) {
                path = MxString(MxOmni::GetCD()) + p_file;
                path.MapPathToFilesystem();
-               if (si.Read(path.GetData(), si::Interleaf::ObjectsOnly | si::Interleaf::NoInfo) !=
+               if (si.Read(path.GetData(), si::Interleaf::ObjectsOnly) !=
                        si::Interleaf::ERROR_SUCCESS) {
                        SDL_Log("Could not parse SI file %s", p_file);
                        return false;

@foxtacles
Copy link
Member Author

@foxtacles Is this patch correct for isle-portable to work with this branch?

--- a/extensions/src/siloader.cpp
+++ b/extensions/src/siloader.cpp
@@ -242,10 +242,10 @@ bool SiLoader::LoadFile(const char* p_file)
 
        MxString path = MxString(MxOmni::GetHD()) + p_file;
        path.MapPathToFilesystem();
-       if (si.Read(path.GetData(), si::Interleaf::ObjectsOnly | si::Interleaf::NoInfo) != si::Interleaf::ERROR_SUCCESS) {
+       if (si.Read(path.GetData(), si::Interleaf::ObjectsOnly) != si::Interleaf::ERROR_SUCCESS) {
                path = MxString(MxOmni::GetCD()) + p_file;
                path.MapPathToFilesystem();
-               if (si.Read(path.GetData(), si::Interleaf::ObjectsOnly | si::Interleaf::NoInfo) !=
+               if (si.Read(path.GetData(), si::Interleaf::ObjectsOnly) !=
                        si::Interleaf::ERROR_SUCCESS) {
                        SDL_Log("Could not parse SI file %s", p_file);
                        return false;

Yep!

@madebr
Copy link
Contributor

madebr commented Nov 22, 2025

This needs a rebase on top of current master for isle-portable :)

@foxtacles foxtacles merged commit 610aaa1 into master Nov 22, 2025
2 checks passed
@foxtacles foxtacles deleted the read-flags branch November 22, 2025 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow lazy loading SI files

3 participants