Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write the internal buffers when creating a new cr2w from json #23

Merged
merged 1 commit into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion WolvenKit.CR2W/CR2W/CR2WFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public CR2WFile(LoggerService logger=null)

// misc
private uint headerOffset = 0;
private bool m_hasInternalBuffer;
public bool m_hasInternalBuffer;
//private Stream m_stream; //handle this better?
// private string m_filePath;

Expand Down
8 changes: 8 additions & 0 deletions WolvenKit.CR2W/JSON/CR2WJsonTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ public static bool ImportJSON(string jsonPath, string cr2wPath, CR2WJsonToolOpti
return false;
}

for (int i = 0; i < cr2w.buffers.Count; i++)
{
if (cr2w.buffers[i].Data != null)
{
cr2w.m_hasInternalBuffer = true;
break;
}
}
WriteCR2W(cr2w, cr2wPath);
return true;
}
Expand Down