Skip to content

Commit

Permalink
Merge pull request #23 from dingdio/json_internalbuffers
Browse files Browse the repository at this point in the history
write the internal buffers when creating a new cr2w from json
  • Loading branch information
rfuzzo authored Jan 13, 2023
2 parents 4124f8e + 78578ba commit d137ba4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

0 comments on commit d137ba4

Please sign in to comment.